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

# Deactivate an environment

> See how to deactivate environments you aren't using.

If you have environments you aren't using, you may want to deactivate them to save resources for what you need.
To deactivate an environment, you need to be an admin for the project or the given environment.

> [!NOTE]
>
> Your default environment is protected.
> It can't be deactivated through the Console or the CLI.
> To change which environment is the default, see how to [rename the default branch](https://developer.upsun.com/docs/environments/default-environment.md).

Deactivating the project results in the following:

* The environment becomes [inactive](https://developer.upsun.com/docs/glossary.md#inactive-environment).
  Unless it's reactivated, it's no longer deployed and isn't accessible from the web or via SSH.
* All services running on this environment are deleted.
* All data specific to the environment is deleted.
  If the environment is reactivated, it syncs data from its parent environment.

## Deactivate an environment

To deactivate an environment, follow these steps:

> [tab] In the Console
>
> 1. Select the project with an environment you want to deactivate.
> 2. From the **Environment** menu, select the environment.
> 3. Click  **Settings**.
> 4. In the row with **Status**, click \*\*Edit \*\*.
> 5. Select the checkbox to show you understand the consequences.
> 6. Click **Deactivate & Delete Data**.
> 7. Confirm your choice.

> [tab] Using the CLI
>
> Run the following command:
>
> ```bash theme={null}
> upsun environment:deactivate <ENVIRONMENT_NAME>
> ```

## Delete the branch

Inactive environments still have branches in Git.
To delete the branch entirely, run the following command:

```bash theme={null}
git push origin --delete <BRANCH_NAME>
```

## Reactivate an environment

Reactivating an environment [syncs](https://developer.upsun.com/docs/glossary.md#sync) data from its parent environment.

To reactivate an inactive environment, follow these steps:

> [tab] In the Console
>
> 1. Select the project with an environment you want to reactivate.
> 2. From the **Environment** menu, select the environment.
> 3. Click  **Settings**.
> 4. In the row with **Status**, click \*\*Edit \*\*.
> 5. Click **Activate**.

> [tab] Using the CLI
>
> Run the following command:
>
> ```bash theme={null}
> upsun environment:activate <ENVIRONMENT_NAME>
> ```

If you're not using a [source integration](https://developer.upsun.com/docs/integrations/source),
you can also activate an environment when pushing changes to it.
To do so, run the following command:

```bash theme={null}
git push -o "environment.status=active"
```

Learn more about how to [trigger actions on `push`](https://developer.upsun.com/docs/environments#push-options).


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