CLI
The Railway Command Line Interface (CLI) lets you interact with your Railway projects from the command line.

Installing the CLI
The Railway CLI can be installed via Homebrew, npm, Scoop, or directly from the source.
Homebrew (macOS)
npm (macOS, Linux, Windows)
Requires Node.js version 16 or higher.
Shell script (macOS, Linux, Windows via WSL)
On Windows, use Windows Subsystem for Linux with a Bash shell.
Scoop (Windows)
Pre-built binaries
Download pre-built binaries from the GitHub repository.
From source
Build from source using the instructions in the GitHub repository.
Authentication
Before using the CLI, authenticate with your Railway account:
For environments without a browser (e.g., SSH sessions), use browserless login:
Tokens
For CI/CD pipelines, set environment variables instead of interactive login:
- Project Token: Set
RAILWAY_TOKENfor project-level actions - Account/Team Token: Set
RAILWAY_API_TOKENfor account-level actions
See Tokens for more information.
Available commands
Authentication
Project management
init · link · unlink · list · status · open · project
Deployment
up · deploy · redeploy · restart · down · Deploying Guide
Services
add · service · scale · delete
Variables
Environments
Local development
Logs & debugging
Networking
Volumes
Functions
Utilities
completion · docs · upgrade · starship
Global options
These flags are available across multiple commands:
| Flag | Description |
|---|---|
-s, --service | Target service (name or ID) |
-e, --environment | Target environment (name or ID) |
--json | Output in JSON format |
-y, --yes | Skip confirmation prompts |
-h, --help | Display help information |
-V, --version | Display CLI version |
See Global Options for more details.
SSH
The Railway CLI enables you to start a shell session inside your deployed Railway services:
Copy the exact command from the Railway dashboard by right-clicking on a service and selecting "Copy SSH Command".
See railway ssh for more details.
Contributing
The Railway CLI is open source. Contribute to the development of the Railway CLI by opening an issue or Pull Request on the GitHub Repo.