railway environment
Create, delete, edit, or link an environment.
Usage
Aliases
railway env
Subcommands
| Subcommand | Description |
|---|---|
link | Link an environment to the current project |
new | Create a new environment |
delete | Delete an environment |
edit | Edit an environment's configuration |
config | Show environment configuration |
Examples
Link an environment (interactive)
Link a specific environment
Create a new environment
Duplicate an environment
Or using the alias:
Delete an environment
Edit environment configuration
Show environment configuration
Options for
| Flag | Description |
|---|---|
-d, --duplicate <ENV> | Environment to duplicate (alias: --copy) |
--json | Output in JSON format |
Options for
| Flag | Description |
|---|---|
-y, --yes | Skip confirmation dialog |
--2fa-code <CODE> | 2FA code for verification |
--json | Output in JSON format |
Options for
| Flag | Description |
|---|---|
-e, --environment <ENV> | Environment to edit |
-s, --service-config <SERVICE> <PATH> <VALUE> | Configure a service using dot-path notation |
-m, --message <MSG> | Commit message for the changes |
--stage | Stage changes without committing |
--json | Output in JSON format |
Dot-path notation for
The --service-config flag uses dot-path notation to specify nested configuration values:
The format is: --service-config <SERVICE_NAME> <DOT.PATH.TO.PROPERTY> <VALUE>
Options for
| Flag | Description |
|---|---|
-e, --environment <ENV> | Environment to show configuration for (defaults to linked environment) |
--json | Output in JSON format |
Config examples
Show configuration for the current environment:
Show configuration for a specific environment:
Output as JSON: