Preview deployments allow you to automatically create temporary environments for pull requests, enabling you to test changes before merging to production.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dokploy/dokploy/llms.txt
Use this file to discover all available pages before exploring further.
Overview
When enabled, Dokploy automatically:- Detects new pull requests
- Creates an isolated deployment
- Assigns a unique preview URL
- Updates the PR with the deployment status
- Cleans up when the PR is closed or merged
Preview deployments are only available for applications using GitHub, GitLab, Bitbucket, or Gitea as source providers.
Enabling Preview Deployments
Configure Settings
Set the following options:
- Preview Wildcard Domain: Base domain for preview URLs
- Preview Limit: Maximum number of concurrent previews (default: 3)
- Preview Port: Application port for the preview (default: 3000)
- Preview Path: Base path for the application (default: /)
- Preview HTTPS: Enable SSL for preview deployments
- Require Collaborator Permissions: Restrict previews to repository collaborators only
Preview URL Structure
Dokploy generates unique URLs for each preview deployment:Preview Configuration
Environment Variables
Define preview-specific environment variables:DOKPLOY_DEPLOY_URL is automatically injected and contains the full preview URL.Build Arguments
Override build arguments for preview builds:Build Secrets
Use separate credentials for preview deployments:Custom Labels
Add Docker labels to preview containers:Security Configuration
Require Collaborator Permissions
When enabled, preview deployments only trigger for users with write access to the repository:- Enabled (Recommended)
- Disabled
This prevents malicious code execution from untrusted contributors.
Watch Paths
Limit preview deployments to specific file changes:Preview Lifecycle
1. Pull Request Opened
Permission Check
If “Require Collaborator Permissions” is enabled, verify the PR author has write access.
2. Pull Request Updated
3. Pull Request Closed/Merged
Preview Limits
Control resource usage by setting a preview limit:When the limit is reached, oldest previews are not automatically removed. Close PRs to free up slots.
Managing Preview Deployments
Viewing Previews
Access all active previews in your application:- Navigate to “Preview Deployments” tab
- View list of active previews with:
- PR number and title
- Branch name
- Preview URL
- Deployment status
- Created date
Manual Redeployment
Redeploy a preview without pushing new commits:Manual Deletion
Remove a preview before the PR closes:SSL/TLS Configuration
Enable HTTPS
- Let's Encrypt
- Custom Certificate
- Disabled
Automatically provision SSL certificates:
Requires valid wildcard DNS record and reachable server.
Use Cases
Frontend Testing
Review UI changes before merging:
- Design updates
- New features
- Bug fixes
- Responsive layouts
Client Demos
Share working features with stakeholders:
- Preview new functionality
- Collect feedback
- Validate requirements
QA Testing
Test changes in isolation:
- Regression testing
- Cross-browser testing
- Integration testing
API Testing
Test backend changes:
- New endpoints
- Database migrations
- Third-party integrations
Best Practices
Set Reasonable Limits
Set Reasonable Limits
Configure preview limits based on available resources:
Use Watch Paths
Use Watch Paths
Avoid unnecessary deployments:
Enable Collaborator Restrictions
Enable Collaborator Restrictions
Always require collaborator permissions for security:
Use Preview-Specific Variables
Use Preview-Specific Variables
Isolate preview environments:
Set Expiration Policies
Set Expiration Policies
Regularly clean up old previews:
Troubleshooting
Preview Not Created
SSL Certificate Issues
Preview URL Not Accessible
Next Steps
Rollbacks
Learn how to rollback failed deployments
Environment Variables
Configure environment-specific variables