|Docs

railway up

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

If you aren't signed in, railway up signs you in first — or creates a Railway account on the fly �� then continues with the deploy. If no project is linked, it can create a new project and service from the current directory. See First run: sign up and deploy.

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

Usage

Options

FlagDescription
-d, --detach, --no-waitDon't attach to the log stream — start the deploy and return once the build is queued
-y, --yesAccept all defaults — skip the sign-in confirmation and the project-name prompt when creating a new project
--newCreate a new project + service from this directory and deploy it, even if one is already linked
--name <NAME>Name for a newly created project (defaults to the directory name)
-w, --workspace <WORKSPACE>Workspace to create a new project in (auto-selected when you only have one)
-c, --ciStream build logs only, then exit (CI mode)
-m, --message <MESSAGE>Message to attach to the deployment
-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
--jsonMachine-readable output: build logs stream as NDJSON and the result is a single JSON object (implies CI mode)

First run: sign up and deploy

railway up is a complete on-ramp — you don't need to run railway login or create a project first.

  • Not signed in? It opens a browser to sign you in. New accounts are created on the fly through the same flow — there is no separate signup step. On SSH or headless machines it prints a device code to complete sign-in from another device.
  • No project linked? Right after a sign-up — or with -y — it creates a project and service from the current directory, links them, and deploys. If you're working interactively, it asks whether to create a new project, link an existing one, or cancel.
  • Scripts and CI never create projects implicitly. A non-interactive run with no linked project fails with a structured NOT_AUTHENTICATED / no-project error instead of prompting or silently creating — set up auth with a token and link explicitly for automation.

When the deploy finishes, the CLI prints your project's dashboard link, and the public URL if the service has a domain (run railway domain to add one — up never exposes a service publicly on its own).

Examples

Basic deploy

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

Sign up (or in) and deploy in one shot

Signs you in — creating an account if needed — then creates a project from the current directory and deploys it, skipping the surrounding prompts. This is the recommended form for agent-driven and scripted first runs.

Deploy to a fresh project

Creates a brand-new project + service from the current directory and deploys it, even if the directory is already linked to another project.

Deploy in detached mode

Uploads the project and returns once the build is queued — it does not wait for the deploy to finish. Poll for the outcome:

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 reached SUCCESS (or, with --detach, the build was queued)
  • 1 - Deployment failed or crashed, or the run couldn't proceed (for example NOT_AUTHENTICATED in CI)

When attached, the exit code comes from the deployment's terminal status — a failing deploy exits 1 even if the log stream ends early.