|Docs

railway volume

Manage persistent storage volumes for your services.

Usage

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

Add a volume

Delete a volume

Update volume mount path

Rename a volume

Detach volume from service

Attach volume to service

Browse volume files

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

List volume files

Download a file from a volume

Upload a file to a volume

Rename a file in a volume

Delete a file from a volume

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.