Dec 1, live webinar: Agents in production, live: who gives the agent production access?
Glossary

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

Related terms

All glossary terms

Preview environment: frequently asked questions

What is the difference between a preview environment and staging?
Staging is one long-lived environment shared by everyone, so changes queue up and interfere with each other. A preview environment belongs to one pull request and disappears with it.
Are preview environments the same as ephemeral environments?
Preview environments are one type of ephemeral environment. Ephemeral is the broader term for any environment created on demand and deleted after use, including ones for CI test runs, demos and load tests.
Does each preview environment need its own database?
For backend changes, usually yes, so schema migrations and test data in one pull request cannot break another. Frontend-only previews can often share a read-only backend.
How do you keep preview environments affordable?
Delete them when the pull request closes, shut them down after a period of inactivity, size them smaller than production and run them on spot or preemptible nodes where the workload allows it.