Installation¶
Docker¶
The recommended way to run docker-backup is using Docker Compose:
compose.yml
services:
docker-backup:
image: ghcr.io/shyim/docker-backup:latest
restart: unless-stopped
command:
- daemon
- --storage=local.type=local
- --storage=local.path=/backups
- --default-storage=local
- --dashboard=:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- backup-data:/backups
ports:
- "8080:8080"
volumes:
backup-data:
Required Volumes¶
| Volume | Purpose |
|---|---|
/var/run/docker.sock |
Docker socket for container discovery and exec |
/backups |
Local storage for backups (if using local storage) |
Environment Variables¶
Storage and notification configuration can be passed via environment variables:
services:
docker-backup:
image: ghcr.io/shyim/docker-backup:latest
environment:
# S3 storage
DOCKER_BACKUP_STORAGE_S3_TYPE: s3
DOCKER_BACKUP_STORAGE_S3_BUCKET: my-backups
DOCKER_BACKUP_STORAGE_S3_REGION: us-east-1
DOCKER_BACKUP_STORAGE_S3_ACCESS_KEY: ${AWS_ACCESS_KEY_ID}
DOCKER_BACKUP_STORAGE_S3_SECRET_KEY: ${AWS_SECRET_ACCESS_KEY}
DOCKER_BACKUP_DEFAULT_STORAGE: s3
# Telegram notifications
DOCKER_BACKUP_NOTIFY_TELEGRAM_TYPE: telegram
DOCKER_BACKUP_NOTIFY_TELEGRAM_TOKEN: ${TELEGRAM_BOT_TOKEN}
DOCKER_BACKUP_NOTIFY_TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID}
Build from Source¶
Requirements¶
- Go 1.22 or later
- Node.js 20+ (for Tailwind CSS build)
- templ CLI (
go install github.com/a-h/templ/cmd/templ@latest)