Skip to main content
Dokploy provides automated backup functionality for all supported database types. Backups can be scheduled, stored in various destinations, and restored when needed.

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:
  1. Navigate to your database service
  2. Go to the “Backups” tab
  3. Click “Create Backup”
  4. 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

Use Crontab Guru to help create and understand cron expressions.

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 using rclone with the following format:

Backup Process

PostgreSQL Backups

PostgreSQL backups are created using pg_dump:
The backup includes:
  • All database schemas
  • Tables and data
  • Indexes
  • Constraints
  • Views and functions

MySQL/MariaDB Backups

MySQL and MariaDB backups are created using mysqldump or mariadb-dump:
The backup includes:
  • All database tables
  • Data and schema
  • Triggers and procedures
  • Views

MongoDB Backups

MongoDB backups are created using mongodump:
The backup includes:
  • 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

  1. Navigate to your database
  2. Go to the “Backups” tab
  3. Click “Run Backup Now”

Via API

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
Make sure to set an appropriate retention period. Very short retention (1-2 backups) increases risk of data loss.

Restoring Backups

To restore a backup:
  1. Navigate to your database
  2. Go to the “Backups” tab
  3. Find the backup file you want to restore
  4. Click “Restore”
  5. Confirm the restoration

Restore Process

The restore process varies by database type:
Restoring a backup will overwrite existing data. Make sure to backup current data before restoring.

Backup Monitoring

Check Backup Status

Monitor your backups through:
  1. Dokploy UI - View backup history and status
  2. Logs - Check logs for backup execution details
  3. 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:
Check disk space:
Check destination access:

Backup Too Large

Compress backups:
Split large backups:

Restore Failed

Check backup integrity:
Restore with verbose logging:

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:
  1. Enable WAL archiving
  2. Take regular base backups
  3. Archive WAL files
  4. 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

  1. Compression - Reduce storage by 70-90%
  2. Lifecycle Policies - Move old backups to cheaper storage
  3. Deduplication - Remove duplicate data
  4. 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