Self-Hosted Scheduled Backups to AWS Cold Storage
ColdVault is a Docker-based application that provides automated, encrypted, scheduled backups from a single host to AWS cold storage (S3 Glacier classes). It supports multiple datasets with independent schedules, manual backup triggers, host-level backups (via restic), and a dashboard for monitoring.
- ✅ Multiple backup jobs with independent schedules
- ✅ Dataset-level backups (media, Immich, app data)
- ✅ Host-level backups using restic
- ✅ AWS Glacier support (Instant Retrieval, Flexible Retrieval, Deep Archive)
- ✅ Client-side encryption
- ✅ Web dashboard for monitoring and control
- ✅ Manual backup triggers
- ✅ Retention policies
- ✅ Email and webhook notifications
- ✅ Cost estimation
- Docker and Docker Compose
- AWS account with billing set up (payment method required)
- S3 bucket created in AWS Console
- AWS credentials (Access Key ID and Secret Access Key)
Note: AWS requires a valid payment method even for Glacier storage. See AWS_SETUP.md for detailed setup instructions.
- Clone this repository:
git clone <repository-url>
cd coldvault- Create a
.envfile:
# AWS Configuration
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-bucket-name
# Encryption (required for encrypted backups)
ENCRYPTION_KEY=your-encryption-key-here
# Database (optional, defaults to SQLite)
DB_PASSWORD=changeme
# Timezone
TZ=America/Chicago
# Optional: Email notifications
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
SMTP_FROM=your-email@gmail.com
# Optional: Webhook notifications
WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL- Start the application:
docker-compose up -d- Access the dashboard: Open http://localhost:8088 in your browser
- Click "New Job" in the dashboard
- Fill in the job details:
- Name: Unique name for the job
- Job Type: Dataset or Host (Restic)
- Source Paths: One path per line (e.g.,
/mnt/media,/mnt/immich) - Schedule: Hourly, Daily, Weekly, or Monthly
- S3 Bucket: Your AWS S3 bucket name
- S3 Prefix: Path prefix in the bucket (e.g.,
backups/media) - Storage Class: Glacier Instant Retrieval, Flexible Retrieval, or Deep Archive
Click "Run Now" on any job in the dashboard to trigger an immediate backup.
Use the API endpoint /api/restore/restore to initiate a restore operation. Glacier snapshots may require retrieval time.
GET /api/jobs/- List all jobsPOST /api/jobs/- Create a new jobGET /api/jobs/{id}- Get job detailsPUT /api/jobs/{id}- Update a jobDELETE /api/jobs/{id}- Delete a jobPOST /api/backups/{job_id}/run- Trigger manual backupGET /api/backups/runs- List backup runsGET /api/dashboard/overview- Dashboard statisticsGET /api/restore/jobs/{job_id}/snapshots- List snapshots
- Web UI + API: FastAPI-based REST API with HTML dashboard
- Scheduler: APScheduler for cron-like job scheduling
- Worker: Executes backup jobs using appropriate engine
- Backup Engines:
- Dataset engine: Creates tar.gz archives
- Restic engine: Uses restic for host backups
- AWS Integration: Boto3 for S3 uploads with Glacier support
- Database: PostgreSQL (or SQLite for MVP)
- Glacier Instant Retrieval: Fast retrieval, higher cost
- Glacier Flexible Retrieval: Standard retrieval (3-5 hours), lower cost
- Glacier Deep Archive: Longest retrieval (12 hours), lowest cost
- Client-side encryption enabled by default
- Encryption key should be stored securely (Docker secrets recommended)
- Least-privilege IAM policy recommended for AWS access
-
Setup development environment:
./dev.sh setup
-
Configure environment:
cp .env.example .env # Edit .env with your configuration -
Run development server:
./dev.sh run
The API will be available at:
- Dashboard: http://localhost:8088
- API Docs: http://localhost:8088/docs
- ReDoc: http://localhost:8088/redoc
./dev.sh setup- Set up virtual environment and install dependencies./dev.sh run- Run development server with auto-reload./dev.sh lint- Run code linters./dev.sh format- Format code with black and isort./dev.sh test- Run tests (when implemented)./dev.sh clean- Clean Python cache files./dev.sh shell- Start Python shell with app context
For detailed development setup instructions, see DEV_SETUP.md.
For troubleshooting common issues, see TROUBLESHOOTING.md.
MIT
For issues and questions, please open an issue on GitHub.