Dokploy’s rollback feature allows you to instantly revert your application to any previous deployment version, minimizing downtime when issues occur in 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.
How Rollbacks Work
Dokploy creates a versioned snapshot of each successful deployment, including:- Docker image with tag
v{version} - Full application configuration
- Environment variables
- Build settings
- Resource limits
- Mounted volumes
- Port configurations
Rollbacks restore the application state but do not revert database changes or external service modifications.
Enabling Rollbacks
Optional: Configure Registry
For persistent rollback storage, configure a rollback registry:
- Docker Hub: Store rollback images in Docker Hub
- GitHub Container Registry: Use GHCR for image storage
- Custom Registry: Any Docker-compatible registry
Without a registry, rollback images are stored locally on the server.
Rollback Process
When rollbacks are enabled, each deployment:Performing a Rollback
Via UI
Via API
What Gets Rolled Back
- Included
- Not Included
✅ Rolled back to previous state:
- Application code (Docker image)
- Environment variables
- Build arguments and secrets
- CPU and memory limits
- Custom commands
- Port mappings
- Volume mount configurations
- Network settings
- Health check settings
- Replica count
Rollback Registry
Configure a registry to store rollback images for long-term retention:- Docker Hub
- GitHub Container Registry
- Custom Registry
- Local Only
Managing Rollback Points
Viewing Rollback History
Each deployment shows:Deleting Rollback Points
Remove old rollback versions to free up storage:Zero-Downtime Rollbacks
Dokploy performs rolling updates during rollbacks:Rolling updates ensure your application stays available during rollbacks.
Rollback Scenarios
Critical Bug Deployed
Critical Bug Deployed
Situation: New deployment introduced a critical bug.Action:
- Identify last known good version
- Click rollback to that version
- Application reverts in ~30 seconds
- Fix bug in development
- Deploy fixed version
Performance Degradation
Performance Degradation
Situation: New deployment causes performance issues.Action:
- Monitor metrics and confirm regression
- Rollback to previous version
- Investigate performance issues locally
- Optimize and redeploy
Failed Migration
Failed Migration
Situation: Database migration fails mid-deployment.Action:
- Rollback application code
- Manually rollback database migration:
- Fix migration script
- Test migration locally
- Deploy with corrected migration
Configuration Error
Configuration Error
Situation: Wrong environment variable deployed.Action:
- Rollback to restore previous environment variables
- Update environment variables in Dokploy
- Redeploy or update service:
Best Practices
Use Rollback Registry
Configure external registry for persistence:
Keep Recent Versions
Maintain 3-5 recent rollback points:
Test Rollbacks
Periodically test rollback process:
Monitor After Rollback
Watch metrics post-rollback:
Database Rollback Strategy
Since Dokploy doesn’t automatically rollback databases, implement a migration strategy:- Reversible Migrations
- Backup Before Deploy
- Blue-Green Databases
Write migrations that can be rolled back:Rollback command:
Troubleshooting
Rollback Image Not Found
Rollback Fails to Start
Registry Push Failures
Rollback vs. Redeploy
- Rollback
- Redeploy
Use when: Recent deployment failedProcess:
- Instant (uses existing image)
- No build required
- Restores exact previous state
- ~30 seconds downtime
Next Steps
Preview Deployments
Test changes before production
Environment Variables
Manage application configuration