Overview
An environment is a group of applications, databases, and services running within the same Kubernetes namespace. Each environment provides isolation and organization for your services across different stages of your development lifecycle.Types of Environment
Qovery supports four environment modes, each designed for specific use cases:Production
Critical environment for live applications serving real users.Staging
Production-like environment for final testing before deployment. Often reflects production conditions and is critical for companies to validate changes before release.Development
Working environment for developing and testing features. Used by developers for day-to-day work, testing, and experimentation.Preview
Ephemeral environment automatically created for pull requests. Temporary environments that can be auto-deleted when no longer needed.Create an Environment
1
Access Project
Navigate to the project where you want to create the environment

2
Create Environment
Click the Create Environment button
3
Configure Environment
Specify the following parameters:
- Name: A descriptive name for your environment
- Mode: Select environment type (Production, Staging, Development, or Preview)
-
Cluster: Choose the Kubernetes cluster where the environment will run

Once an environment is provisioned, the cluster assignment cannot be changed.
4
Create
Click Create to finalize the environment setup
Adding Services
After creation, you can add services including:- Applications
- Cronjobs
- Lifecycle jobs
- Databases

Environment Settings
Access environment settings to configure various aspects of your environment:
General Tab
Configure basic environment properties:- Environment Name: Update the environment name
- Environment Mode: Change between Production, Staging, Development, or Preview
The cluster assignment is immutable after the environment is provisioned.
Deployment Rules
Set policies to reduce costs and control deployments. Learn more about deployment rules for cost optimization.Deployment Pipeline
Configure the deployment pipeline to be executed when a deployment on the environment is triggered. Control how services are deployed within the environment. Learn more about deployment pipelines.Preview Environments
Preview Environments are temporary, isolated environments automatically created from your blueprint environment when you open a pull request. They enable you to test changes in production-like conditions before merging.Tutorial: For a complete step-by-step tutorial on getting started with Preview Environments, including prerequisites and detailed setup instructions, see our Getting Started with Preview Environments Tutorial.
What are Preview Environments?
Preview Environments solve the challenge of maintaining testing environments that accurately mirror production without manual DevOps overhead. When you open a pull request, Qovery automatically creates a clone of your production setup, allowing you to:- Share live changes in code reviews beyond Git diffs
- Generate shareable links for stakeholder collaboration
- Run CI tests against high-fidelity production copies before merging

Key Concepts
Blueprint Environment
A Blueprint Environment serves as the template for all your Preview Environments. It’s a fully-configured, working environment that Qovery clones whenever a new pull request is created. Blueprint Best Practices:- Use a separate cluster from production for Preview Environments
- Ensure all applications and services are properly configured
- Test the Blueprint thoroughly before enabling Preview Environments
- Keep it in sync with your production configuration

Base Branch
The base branch (e.g.,main or staging) determines when Preview Environments are created. When you create a pull request targeting the base branch, Qovery automatically clones your Blueprint Environment.
Quick Setup
1
Create Blueprint Environment
Clone your existing working environment and name it “blueprint”
- Navigate to your working environment
- Click Clone Environment
- Name it “blueprint” or similar
- Deploy and verify it works correctly
2
Enable Preview Environments
Activate the Preview Environment feature for your applications
- Go to Environment Settings
- Select the Preview Environments tab
- Toggle Enable Preview Environments
-
Select which services to include

3
Configure Base Branch
Set the base branch for each application in your Blueprint
- Open each application in the Blueprint environment
- Go to application settings
- Change Git Branch to your base branch (e.g.,
mainorstaging) - This ensures feature branches create isolated Preview Environments
4
Create a Pull Request
Open a PR and Qovery will automatically create a Preview Environment
- Create a feature branch
- Make your changes
- Open a pull request to the base branch
- Qovery creates a Preview Environment automatically
- Access the preview URL from the PR comments
Preview Environment Workflows
Qovery supports two workflows for creating Preview Environments:Automatic (On Every PR)
Qovery automatically creates a Preview Environment for every pull request targeting your base branch. Best for: Teams that want maximum automation and always need to test changes Setup:- Enable auto-preview in environment settings
- Select services to deploy automatically
- Configure auto-delete rules
Manual (On Demand)
Developers manually trigger Preview Environment creation by commenting on pull requests. Best for: Teams that want to control costs or only need Preview Environments for specific PRs Setup:- Enable preview environments in environment settings
- Configure which services to include
- Developers comment
/qovery previewon PRs to trigger creation

Per-Service Configuration
You have fine-grained control over which services are deployed in Preview Environments:- Applications: Choose which applications to include
- Databases: Optionally include databases (clones or shared)
- Services: Select supporting services to deploy
Auto-Delete Functionality
Configure automatic cleanup of Preview Environments to control costs: Delete triggers:- When PR is merged
- When PR is closed without merging
- After specified period of inactivity
- Manual deletion via CLI or Console
Advanced Features
Database Seeding
Database Seeding
Populate Preview Environment databases with test data using Lifecycle Jobs.
- Run SQL scripts on environment startup
- Seed databases with production-like data
- Reset data between deployments
CI/CD Integration
CI/CD Integration
Integrate Preview Environments with your CI/CD pipeline for automated testing.
- Trigger tests automatically when Preview Environment is ready
- Run E2E tests against preview URLs
- Post results back to pull requests
Custom Domains
Custom Domains
Configure custom domains for Preview Environments.
- Use wildcard DNS (e.g.,
*.preview.yourdomain.com) - Automatic SSL certificates
- Shareable URLs for stakeholders
Resource Management
Resource Management
Control resources to optimize costs for Preview Environments.
- Use smaller instance sizes than production
- Set auto-stop rules for inactive environments
- Configure memory and CPU limits per service
Common Use Cases
Feature Development
Test new features in isolation before merging to main branch
Bug Fixes
Verify bug fixes work correctly in production-like environment
Stakeholder Review
Share live previews with product managers, designers, and clients
E2E Testing
Run automated tests against realistic environments before deployment
Best Practices
Blueprint Maintenance
Blueprint Maintenance
- Keep your Blueprint environment up-to-date with production configuration
- Test Blueprint deployments regularly to catch issues early
- Document any special configuration requirements
- Use environment variables for environment-specific values
Cost Optimization
Cost Optimization
- Enable auto-delete for merged/closed PRs
- Use smaller instance sizes for Preview Environments
- Set up deployment rules to stop inactive environments
- Only include necessary services in previews
- Use shared databases instead of cloning when appropriate
Security
Security
- Don’t use production secrets in Preview Environments
- Restrict access to preview URLs if needed
- Use separate clusters for production and previews
- Regularly audit and clean up orphaned environments
Performance
Performance
- Optimize Docker images to reduce deployment time
- Use caching strategies for dependencies
- Consider lazy-loading large databases
- Parallel deploy services when possible
Troubleshooting
Preview Environment Not Created
Preview Environment Not Created
Possible causes:
- Preview Environments not enabled in settings
- PR not targeting the configured base branch
- Blueprint environment has errors
- Insufficient cluster resources
- Verify Preview Environment settings are enabled
- Check that PR targets correct base branch
- Ensure Blueprint environment deploys successfully
- Review cluster capacity and quotas
Deployment Failures
Deployment Failures
Possible causes:
- Blueprint environment configuration errors
- Missing environment variables
- Resource constraints
- Container image build failures
- Test Blueprint environment deployment manually
- Review application logs for errors
- Verify all required environment variables are set
- Check container image build logs
Preview Environment Not Deleted
Preview Environment Not Deleted
Possible causes:
- Auto-delete not configured
- Webhook not triggered
- Manual intervention required
- Check auto-delete settings
- Manually delete via Console or CLI
- Review webhook configuration in Git provider
Clone Environment
Duplicate an existing environment to quickly create a copy across projects or clusters:
1
Select Environment
Go to the environment you want to clone
2
Clone
Click the Clone button in environment settings
3
Configure Clone
Specify:
- New environment name
- Target project (can be different)
- Target cluster (can be different)
-
Which services to include

4
Create Clone
Click Clone Environment to create the copy
Cloning excludes:
- Custom domains
- Certain built-in environment variables
Deployment & Deletion
Deploying an Environment
Deploy all services in an environment through the Qovery Console or CLI. See deployment management for details.Deleting an Environment
Before deleting:- Backup important data
- Stop all services
- Verify you’re deleting the correct environment
Related Topics
Project
Learn about project configuration
Applications
Configure applications within environments
Databases
Add databases to your environments
Ephemeral Environments
Learn about preview environments and CI/CD integration
Deployment Pipeline
Configure deployment order and strategies
Terraform Exporter
Export environment as Terraform code