Railway

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/OptionExampleDescription
railway loginrailway loginLog in to your Railway account
railway whoamirailway whoamiShow information about the currently logged-in user
railway regionsrailway regionsList available regions for deployments

Project Management #

Command/OptionExampleDescription
railway projectsrailway projectsList all Railway projects
railway project createrailway project create --name <project_name>Create a new project
railway project deleterailway project delete <project_id>Delete a project
railway project switchrailway project switch <project_id>Switch to a different project

Deployment #

Command/OptionExampleDescription
railway deployrailway deploy --branch <branch_name>Deploy a specific branch of your application
railway deploy historyrailway deploy historyView deployment history
railway rollbackrailway rollback <deploy_id>Roll back to a previous deployment

Environment Variables #

Command/OptionExampleDescription
railway env listrailway env listList environment variables for the current project
railway env setrailway env set <variable_name>=<value>Set an environment variable for the current project
railway env unsetrailway env unset <variable_name>Unset an environment variable for the current project

Static Sites #

Command/OptionExampleDescription
railway static-sitesrailway static-sitesList all static sites
railway static-site createrailway static-site create --name <site_name> --repo <repository_url>Create a new static site
railway static-site deleterailway static-site delete <site_id>Delete a static site

Databases #

Command/OptionExampleDescription
railway databasesrailway databasesList all databases
railway database createrailway database create --name <db_name> --type <db_type>Create a new database
railway database deleterailway database delete <db_id>Delete a database
railway database migraterailway database migrate --database <db_id>Run database migrations

Secrets Management #

Command/OptionExampleDescription
railway secretsrailway secretsList secrets for the current project
railway secret setrailway secret set <secret_name>=<value>Set a secret for the current project
railway secret deleterailway 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.

Railway

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.