Volume Backup
In addition to database backups, you may also need to back up persistent data stored in Docker volumes, such as uploaded files, configuration files, and logs.
What Is Volume Backup
Section titled “What Is Volume Backup”Docker volumes are the mechanism for persistent container storage. Data in volumes is preserved when containers restart or are redeployed. Common volume data includes:
- User-uploaded files (images, documents, etc.)
- Application configuration files
- Cache data
- Log files
- CMS media files (e.g., WordPress uploads directory)
Creating Volume Backups
Section titled “Creating Volume Backups”Via the Dashboard
Section titled “Via the Dashboard”- Go to the application settings page
- Click the “Volumes” tab
- Click “Backup” next to the volume you want to back up
- Select the backup destination (local or cloud)
Automatic Scheduling
Section titled “Automatic Scheduling”You can set up automatic schedules for volume backups:
| Setting | Description |
|---|---|
| Schedule | Cron expression or preset frequency |
| Retention | Number of recent backups to keep |
| Storage | Local or S3-compatible storage |
| Compression | Whether to compress (recommended) |
# Schedule example: daily at 3:00 AM0 3 * * *Backup Format
Section titled “Backup Format”Volume backups package all files in the volume into a compressed archive:
# Backup file formatvolume-name_2024-01-15_030000.tar.gzThe backup process roughly follows:
- Pause writes (if consistency is needed)
- Package volume contents into a tar file
- Compress with gzip
- Upload to the specified storage location
- Clean up old backups according to retention policy
Restoring Volumes
Section titled “Restoring Volumes”Restore from Dashboard
Section titled “Restore from Dashboard”- Go to the backup list
- Select the backup version to restore
- Click “Restore”
- Confirm the operation
Partial Restore
Section titled “Partial Restore”If you only need to restore specific files:
- Download the backup archive
- Extract locally
- Find the needed files
- Upload to the volume via the dashboard terminal
Best Practices
Section titled “Best Practices”-
Prioritize by importance — Not all volumes need backup. Cache data usually doesn’t, but user-uploaded files must be backed up.
-
Use cloud storage — Store backups in S3 or similar services to ensure recovery even if the VPS fails entirely.
-
Test restores regularly — Periodically restore from backups to a test environment to verify backups actually work.
-
Monitor backup sizes — Volume backups can grow quickly over time. Watch storage costs accordingly.
-
Set reasonable retention policies — Based on data importance and change frequency, configure appropriate backup retention counts.