Railway environments give you an isolated instance of all databases and services in a project. You can use them to

  • Have development environments for each team member that are identical to the production environment
  • Have separate staging and production environments

Each environment has the same services. This applies to database services, when added to the project, an instance of that service is created for each environment.

Deploys are also scoped to a specific Railway environment. When you create a GitHub Trigger you can specify which environment to use. When you deploy with up, the current environment will be used.

Create an Environment

You can create an environment under Settings > Environments. When you create an environment, Railway will provision the same services in the new environment as the production environment.

Screenshot of Environments Page

Environment Deploys

Running railway up with an environment selected from the CLI will create a deployment using the variables from the Environment.

Ephemeral Environments

If you enable Pull Request Deploys, a temporary environment is spun up to support the Pull Request deploy. These environments are deleted as soon as these PRs are merged or closed.

Edit this file on GitHub