> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-docs-new-messaging-and-agent-tasks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ephemeral Environments

> Create on-demand temporary environments for development, testing, and E2E testing with automated CI/CD workflows

## Overview

Ephemeral environments are temporary, isolated environments that are automatically created for specific purposes (like feature development or testing) and destroyed when no longer needed. They provide developers with production-like environments without the cost and complexity of maintaining permanent infrastructure.

Ephemeral environments (also called Preview Environments) are automatically created when you open a pull request and deleted when it's merged or closed, giving you on-demand testing environments that mirror your production setup.

## How It Helps

<CardGroup cols={2}>
  <Card title="Isolated per Pull Request" icon="code-branch">
    Each PR gets its own full-stack environment, created automatically and destroyed on merge or close. No shared staging environment to coordinate around.
  </Card>

  <Card title="Cost Only While Active" icon="dollar-sign">
    Environments run only for the lifetime of the PR. No idle infrastructure to pay for once it's merged.
  </Card>

  <Card title="Mirrors Production" icon="flask">
    Same services, same configuration as production, so what you test in preview behaves the same way once deployed.
  </Card>

  <Card title="Shareable Live URL" icon="link">
    Reviewers and stakeholders get a working URL for the PR, no local setup required to see the change running.
  </Card>
</CardGroup>

## Prerequisites

<Warning>
  **Cluster Required**: Before setting up ephemeral environments, you need a Kubernetes cluster. Ephemeral environments will be created on this cluster.
</Warning>

**Don't have a cluster yet?**

<CardGroup cols={2}>
  <Card title="Managed Cluster (Recommended)" icon="cloud" href="/getting-started/quickstart/cloud">
    Let Qovery provision and manage your Kubernetes cluster on AWS, GCP, Azure, or Scaleway

    **Time:** \~30 minutes | **Maintenance:** Qovery handles it
  </Card>

  <Card title="Bring Your Own Cluster (BYOK)" icon="server" href="/configuration/integrations/kubernetes/byok">
    Connect your existing Kubernetes cluster or create your own

    **Time:** \~20 minutes | **Maintenance:** You handle it
  </Card>
</CardGroup>

## Two Approaches

Qovery offers **two approaches** to create and manage ephemeral environments, depending on your team's needs and technical requirements.

<CardGroup cols={2}>
  <Card title="Simple: Preview Environments" icon="bolt" href="/getting-started/guides/use-cases/preview-environments">
    **Fully Automated with Zero Configuration**

    Turn on auto-preview environment feature in Qovery and let it handle everything automatically.

    * No CI/CD setup required
    * Built-in Qovery feature
    * Instant setup (enable and go)
    * Automatic creation/destruction on PR events
    * Perfect for quick feedback
    * **Best for teams wanting simplicity**

    **Time to setup:** 10-15 minutes
  </Card>

  <Card title="Advanced: CI/CD Integration" icon="code" href="/getting-started/guides/use-cases/e2e-testing">
    **Custom Workflows with E2E Testing**

    Integrate ephemeral environments into your existing CI/CD pipeline for complete control.

    * Full workflow customization
    * E2E testing automation (K6, Playwright, Cypress)
    * Custom creation/deletion logic
    * Integration with GitHub Actions, GitLab CI, Jenkins, etc.
    * Advanced testing scenarios
    * **Best for teams requiring custom testing workflows**

    **Time to setup:** 1-2 hours
  </Card>
</CardGroup>

<div className="cta-banner">
  <div className="cta-banner-text">
    <h3>Stop configuring ephemeral environments manually</h3>
    <p className="cta-banner-subtitle">Qovery auto-creates a full-stack preview environment for every pull request and destroys it on merge. Enable it in 10-15 minutes, no CI/CD changes required.</p>
  </div>

  <a href="https://console.qovery.com" className="cta-banner-button">Start for free →</a>
</div>
