Railway Cheatsheet
#
Railway is a platform that automates deployment and management of applications and databases, with a focus on ease of use and integration with various services.
General Commands
#
Command/Option | Example | Description |
---|
railway login | railway login | Log in to your Railway account |
railway whoami | railway whoami | Show information about the currently logged-in user |
railway regions | railway regions | List available regions for deployments |
Project Management
#
Command/Option | Example | Description |
---|
railway projects | railway projects | List all Railway projects |
railway project create | railway project create --name <project_name> | Create a new project |
railway project delete | railway project delete <project_id> | Delete a project |
railway project switch | railway project switch <project_id> | Switch to a different project |
Deployment
#
Command/Option | Example | Description |
---|
railway deploy | railway deploy --branch <branch_name> | Deploy a specific branch of your application |
railway deploy history | railway deploy history | View deployment history |
railway rollback | railway rollback <deploy_id> | Roll back to a previous deployment |
Environment Variables
#
Command/Option | Example | Description |
---|
railway env list | railway env list | List environment variables for the current project |
railway env set | railway env set <variable_name>=<value> | Set an environment variable for the current project |
railway env unset | railway env unset <variable_name> | Unset an environment variable for the current project |
Static Sites
#
Command/Option | Example | Description |
---|
railway static-sites | railway static-sites | List all static sites |
railway static-site create | railway static-site create --name <site_name> --repo <repository_url> | Create a new static site |
railway static-site delete | railway static-site delete <site_id> | Delete a static site |
Databases
#
Command/Option | Example | Description |
---|
railway databases | railway databases | List all databases |
railway database create | railway database create --name <db_name> --type <db_type> | Create a new database |
railway database delete | railway database delete <db_id> | Delete a database |
railway database migrate | railway database migrate --database <db_id> | Run database migrations |
Secrets Management
#
Command/Option | Example | Description |
---|
railway secrets | railway secrets | List secrets for the current project |
railway secret set | railway secret set <secret_name>=<value> | Set a secret for the current project |
railway secret delete | railway secret delete <secret_name> | Delete a secret for the current project |
This cheatsheet covers the most commonly used Railway commands and options, helping you manage projects, deployments, static sites, databases, and secrets efficiently.