railway dev
Run your Railway services locally using Docker Compose, with automatic environment variable injection and HTTPS support.
Note: This is an experimental feature. The API may change without notice.
Usage
Aliases
railway develop
Subcommands
| Subcommand | Description |
|---|---|
up | Start services (default) |
down | Stop services |
clean | Stop services and remove volumes/data |
configure | Configure local code services |
Examples
Start local development
Starts image-based services (databases, etc.) via Docker Compose and prompts you to configure code-based services.
Start with verbose output
Stop services
Clean up (remove data)
Configure Code services
Interactively configure how your code services run locally (command, directory, port).
Options for
| Flag | Description |
|---|---|
-e, --environment <ENV> | Environment to use |
-o, --output <PATH> | Output path for docker-compose.yml |
--dry-run | Generate docker-compose.yml without starting |
--no-https | Disable HTTPS and pretty URLs |
-v, --verbose | Show verbose domain replacement info |
--no-tui | Disable TUI, stream logs to stdout |
Options for
| Flag | Description |
|---|---|
--service <SERVICE> | Specific service to configure (by name) |
--remove [SERVICE] | Remove configuration for a service (optionally specify service name) |
Configure examples
Configure a specific service:
Remove configuration for all services:
Remove configuration for a specific service:
Requirements
How it works
- Fetches environment configuration from Railway
- Generates a
docker-compose.ymlfor image-based services (databases, etc.) - Starts containers with proper environment variables
- Optionally runs code services locally with injected environment variables
- Sets up a Caddy reverse proxy for HTTPS (if mkcert is available)