Backup tool to create backups of docker volumes.
4.9K
A web-based backup management solution for Docker volumes, flat files, and remote rsync synchronization.
AI-Assisted Project: This project was developed with the assistance of AI tools. While all functionality has been checked, tested and verified, users should review the code and configuration before deploying in production environments.
Backup Manager is a Dockerized application that provides a user-friendly web interface to manage backup jobs. It supports:
Backup Manager works best by having a common name for your backup job, your docker stack location and the stack data volume mount. For example: if you set the "Job name" to nextcloud, it will automatically use /opt/stacks/nextcloud for the stack location, and /opt/nextcloud for the nextcloud volume. You can manually specify a different location per backup job if required.
┌─────────────────────────────────────────────────────────────────┐
│ Backup Manager Container │
│ │
│ ┌─────────────────────┐ ┌─────────────────────────────┐ │
│ │ Web UI (Flask) │ │ Scheduler (APScheduler)│ │
│ │ Port 5001 │◄────►│ Port 5002 │ │
│ │ (Gunicorn) │ API │ (Gunicorn) │ │
│ └─────────┬───────────┘ └─────────────┬───────────────┘ │
│ │ │ │
│ │ ┌──────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ SQLite Database │ │
│ │ - jobs (backup job configs) │ │
│ │ - logs (backup execution logs) │ │
│ │ - rsync_jobs (rsync job configs) │ │
│ │ - rsync_logs (rsync execution logs) │ │
│ │ - pushover_config (notification settings) │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Backup Execution Engine │ │
│ │ - tar (for local archives) │ │
│ │ - rsync (for remote sync) │ │
│ │ - docker compose (for container management) │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
│ Volumes
▼
┌─────────────────────────────────────────────────────────────────┐
│ Host System │
│ /var/run/docker.sock - Docker socket access │
│ /opt - Docker stacks/data directories │
│ /mnt/storage - Backup destination storage │
│ /config - Database & logs persistence │
└─────────────────────────────────────────────────────────────────┘
Web Application (app.py)
Scheduler (scheduler.py)
Process Manager (supervisord.conf)
Frontend
Clone or copy the project files to your server
Configure the compose.yml file:
services:
backup-manager:
image: spinkever/backup-manager:latest
container_name: backup-manager
restart: unless-stopped
ports:
- "5001:5001"
volumes:
# Mount the docker socket for compose stop/start. Optionally, include a docker socket proxy container.
- /var/run/docker.sock:/var/run/docker.sock
- /opt:/opt # Source directory
- /mnt/storage:/mnt/storage # Destination directory
- /opt/backup-manager/config:/config # Config directory
- /opt/backup-manager/ssh:/root/.ssh # Optional -- .ssh for remote rsync operations
environment:
- TZ=Europe/Amsterdam
- STACKS_DIR=/opt/stacks # Stacks directory, prefills the compose path in the web. Defaults to /opt/stacks if not set
- SOURCE_DATA_DIR=/opt # Source data directory, prefills the source path in the web UI
- BACKUP_DEST_DIR=/mnt/storage/backup # Backup destination directory, prefills the backup path in the web UI
- SCHEDULER_API_KEY=super-secret-api-key # Optional -- scheduler API key. Generated automatically if unset.
# Optional settings
# Auth: set a password to enable local login
# - LOGIN_PASSWORD=my-secret-password
# Set to false to hide the local password form when only OIDC is used
# - LOCAL_LOGIN_ENABLED=true
# OIDC: set these three to enable OIDC login
# - OIDC_CLIENT_ID=my-client-id
# - OIDC_CLIENT_SECRET=my-client-secret
# - OIDC_PROVIDER_URL=https://my-oidc-provider
# Optional: custom button text for OIDC (default "Sign in with OIDC")
# - OIDC_APP_NAME=MyApp
# Required for OIDC when behind a reverse proxy: set to the external URL
# - EXTERNAL_URL=https://backups.example.com
# Optional: set a persistent session secret (auto-generated if empty)
# - SESSION_SECRET=my-session-secret
Build and start the container:
docker-compose up -d
Access the web interface at http://your-server:5001
/ or ?)0 2 * * * for 2 AM daily)Jobs can be sorted by name or scheduled time using the sort buttons in the job list header.
/root/.ssh/id_rsa)Backup Manager supports two authentication methods: local password login and OIDC (OpenID Connect). You can use either one or both at the same time. Authentication is disabled if local password login and OIDC are not configured making the app accessible without login.
Set the LOGIN_PASSWORD environment variable to enable password-based login. When only this is set, the login page shows a simple password field.
Optionally, set LOCAL_LOGIN_ENABLED to false to hide the local login field if you have OIDC login enabled.
To enable OIDC, set these environment variables:
OIDC_CLIENT_ID — your OIDC client IDOIDC_CLIENT_SECRET — your OIDC client secretOIDC_PROVIDER_URL — the OIDC issuer URL (the issuer field from your provider's /.well-known/openid-configuration, e.g. https://auth.example.com or https://auth.example.com/oidc)Configure the redirect/callback URI in your OIDC provider as:
https://<your-domain>/oidc/callback
Replace https://<your-domain> with the actual external URL of your Backup Manager instance.
If the app is behind a reverse proxy, also set EXTERNAL_URL to the same base URL (e.g. https://backups.example.com). This ensures the callback URL is consistent and matches what's registered with your provider.
Optionally set OIDC_APP_NAME to customize the button text on the login page (defaults to OIDC).
LOGIN_PASSWORD set — a password field and a "Sign in" buttonIf neither is configured, authentication is disabled and the app is accessible without login.
| Variable | Description | Default |
|---|---|---|
TZ | Timezone for logs | UTC |
STACKS_DIR | Default Docker stacks directory | /opt/stacks |
SOURCE_DATA_DIR | Default source data directory (prefills source path in UI) | /opt |
BACKUP_DEST_DIR | Default backup destination directory (prefills backup path in UI) | /mnt/storage/backup |
SCHEDULER_API_KEY | API key for scheduler communication | (auto-generated) |
LOGIN_PASSWORD | Password for local login. If set, prompts for password | (none) |
LOCAL_LOGIN_ENABLED | Show/hide the local login form when OIDC is also configured | true |
OIDC_CLIENT_ID | OIDC client ID | (none) |
OIDC_CLIENT_SECRET | OIDC client secret | (none) |
OIDC_PROVIDER_URL | OIDC issuer URL — the issuer value from the provider's /.well-known/openid-configuration (e.g. https://auth.example.com or https://auth.example.com/oidc) | (none) |
OIDC_APP_NAME | Custom button text for OIDC sign-in | OIDC |
SESSION_SECRET | Persistent secret for Flask session cookies. Any string of any length; use a random one (e.g. 32+ chars of A-Za-z0-9!@#$%^&*()_+-=) | (auto-generated) |
EXTERNAL_URL | External URL of the app (e.g. https://backups.example.com). Required for OIDC when behind a reverse proxy — ensures the callback URL matches what's configured in your OIDC provider | (none) |
Standard cron format: minute hour day month weekday
Examples:
0 2 * * * - Daily at 2:00 AM0 0 * * 0 - Weekly on Sunday at midnight0 */6 * * * - Every 6 hours30 18 * * 1-5 - Weekdays at 6:30 PM/var/run/docker.sock is mounted, or proper permissions are passed through to a docker socket proxyView application logs:
docker logs backup-manager
View detailed job logs in the web UI under Logs for each job.
GET / - List all backup jobsGET /job/<id> - Get job details as JSONPOST /add_job - Create new backup jobPOST /edit_job/<id> - Update backup jobPOST /delete_job/<id> - Delete backup jobPOST /run_now/<id> - Trigger immediate backupGET /logs/<id> - Get job execution logsGET /latest_log/<id>?since=<log_id> - Poll for latest log after job triggerPOST /delete_backup/<id> - Delete backup file and its log entryPOST /delete_log/<id> - Delete a log entry without deleting the backupGET /rsync - List all rsync jobsGET /rsync_job/<id> - Get rsync job details as JSONPOST /add_rsync_job - Create new rsync jobPOST /edit_rsync_job/<id> - Update rsync jobPOST /delete_rsync_job/<id> - Delete rsync jobPOST /run_rsync_now/<id> - Trigger immediate syncGET /rsync_logs/<id> - Get rsync execution logsPOST /delete_rsync_log/<id> - Delete an rsync log entryGET /login - Login page (GET shows form, POST validates password)GET /logout - Log out and clear sessionGET /oidc/authorize - Redirect to OIDC provider for authorizationGET /oidc/callback - OIDC callback handler (receives auth code)GET /healthz - Health check endpointGET /version - Get application versionPOST /pushover_config - Update Pushover settingsSee requirements.txt:
This project is available through the MIT license. See the LICENSE file for the full license details.
For issues, questions, or contributions, please refer to the project repository.
Content type
Image
Digest
sha256:42c7aab69…
Size
140.7 MB
Last updated
19 days ago
docker pull spinkever/backup-manager