Railway CLI
Find a file
2025-09-10 13:19:35 -04:00
.cargo Add attribute logging (#455) 2024-05-05 11:32:47 +01:00
.github format manual docker deployment tag (#594) 2025-02-08 13:23:43 -05:00
bin release tarfiles for windows (#325) 2023-03-05 17:28:27 +00:00
npm-install fix npm install on windows (#341) 2023-03-08 14:00:56 -05:00
src Fix environment duplication timeout when process takes longer than 30s (#663) 2025-09-10 13:17:35 -04:00
.dockerignore feat: alpine dockerfile (#470) 2023-12-05 16:52:45 -05:00
.gitignore newline at end of gitignore 2025-09-10 13:19:35 -04:00
build.rs Template deploy v2 (#563) 2024-10-21 18:55:37 -04:00
Cargo.lock chore: Release railwayapp version 4.6.3 2025-08-12 21:10:22 -04:00
Cargo.toml chore: Release railwayapp version 4.6.3 2025-08-12 21:10:22 -04:00
CLAUDE.md Add CLAUDE.md with development guidance (#661) 2025-09-09 20:20:10 -04:00
CONTRIBUTING.md Point to railway.com (#585) 2025-01-08 14:33:37 -05:00
Dockerfile fix exec permission not set in railway-cli docker image (#531) 2024-08-14 13:46:58 -04:00
flake.lock Migrate to CLI v3 (#304) 2023-03-03 21:44:32 -05:00
flake.nix Fix CLI compilation (#514) 2024-06-24 16:41:23 -03:00
install.sh get latest version from GitHub release (#586) 2025-01-08 14:49:21 -05:00
LICENSE Migrate to CLI v3 (#304) 2023-03-03 21:44:32 -05:00
package.json chore: Release railwayapp version 4.6.3 2025-08-12 21:10:22 -04:00
pnpm-lock.yaml fix npm install 2023-03-04 09:25:40 -05:00
README.md Add --workspace option to railway init (#656) 2025-08-12 20:11:21 -04:00
release.toml fix release.toml (again) 2023-04-13 11:28:17 -04:00
shell.nix Minor fixes (#527) 2024-08-05 14:51:39 -03:00
v2.sh add v2 install script 2023-03-04 17:16:15 -05:00

Railway CLI

Crates.io CI cargo audit

This is the command line interface for Railway. Use it to connect your code to Railway's infrastructure without needing to worry about environment variables or configuration.

View the docs

The Railway command line interface (CLI) connects your code to your Railway project from the command line.

The Railway CLI allows you to

  • Create new Railway projects from the terminal
  • Link to an existing Railway project
  • Pull down environment variables for your project locally to run
  • Create services and databases right from the comfort of your fingertips

Installation

Cargo

cargo install railwayapp --locked

Homebrew

brew install railway

NPM

npm install -g @railway/cli

Bash

# Install
bash <(curl -fsSL cli.new)

# Uninstall
bash <(curl -fsSL cli.new) -r

Scoop

scoop install railway

Arch Linux AUR

Install using Paru

paru -S railwayapp-cli

Install using Yay

yay -S railwayapp-cli

Docker

Before using the CLI in a non-interactive environment, ensure you have created an access token (only project-tokens are supported as of now) and set it as the RAILWAY_TOKEN environment variable. CI environments are automatically detected by the presence of CI=true variable. In these environments, only build logs will be streamed, and the CLI will exit with an appropriate code indicating success or failure.

Install from the command line

docker pull ghcr.io/railwayapp/cli:latest

Use in GitHub Actions

deploy-job:
  runs-on: ubuntu-latest
  container: ghcr.io/railwayapp/cli:latest
  env:
    SVC_ID: my-service
    RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
  steps:
    - uses: actions/checkout@v3
    - run: railway up --service=${{ env.SVC_ID }}

Use in GitLab CICD

deploy-job:
  image: ghcr.io/railwayapp/cli:latest
  variables:
    SVC_ID: my-service
  script:
    - railway up --service=$SVC_ID

Tip

GitLab can access a protected (secret) variable directly, all you need to do is to add it in CI/CD settings.

From source

See CONTRIBUTING.md for information on setting up this repo locally.

Documentation

View the full documentation

Feedback

We would love to hear your feedback or suggestions. The best way to reach us is on Discord.

We also welcome pull requests into this repo. See CONTRIBUTING.md for information on setting up this repo locally.