|Docs

railway volume

Manage persistent storage volumes for your services.

Usage

railway volume <COMMAND> [OPTIONS]

Aliases

  • railway volumes

Subcommands

SubcommandAliasesDescription
listlsList volumes
addcreate, newAdd a new volume
deleteremove, rmDelete a volume
updateedit, renameUpdate a volume
detachDetach a volume from a service
filesfileManage files in a volume
browsebrowserBrowse files in a volume interactively
attachAttach a volume to a service

Examples

List volumes

railway volume list

Add a volume

railway volume add --mount-path /data

Delete a volume

railway volume delete --volume my-volume

Update volume mount path

railway volume update --volume my-volume --mount-path /new/path

Rename a volume

railway volume update --volume my-volume --name new-name

Detach volume from service

railway volume detach --volume my-volume

Attach volume to service

railway volume attach --volume my-volume --service backend

Browse volume files

railway volume browse /

Opens an interactive TUI for browsing, downloading, uploading, editing, renaming, and deleting files in the volume.

List volume files

railway volume files list /

Download a file from a volume

railway volume files download /backup.tar ./backup.tar

Upload a file to a volume

railway volume files upload ./backup.tar /backup.tar

Rename a file in a volume

railway volume files rename /backup.tar /backup-old.tar

Delete a file from a volume

railway volume files delete /backup.tar

Common options

FlagDescription
-s, --service <SERVICE>Service ID
-e, --environment <ENV>Environment ID
-p, --project <PROJECT_ID>Project ID
--jsonOutput in JSON format

Options for

FlagDescription
-m, --mount-path <PATH>Mount path for the volume (must start with /)

Options for

FlagDescription
-v, --volume <VOLUME>Volume ID or name
-y, --yesSkip confirmation
--2fa-code <CODE>2FA code for verification

Options for

FlagDescription
-v, --volume <VOLUME>Volume ID or name
-m, --mount-path <PATH>New mount path
-n, --name <NAME>New name for the volume

Options for

FlagDescription
-v, --volume <VOLUME>Volume ID or name to detach
-y, --yesSkip confirmation
--jsonOutput in JSON format

Options for

FlagDescription
-v, --volume <VOLUME>Volume ID or name to attach
-y, --yesSkip confirmation
--jsonOutput in JSON format

Manage files

Use railway volume files to manage files in a volume from scripts or non-interactive workflows.

SubcommandAliasesDescription
listlsList files in a directory
browsebrowserBrowse files interactively
downloadDownload a file or directory
uploadUpload a file or directory
deleterm, removeDelete a file
renamemvRename a file

Options for

FlagDescription
-v, --volume <VOLUME>Volume ID or name. Without this flag, the CLI prompts you to choose one

The -v, --volume flag must be passed before the subcommand (for example, railway volume files --volume data browse /).

Options for

Argument or flagDescription
[REMOTE_PATH]Directory path to list. Defaults to /
--jsonOutput in JSON format

Options for

Argument or flagDescription
<REMOTE_PATH>Remote file or directory to download
[LOCAL_PATH]Local destination. Defaults to the current directory
--overwrite, --overrideReplace the local path if it already exists
--concurrency <N>Concurrent file downloads when downloading a directory. Defaults to 32
--jsonOutput in JSON format

Options for

Argument or flagDescription
<LOCAL_PATH>Local file or directory to upload
<REMOTE_PATH>Remote destination path
--overwriteReplace the remote path if it already exists
--concurrency <N>Concurrent file uploads when uploading a directory. Defaults to 32
--jsonOutput in JSON format

Options for

Argument or flagDescription
<REMOTE_PATH>Remote file to delete
-y, --yesSkip confirmation
--jsonOutput in JSON format

railway volume files delete refuses to run when invoked by an AI agent and must be run by a human.

Options for

Argument or flagDescription
<OLD_REMOTE_PATH>Existing remote path
<NEW_REMOTE_PATH>New remote path
--jsonOutput in JSON format

Interactive file browser

The volume file browser TUI can be opened with either:

  • railway volume browse [REMOTE_PATH] — top-level shortcut
  • railway volume files browse [REMOTE_PATH] — equivalent through the files group

Options for

Argument or flagDescription
[REMOTE_PATH]Directory path to open. Defaults to /
-v, --volume <VOLUME>Volume ID or name to browse
--editor <COMMAND>Editor command to use when editing files
--concurrency <N>Concurrent file downloads. Defaults to 32

When using railway volume files browse, pass --volume on the files group (for example, railway volume files --volume data browse /). The --editor and --concurrency flags are passed on browse itself.