- No underlying infrastructure setup and management - env zero takes care of the setup as opposed to other approaches, where you need to do all the setup and management yourself (for example, S3 Backend requires you to create an S3 Bucket and an optional DynamoDB Table for locking beforehand).
- Security - env zero stores the state securely and assures only you can access it.
- State consistency - Remote Backends assure that users won’t overwrite each other’s state with a locking mechanism and that they receive the most recent state on every Terraform operation
- Remote plans - By providing the Remote Backend configuration and successful login, users can run
terraform planlocally, which will trigger a remote plan in env zero. The remote plan will use the shared state and variables set for the env zero environment.
- No Terraform Backend configuration when running inside env zero - You don’t have to provide any type of configuration; deploy your code as is, and env zero will automatically configure it to use the Remote Backend.
- States UI - View the current version of your current state and all previous versions.
- Correlation of Deployment to State - Identify which deployment caused a specific change to your state.
- State Access Control - Specify which environments should be able to access an environment’s state in env zero.
Use Remote Backend in a New Environment
To enable Remote Backend in a new environment:- Create a new Environment
- Check the Enable Remote State checkbox
- Enter a Workspace Name


Workspace Name Restrictionsenv zero enforces that a Workspace Name must be unique among all Remote Backend environments in the Organization. The Terraform configuration for the Remote Backend consists of Organization ID and Workspace Name. Therefore, we have this limitation to block possible state conflicts.
Force Remote BackendYou can force all new Terraform environments in a project to be created with a Remote Backend. See Force remote backend for more info.
Enable Remote Backend on a workflow sub-environment
A workflow sub-environment takes the workflow’s Use env zero Remote Backend setting once, when env zero creates it, and only if its template is Terraform or OpenTofu. Sub-environments have no Settings tab, so to enable Remote Backend on an existing sub-environment, use the Update Environment API. Before you start, you need:- An API key ID and secret
- A sub-environment whose template is Terraform or OpenTofu
- If the sub-environment was deployed before, the Run Tasks permission, to migrate its state. No built-in project or environment role includes it; grant it with a custom role.
1
Get the sub-environment ID
Read it from the workflow environment with the Get Environment API.
<ALIAS> is the sub-environment’s key under environments in env0.workflow.yaml.2
Enable Remote Backend
"isRemoteBackend": true. The setting applies from the sub-environment’s next deployment.3
Migrate existing state
If the sub-environment was deployed before, env zero doesn’t copy its existing state into the Remote Backend. Migrate it before the next deployment, or that deployment either fails or plans to re-create the sub-environment’s resources.Run a task on the sub-environment that sets the environment variable Running If the sub-environment’s code configures its own backend, see Migrating State.
TF_CLI_ARGS_init to -migrate-state -force-copy ("type": 0 marks it as an environment variable). The task’s init step copies the state into the Remote Backend, and terraform state list prints the migrated resources. For OpenTofu, use tofu state list.terraform init -migrate-state as the task command doesn’t work. The task’s own init step runs first and fails with Error asking for state migration action: input is disabled.env zero saves TF_CLI_ARGS_init on the sub-environment. After the task succeeds, find the variable’s ID and delete it:- Redeploying the workflow doesn’t change the setting.
- If another Remote Backend environment in the organization uses the same workspace name, the call returns
409withWorkspace name "<WORKSPACE_NAME>" is taken by remote backend environment. You can’t change a sub-environment’s workspace name after it’s created, so give each sub-environment its ownworkspacein the workflow file before it’s first deployed.
Viewing & Downloading State Versions
After a successful deployment with Remote Backend enabled, the States tab lists all state versions, newest first.

NoteBigger state files may take a few moments to start downloading

Release a Locked State
When working with Terraform or OpenTofu, you might encounter a scenario where the state becomes locked. This usually occurs when a previous deployment did not complete successfully - due to an error, crash, or manual interruption. In such cases, the workspace retains a state lock to prevent conflicting changes during concurrent deployments. To resolve this issue, you can manually release the state lock. This action clears the lock, allowing you to re-run your deployment safely.How to release a locked state
- Navigate to the STATES tab for the affected environment.
- If the workspace is locked, you’ll see a warning along with a Force Release button.
- Click the Force Release button to clear the lock

Using the Remote Backend Locally
Please check out this guide: Using the Remote Backend on your local machineNext steps
- Self-Hosted Remote State - Store state in your own cloud storage bucket.
- Running remote plan - Trigger Terraform plans remotely via env zero.
- State Migration - Migrate existing state into the env zero remote backend.