Skip to main content
Unkey Deploy is currently in private beta. To get access, reach out on Discord or email support@unkey.com.
An environment is an isolated deployment target within an app. Each environment has its own deployments, variables, custom domains, and Sentinel policies.

Production and preview

Every app gets two environments:
EnvironmentPurpose
ProductionServes live traffic. Runs three Sentinel replicas for high availability.
PreviewFor testing branches before merging. Runs one Sentinel replica.
Unkey creates both environments automatically when you create a project. You don’t need to set them up manually.
Custom environments beyond production and preview are not yet available.

Branch mapping

When you connect a GitHub repository, Unkey maps branches to environments:
  • Pushes to the default branch (typically main) deploy to production.
  • Pushes to any other branch deploy to preview.
Each push creates a new deployment in the corresponding environment.

Environment-scoped configuration

Configuration is scoped per environment, so production and preview can differ:
  • Variables: Different database URLs, API keys, and feature flags for each environment
  • Custom domains: Production might use api.acme.com while preview uses auto-generated domains
  • Regions and instances: Run production in multiple regions with higher instance counts, and preview in a single region
  • Sentinel policies: Apply stricter rate limits or authentication rules in production

Sticky domains

Each environment has a sticky domain that always points to the latest deployment in that environment:
<project>-<app>-<environment>-<workspace>.unkey.app
When a new deployment reaches the Ready state, the environment domain updates automatically. You don’t need to reconfigure DNS or update your clients. Production environments also get a live domain without the environment name:
<project>-<app>-<workspace>.unkey.app
See Wildcard domains for the full domain naming pattern.

Deployments per environment

An environment can have many deployments, but only one is active at a time. In production, when a new deployment goes live, the previous one transitions to standby after 30 minutes. Standby deployments are available for rollbacks. In preview environments, deployments stay running as long as they receive traffic. Idle preview deployments (zero requests for six hours) are automatically archived to free up resources.

Next steps

Variables

Configure environment-specific variables

Custom domains

Serve your app from your own domain
Last modified on March 30, 2026