docs/platform/deploy/environments.md
Encore automatically sets up and manages different environments for your application (local, preview, testing, and production). Each environment is:
Encore has four types of environments:
productiondevelopmentpreviewlocalSome environment types differ in how infrastructure is provisioned:
local is provisioned by Encore's Open Source CLI using local versions of infrastructure.preview environments are provisioned in Encore Cloud hosting and are optimized to be cost-efficient and fast to provision.production and development environments are provisioned by Encore Cloud, either in your cloud account or using Encore Cloud's free development hosting. Both environment types offer the same infrastructure options when deployed using your own cloud account.Environment type is also used for Secrets management, allowing you to configure different secrets for different environment types. Therefore, you can easily configure different secrets for your production and development environments.
When using GitHub, you can configure Encore Cloud to automatically trigger deploys when you push to a specific branch name.
To configure which branch name is used to trigger deploys, open your app in the Encore Cloud dashboard and go to the Overview page for your intended environment. Click on Settings and then in the section Branch Push configure the Branch name and hit save.
For some environments you may want to enforce infrastructure approval before deploying. You can configure this in the Settings > Infrastructure Approval section for your environment.
When infrastructure approval is enabled, an application Admin will need to manually approve the infrastructure changes before the deployment can proceed.
Encore Cloud offers flexible process allocation options:
Choose your preferred deployment model when creating each environment. You can use different models for production and development environments without changing any code.
Every Encore app has a configurable Primary environment that serves as the default for:
Configuring your Primary environment: