|Docs

railway bucket

Manage storage buckets for your project.

Usage

Global options

FlagDescription
-e, --environment <ENV>Environment name or ID
-b, --bucket <BUCKET>Bucket name or ID (used by delete, info, credentials, rename)

Subcommands

SubcommandAliasesDescription
listlsList buckets
createadd, newCreate a new bucket
deleteremove, rmDelete a bucket
infoShow bucket details
credentialsShow or reset S3-compatible credentials
renameRename a bucket

List buckets

List all buckets deployed in the current environment.

FlagDescription
--jsonOutput in JSON format

Default output:

With --json:

Create a bucket

Create a new bucket and deploy it to the target environment. An optional name can be passed as a positional argument; if omitted, the API assigns a default.

FlagDescription
-r, --region <REGION>Bucket region. Prompted interactively if omitted.
--jsonOutput in JSON format

Available regions:

CodeLocation
sjcUS West, California
iadUS East, Virginia
amsEU West, Amsterdam
sinAsia Pacific, Singapore

Default output:

If the environment has unmerged staged changes, the operation is staged instead of committed directly. This applies to create, delete, and any other config-patching subcommand:

With --json:

Delete a bucket

Delete a bucket from the target environment. Requires confirmation unless --yes is passed.

FlagDescription
-y, --yesSkip confirmation
--2fa-code <CODE>2FA code for verification
--jsonOutput in JSON format

Default output:

If the environment has unmerged staged changes, the deletion is staged instead of committed directly:

With --json:

Show bucket info

Display bucket instance details including storage size, object count, and region.

FlagDescription
--jsonOutput in JSON format

Default output:

With --json:

Show or reset credentials

Display S3-compatible credentials for the selected bucket. The default output uses AWS_*=value lines suitable for eval or piping into .env files. Pass --reset to invalidate existing credentials and generate new ones.

FlagDescription
--resetReset S3 credentials (invalidates existing credentials)
-y, --yesSkip confirmation when resetting (requires --reset)
--2fa-code <CODE>2FA code for verification when resetting (requires --reset)
--jsonOutput in JSON format

Default output:

When --reset is used without --json, only a confirmation message is printed:

To view the new credentials after resetting, run railway bucket credentials again or use --reset --json.

With --json (both with and without --reset):

Rename a bucket

Rename a bucket. Prompts for the new name interactively, or accepts --name.

FlagDescription
-n, --name <NAME>New bucket name. Prompted interactively if omitted.
--jsonOutput in JSON format

Default output:

With --json: