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
| Flag | Description |
|---|---|
-d, --detach | Don't attach to the log stream |
-c, --ci | Stream 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-gitignore | Don't ignore paths from .gitignore |
--path-as-root | Use the path argument as the archive root |
--verbose | Verbose output |
--json | Output 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
.gitignorefile - Respects
.railwayignorefile (Railway-specific ignore patterns) - Ignores
.gitandnode_modulesdirectories
Use --no-gitignore to include files that would normally be ignored.
Exit codes
0- Deployment succeeded1- Deployment failed or crashed