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

# Environments

> Production and an isolated Preview instance for each deploy target

Every deployment target has two environments: **Production** and **Preview**. They are isolated instances with separate subdomains and separate databases. Use Preview to deploy and test a change without affecting the live app.

|          | Production                     | Preview                              |
| -------- | ------------------------------ | ------------------------------------ |
| Purpose  | The live app                   | An isolated copy for testing changes |
| URL      | `my-app.<domain>`              | `my-app-preview.<domain>`            |
| Database | The production database        | Its own separate database            |
| Created  | On the first deploy of the app | On the first deploy to Preview       |

Preview has its own database, so a migration or destructive change tested there cannot affect production data.

## Deploying to an environment

Choose the environment in the deploy dialog:

* **Preview**: deploys the selected version to the Preview instance. The first Preview deploy creates the `-preview` instance (its own subdomain and database); later deploys reuse it.
* **Production**: deploys to the live app.

The two environments hold versions independently. Preview can run a newer version while Production stays on the current release. There is no automatic promotion; Production changes only when you deploy to it.

## Environments and deploy targets

Environments exist within each [deploy target](/docs/platform-docs/deployments/byoi/multiple-regions). An app deployed to more than one target (for example, two regions) has its own Production and Preview instances in each. Each instance is independent.

## Custom domains

A [custom domain](/docs/platform-docs/deployments/vanity-urls) applies to the Production environment only. Preview always uses its default `-preview` URL.

## Deleting an environment

Production and Preview are deleted independently from the target's settings. Deleting one tears down that instance and its database; the other keeps running. Removing an app means deleting each environment you created.

<Warning>
  Deleting an environment permanently removes its database and all associated data. It cannot be undone.
</Warning>
