Create an environment
An environment, such as staging or production, is where a project's builds are deployed. It holds its own secrets and deploys, and sets whether they run on shared or dedicated compute.
What an environment does#
- Holds deploys. Every deploy is created in exactly one environment, and can't move to another one later.
- Holds secrets. Secrets are stored per environment.
DATABASE_URLinstagingandDATABASE_URLinproductionare separate values. See Environment variables and secrets. - Sets tenancy. Shared or Isolated (a dedicated node; badges show it as Dedicated). Deploys whose own tenancy is Inherit use the environment's setting.
Builds belong to the project rather than to an environment, so the same build can run in staging and then in production.
Before you start#
- A project to add the environment to.
- The Admin or Manager role. Users see environments but can't add, edit or delete them.
Create an environment#
Open the project
Go to Projects and find the project's card.
Choose Add environment
At the bottom of the card, choose Projects→Add environment. The New environment dialog opens.
Name it
Enter a Name, such as
production,stagingorpreview.Pick a tenancy
Choose the Shared or Isolated card under Tenancy. If you choose Isolated, pick a Machine type. You can change tenancy later by editing the environment. Deploys that inherit this environment run on this machine type.
Create it
Choose Create environment. The environment appears on the project card with a tenancy badge, and the machine type too if it's dedicated.
Tenancy: Shared or Dedicated#
- Shared
- The default. Deploys run on pooled, multi-tenant capacity, billed per second on the CPU and memory each replica requests. See Shared compute.
- Dedicated
- Deploys run on dedicated nodes of the chosen Machine type, billed per node while it's leased. The dashboard labels this Dedicated; the docs call it isolated compute. See Isolated compute.
A deploy can override its environment's tenancy. On the deploy, Tenancy offers Inherit, Shared and Dedicated. Inherit is the default and uses the environment's tenancy and machine type.
Edit an environment#
On the project card, choose Edit next to the environment. You can change its Name, its Tenancy and, when it's dedicated, its Machine type. Then choose Save. You can change tenancy later, and you can mix shared and dedicated environments in one project.
Delete an environment#
Choose Delete next to the environment and confirm Delete environment "name"?. The environment's secrets go with it.
Suggested setup#
Most teams start every environment on shared compute and move specific ones to dedicated as traffic or compliance needs grow. See Shared vs isolated compute.