Encore makes it simple to create the environments you need to build your application with confidence: local, preview, testing, and production. Each environment is an isolated fully working instance of your backend, automatically provisioned by Encore.
Environments always stay in sync, as they are created based on the needs of your application, using the Encore Application Model. Environments are provisioned using contextually appropriate infrastructure depending on the type of environment.
To create an environment for your app, open your app in the Cloud Dashboard and go to the Environments page,
then click on
Create env in the top right.
There you can pick a name, and decide if you want a production or development environment (see Environment Types below).
You can also choose how you would like to trigger deploys for the environment (either by pushing to a Git branch or manually), and if you want to manually approve infrastructure changes.
Finally, select which cloud provider you want to deploy to (see the Cloud Providers documentation to learn more) and decide which type of process allocation you want: should all services be deployed to one process or separately?
Create and you're done!
Encore has four types of environments:
Some environment types differ in how infrastructure is provisioned:
previewenvironments are provisioned in Encore Cloud and are optimized to be cost-efficient and fast to provision.
localis provisioned by Encore's CLI using local versions of infrastructure.
Aside from determining infrastructure, environment type is also used for Secrets management.
When you've installed the Encore CLI, you start your local environment by simply running
This builds and tests your application, and provisions all the necessary infrastructure to run your application locally (see the infra docs to learn exactly how local infrastructure is provisioned).
By default, the local environment runs on
Preview Environments make it really easy to collaborate and test changes with your frontend.
Just update your frontend API client to point to the
This is a one-line change since your API client always specifies the environment name, e.g.
If your pull request makes changes to the API, you can generate a new API client
for the new backend API using
encore gen client --env=pr:72 --lang=typescript my-app
Encore makes it simple to create multiple cloud environments in different cloud providers by connecting your cloud account(s). Cloud environments can be created as
Production, depending on your use case (see the infra docs to learn exactly what infrastructure is provisioned in each cloud).
Just because you want to deploy each service separately in some environments, doesn't mean you want to do it in all environments.
Handily, Encore lets you decide how you want to deploy your services for cloud environments. You don't need to change a single line of code.
When you create an environment, you decide which process allocation you want for that environment.
Deploying services as separate processes is not yet supported when using AWS Fargate. For multi-process deployments, select AWS EKS or GCP CloudRun / GKE.