What is a preview environment?
A preview environment is a temporary, full copy of an application that is created automatically for a pull request or branch. It gets its own URL, its own services and usually its own database, so reviewers can test the change before merging. It is deleted when the pull request is merged or closed.
How it works
A webhook from GitHub, GitLab or Bitbucket tells the platform that a pull request was opened. The platform takes a blueprint, usually the definition of staging, and creates a new environment from it with the pull request's branch. It builds the container images, starts every service, creates or seeds a database, and posts the environment URL back on the pull request.
Each new commit on the branch redeploys the environment. When the pull request is merged or closed, the platform deletes everything it created. Most teams also set an automatic shutdown after a period of inactivity, because the cost of preview environments grows with the number of open pull requests multiplied by the size of each environment.
Data and external dependencies are where setups get hard. A preview environment needs test data, from fixtures or a sanitized snapshot, and its own credentials for third-party APIs, queues and storage buckets so one pull request cannot change another's data. Preview environments are the most common kind of ephemeral environment.
Examples
Product review before merge
A product manager opens the link on the pull request and checks a new checkout flow on a running copy of the frontend, backend and database, instead of reading screenshots.
End-to-end tests against the real stack
The CI pipeline runs its Playwright or Cypress suite against the preview URL, so the tests hit the same services and network setup as production.
Reviewing code written by an AI agent
A coding agent opens a pull request. The reviewer tests the running change in its own environment before approving, without pulling the branch locally. See agentic DevOps.
How Qovery does it
Qovery creates a preview environment for each pull request on Kubernetes in your own cloud account, and Qovery never hosts the application itself. The qovery-preview Agent Skill lets a coding agent set this up: it uses an existing environment as the blueprint, clones it for each pull request with the right branch and cleans it up afterwards.
Because coding agents open more pull requests than people do, the guardrails matter. API Policy Tokens limit what an agent may create or delete, RBAC applies to people, and every action is attributed in the audit log. Qovery also builds the image from your Git repository, pushes it to a registry in your cloud account and deploys it, so a preview environment needs no separate CD pipeline.
Go deeper
- Ephemeral Environments Explained: Preview Environments, Tools and Setup in 2026The long guide: tools compared and a full setup walkthrough.
- Ephemeral environments with QoveryA full stack per pull request, torn down when it closes.
- How preview environments help developer teams scaleThe review and release problems preview environments remove.