DocsGetting startedDelete an Environment

Delete an Environment

Tear down a pull-request or API-created Environment safely from GitHub, the UI, the CLI, or the API.

Deleting an Environment queues teardown of its workloads and releases its human-readable Environment ID. Select the control surface that created or owns the Environment.

Pull-request Environments

Merge or close the pull request to tear down its Environment automatically. When the pull request remains open, apply your installation’s configured disable label to tear down the Environment. The default label is lifecycle-disabled!.

Label names are configurable. See Auto deploy and labels.

Lifecycle UI

  1. Open Environments.
  2. Select the Environment.
  3. Open Actions.
  4. Select Destroy.
  5. Check the selected Environment ID.
  6. If the Environment ID is correct, start the destructive action.

The UI disables Destroy for a pinned static Environment. Unpin it only when you intend to remove its persistence guarantee.

CLI

The CLI shows a confirmation prompt:

For non-interactive automation, use --yes only after the script checks the Environment ID:

API-created Environments

Send an authenticated request with env:write access:

The API rejects deletion of a static Environment. Use a supported UI or CLI control to remove the static pin first:

⚠️

Teardown is asynchronous. Do not reuse the Environment ID until Lifecycle no longer returns the active Environment detail.

Check teardown

Follow the status until it reaches Torn down:

Before you reuse an API-created Environment ID, wait until its detail route returns 404:

lfc builds list --all intentionally includes torn-down history. A historical row does not mean the ID is active. Application URLs also stop serving. If teardown does not complete, give the operator the Environment ID, its latest status message, and the affected Service names. Do not include secret values.