railway bucket
Manage storage buckets for your project.
Usage
Global options
| Flag | Description |
|---|---|
-e, --environment <ENV> | Environment name or ID |
-b, --bucket <BUCKET> | Bucket name or ID (used by delete, info, credentials, rename) |
Subcommands
| Subcommand | Aliases | Description |
|---|---|---|
list | ls | List buckets |
create | add, new | Create a new bucket |
delete | remove, rm | Delete a bucket |
info | Show bucket details | |
credentials | Show or reset S3-compatible credentials | |
rename | Rename a bucket |
List buckets
List all buckets deployed in the current environment.
| Flag | Description |
|---|---|
--json | Output 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.
| Flag | Description |
|---|---|
-r, --region <REGION> | Bucket region. Prompted interactively if omitted. |
--json | Output in JSON format |
Available regions:
| Code | Location |
|---|---|
sjc | US West, California |
iad | US East, Virginia |
ams | EU West, Amsterdam |
sin | Asia 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.
| Flag | Description |
|---|---|
-y, --yes | Skip confirmation |
--2fa-code <CODE> | 2FA code for verification |
--json | Output 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.
| Flag | Description |
|---|---|
--json | Output 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.
| Flag | Description |
|---|---|
--reset | Reset S3 credentials (invalidates existing credentials) |
-y, --yes | Skip confirmation when resetting (requires --reset) |
--2fa-code <CODE> | 2FA code for verification when resetting (requires --reset) |
--json | Output 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.
| Flag | Description |
|---|---|
-n, --name <NAME> | New bucket name. Prompted interactively if omitted. |
--json | Output in JSON format |
Default output:
With --json: