RailwayDocs

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

SubcommandDescription
upStart services (default)
downStop services
cleanStop services and remove volumes/data
configureConfigure 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

FlagDescription
-e, --environment <ENV>Environment to use
-o, --output <PATH>Output path for docker-compose.yml
--dry-runGenerate docker-compose.yml without starting
--no-httpsDisable HTTPS and pretty URLs
-v, --verboseShow verbose domain replacement info
--no-tuiDisable TUI, stream logs to stdout

Options for

FlagDescription
--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

  • Docker with Docker Compose
  • mkcert (optional, for HTTPS support)

How it works

  1. Fetches environment configuration from Railway
  2. Generates a docker-compose.yml for image-based services (databases, etc.)
  3. Starts containers with proper environment variables
  4. Optionally runs code services locally with injected environment variables
  5. Sets up a Caddy reverse proxy for HTTPS (if mkcert is available)