> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy your first environment

> Deploy your first IaC environment in env zero by selecting a template from your project, reviewing variables, clicking Run, and watching it deploy.

> [!NOTE]
>
> This step assumes you have already [created a template](https://docs.envzero.com/guides/getting-started/create-your-first-template.md).

After connecting your VCS and cloud account, deploy your infrastructure code.

1. In the left sidebar, click **Projects**, then click **Default Organization Project**. Open the **Project Templates** page.
2. Find the template you added and click **Run Now**.
3. Review the settings for this environment. If it requires any additional variables, add them here.
4. Click **Run**.

![Environment deployment interface](https://mintcdn.com/envzero-b61043c8/lGlzrnZWRsIiLt0l/images/guides/getting-started/environment_deployment_interface.png?fit=max\&auto=format\&n=lGlzrnZWRsIiLt0l\&q=85\&s=36c413a1c9ba39633e3f421f54d84725)

The **Environments** page shows the deployment status. When the status changes to **Active**, the deployment succeeded. Click the environment name to open the full deployment log and see the list of resources created. If the deployment fails, the log shows the exact error.

> [!TIP]
>
> **Clean up when you're done**
>
> The resources you deployed are real and accumulate cloud costs. When you no longer need this environment, open it and click **Destroy** to remove all resources. To automate cleanup, set a TTL on the environment. It will self-destroy after a set period.

> [!TIP]
>
> **Enable Plan on Pull Request**
>
> In your environment settings, turn on **Plan on Pull Request**. env zero will run a [plan](https://docs.envzero.com/guides/getting-started/glossary.md#plan) and post the output as a PR comment whenever you open or update a pull request against the template's branch. Your team sees exactly what infrastructure changes a PR introduces before it merges.

> [!TIP]
>
> **Try the plan-and-apply workflow**
>
> Update a variable in your template or environment settings, then click **Redeploy**. env zero runs a plan first so you can review exactly what changes before anything applies.
>
> To require a human reviewer before any apply runs, add an [Approval Policy](https://docs.envzero.com/guides/policies-governance/approval-policies.md) to your template. The next deployment pauses after the plan step and waits for explicit approval. This is how env zero enforces change control in practice.

## Troubleshooting

**Credential not assigned.** If the log shows a permissions or access error, the cloud credential may not be attached to this project. Go to **Project Settings > Credentials** and confirm your credential is checked.

**Apply fails with a permissions error.** The IAM role or service principal has insufficient permissions for a resource being created. The apply log shows the specific resource and action that was denied. Update the IAM policy to add the required permission and redeploy.

**Init fails: module not found.** If your IaC code references a private git module using `ssh://` or `https://`, env zero needs an SSH key or Git token to clone it. Attach the relevant credential to the template under [SSH Keys](https://docs.envzero.com/guides/admin-guide/variables/ssh-keys.md).

**Deployment stays Queued.** Queued deployments are processed in order. If it stays queued for more than a minute, check whether the environment is locked or another deployment for the same environment is already running.

## Next steps

* [Invite your teammates](https://docs.envzero.com/guides/admin-guide/user-role-and-team-management/user-management.md) and assign project roles
* [Redeploy automatically on every git push](https://docs.envzero.com/guides/admin-guide/environments/continuous-deployment.md)
* [Set up drift detection](https://docs.envzero.com/guides/admin-guide/environments/drift-detection.md) to catch changes made outside your IaC


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.