Supported Databases
Automated backups are available for:- PostgreSQL (using
pg_dump) - MySQL (using
mysqldump) - MariaDB (using
mariadb-dump) - MongoDB (using
mongodump) - Compose services (using tar archives)
Redis backups are supported if persistence is enabled (RDB or AOF).
Creating a Backup Configuration
To create a backup configuration:- Navigate to your database service
- Go to the “Backups” tab
- Click “Create Backup”
- Configure the backup settings
Basic Configuration
- Schedule - Cron expression for backup frequency
- Enabled - Whether the backup is active
- Destination - Where to store backups (S3, local, etc.)
- Backups to Keep - Number of recent backups to retain
Cron Schedule Examples
Backup Destinations
Dokploy supports multiple backup destinations:S3-Compatible Storage
Store backups in S3-compatible object storage (AWS S3, MinIO, DigitalOcean Spaces, etc.):- Bucket - S3 bucket name
- Region - S3 region
- Access Key - S3 access key ID
- Secret Key - S3 secret access key
- Endpoint - Custom endpoint for S3-compatible services
Configuration
Backups are uploaded usingrclone with the following format:
Backup Process
PostgreSQL Backups
PostgreSQL backups are created usingpg_dump:
- All database schemas
- Tables and data
- Indexes
- Constraints
- Views and functions
MySQL/MariaDB Backups
MySQL and MariaDB backups are created usingmysqldump or mariadb-dump:
- All database tables
- Data and schema
- Triggers and procedures
- Views
MongoDB Backups
MongoDB backups are created usingmongodump:
- All collections
- Documents (BSON format)
- Indexes
Compose Backups
Compose service backups create tar archives of:- Docker volumes
- Configuration files
- Application data
Manual Backups
You can trigger manual backups at any time:Via UI
- Navigate to your database
- Go to the “Backups” tab
- Click “Run Backup Now”
Via API
- PostgreSQL
- MySQL
- MariaDB
- MongoDB
- Compose
Retention Policy
Dokploy automatically manages backup retention:- Set the “Backups to Keep” value (e.g., 7 for one week)
- Old backups are automatically deleted after each successful backup
- Keeps only the most recent N backups
Restoring Backups
To restore a backup:- Navigate to your database
- Go to the “Backups” tab
- Find the backup file you want to restore
- Click “Restore”
- Confirm the restoration
Restore Process
The restore process varies by database type:- PostgreSQL
- MySQL/MariaDB
- MongoDB
Backup Monitoring
Check Backup Status
Monitor your backups through:- Dokploy UI - View backup history and status
- Logs - Check logs for backup execution details
- Storage - Verify files in your backup destination
Backup Notifications
Configure notifications for backup failures:- Email notifications
- Webhook notifications
- Slack/Discord integrations
Best Practices
1. Regular Testing
Regularly test backup restoration:2. Multiple Destinations
Store backups in multiple locations:- Primary: S3 bucket
- Secondary: Different region or provider
- Tertiary: Local storage for recent backups
3. Encryption
Encrypt sensitive backups:4. Backup Verification
Automate backup verification:- Check file size (should not be zero)
- Verify file format (valid SQL, BSON, etc.)
- Test restore periodically
5. Documentation
Document your backup strategy:- Backup schedule
- Retention policy
- Restore procedures
- Emergency contacts
Troubleshooting
Backup Failed
Check database access:Backup Too Large
Compress backups:Restore Failed
Check backup integrity:Advanced Configuration
Custom Backup Scripts
Create custom backup scripts for advanced scenarios:Incremental Backups
For large databases, consider incremental backups:Point-in-Time Recovery
Enable continuous archiving for PostgreSQL:- Enable WAL archiving
- Take regular base backups
- Archive WAL files
- Restore to specific point in time
Backup Costs
Storage Costs
- S3 Standard: ~$0.023/GB/month
- S3 Infrequent Access: ~$0.0125/GB/month
- S3 Glacier: ~$0.004/GB/month
Bandwidth Costs
- Upload: Usually free
- Download: ~$0.09/GB
Optimization
- Compression - Reduce storage by 70-90%
- Lifecycle Policies - Move old backups to cheaper storage
- Deduplication - Remove duplicate data
- Incremental Backups - Backup only changes
Next Steps
PostgreSQL
Learn more about PostgreSQL backups
MongoDB
Learn more about MongoDB backups
Destinations
Configure backup destinations
Monitoring
Monitor backup health