RailwayDocs

railway up

Upload and deploy your project from the current directory to Railway.

Note: This command uploads and deploys your local code. To deploy pre-built templates (like databases), use railway deploy instead.

Usage

Options

FlagDescription
-d, --detachDon't attach to the log stream
-c, --ciStream build logs only, then exit (CI mode)
-s, --service <SERVICE>Service to deploy to (defaults to linked service)
-e, --environment <ENV>Environment to deploy to (defaults to linked environment)
-p, --project <ID>Project ID to deploy to (defaults to linked project)
--no-gitignoreDon't ignore paths from .gitignore
--path-as-rootUse the path argument as the archive root
--verboseVerbose output
--jsonOutput logs in JSON format (implies CI mode)

Examples

Basic deploy

Compresses and uploads the current directory, then streams build and deployment logs.

Deploy in detached mode

Uploads the project and returns immediately without streaming logs.

Deploy to specific service

Deploy to specific environment

CI/CD mode

Streams build logs only and exits when the build completes. Useful for CI/CD pipelines.

Deploy a subdirectory

File handling

By default, railway up:

  • Respects your .gitignore file
  • Respects .railwayignore file (Railway-specific ignore patterns)
  • Ignores .git and node_modules directories

Use --no-gitignore to include files that would normally be ignored.

Exit codes

  • 0 - Deployment succeeded
  • 1 - Deployment failed or crashed