Backups That Actually Work
Self-hosting means you’re responsible for your data. No “Contact Support to restore from backup.” You are the support.
The good news: backing up Docker-based tools is simple once you set up a system.
What to Back Up
| Component | Where It Lives | How to Back Up |
|---|---|---|
| Docker volumes | /var/lib/docker/volumes/ | Volume export or rsync |
| Databases (Postgres) | Inside a Docker container | pg_dump |
| Config files | Your docker-compose.yml and .env | Git or file copy |
⚠️ Heads Up:
docker-compose.ymlfiles are easy to recreate. Database data is not. Prioritize database backups above everything else.
Method 1: Database Dumps (Essential)
Most self-hosted tools use PostgreSQL. Here’s how to dump it:
# Dump a Postgres database running in a container
docker exec your-db-container \
pg_dump -U postgres your_database > backup_$(date +%Y%m%d).sqlTo restore:
cat backup_20260218.sql | docker exec -i your-db-container \
psql -U postgres your_databaseMethod 2: Volume Backup
For tools that store data in Docker volumes:
# Find your volumes
docker volume ls
# Backup a volume to a tar file
docker run --rm \
-v my_volume:/data \
-v $(pwd)/backups:/backup \
alpine tar czf /backup/my_volume_backup.tar.gz /dataMethod 3: Automated Script
Create a backup script that runs daily via cron:
#!/bin/bash
# /opt/backup.sh
BACKUP_DIR="/opt/backups"
DATE=$(date +%Y%m%d_%H%M)
mkdir -p $BACKUP_DIR
# Dump Postgres databases
docker exec supabase-db pg_dump -U postgres postgres > $BACKUP_DIR/supabase_$DATE.sql
docker exec plausible_db pg_dump -U postgres plausible_db > $BACKUP_DIR/plausible_$DATE.sql
# Clean backups older than 7 days
find $BACKUP_DIR -name "*.sql" -mtime +7 -delete
echo "Backup complete: $DATE"Add to cron:
# Run at 3 AM every day
crontab -e
# Add this line:
0 3 * * * /opt/backup.sh >> /var/log/backup.log 2>&1The 3-2-1 Rule
For serious setups, follow the 3-2-1 backup rule:
- 3 copies of your data
- 2 different storage types (local + remote)
- 1 offsite copy (rsync to another server, or upload to B2/S3)
# Sync backups to a remote server
rsync -avz /opt/backups/ user@backup-server:/backups/Next Steps
You now have the four foundational concepts: Docker, reverse proxies, SSL, and backups. Time to build:
→ Deploy Guides — 65+ tools ready to deploy → The Bootstrapper Stack — A complete SaaS toolkit