> [!CAUTION]
> You are currently viewing version 1.11 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.11 </button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/environment-delete.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/environment-delete.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/environment-delete.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/environment-delete.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/environment-delete.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/environment-delete.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/environment-delete.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/environment-delete.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/environment-delete.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/environment-delete.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/environment-delete.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/environment-delete.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/environment-delete.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/environment-delete.md.txt)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/environment-delete.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/environment-delete.md.txt)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/environment-delete.md.txt)


This topic explains how to delete environments in Apigee hybrid. See also
[About environments and environment groups](https://docs.cloud.google.com/apigee/docs/api-platform/fundamentals/environments-overview.md.txt).

## How to delete an environment

Assume that you have two environments, **test** and **prod**. In
your overrides file, the definitions might look something like this:

```
...
envs:
  - name: test
    serviceAccountPaths:
      synchronizer: "your_keypath/synchronizer-manager-service-account.json
      udca: "your_keypath/analytic-agent-service-account.json
  - name: prod
    serviceAccountPaths:
      synchronizer: "your_keypath/synchronizer-manager-service-account.json
      udca: "your_keypath/analytic-agent-service-account.json
...
```

To delete the **prod** environment, follow these steps:

1. Get your gcloud authentication credentials:

   ```
   TOKEN=$(gcloud auth print-access-token)
   ```
2. Delete the environment from any associated environment groups, one at a time:

   ```
   curl -X DELETE -H "Authorization: Bearer $TOKEN" \
     "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments/prod"
   ```
3. Do a dry run to test removal of the runtime components:

   ### Helm

   ```
   helm delete ENV_NAME --dry-run
   ```

   The `--dry-run` command will return the same results as the command without the
   `--dry-run` option. For example:

       helm -n apigee delete example-env
       release "example-env" uninstalled

   ### `apigeectl`

   ```
   $APIGEECTL_HOME/apigeectl delete -f OVERRIDES_FILE.yaml --env ENV_NAME --dry-run=client
   ```
4. If the dry run is error-free, remove the runtime components:

   ### Helm

   ```
   helm delete ENV_NAME
   ```

   ### `apigeectl`

   ```
   $APIGEECTL_HOME/apigeectl delete -f OVERRIDES_FILE.yaml --env ENV_NAME
   ```
5. Open your overrides file and remove the `prod` environment definition from `envs` and `virtualhosts`, leaving only the **test** definitions. For example:

   ```
   ...
   envs:
     - name: test
       serviceAccountPaths:
         synchronizer: "your_keypath/synchronizer-manager-service-account.json
         udca: "your_keypath/analytic-agent-service-account.json
   ...
   ```
6. Save the file.