Robust cold backups for Docker environments using Kopia
Project description
Kopi-Docka
Robust Cold Backup for Docker Environments using Kopia
Kopi-Docka is a Python-based backup tool for Docker containers and their volumes. Features controlled downtime windows, encrypted snapshots, and automatic disaster recovery bundles.
What is Kopi-Docka?
Kopi-Docka = Kopia + Docker + Backup
A wrapper around Kopia, specifically designed for Docker environments:
- ๐ฆ Stack-Aware - Backs up entire Docker Compose stacks as logical units
- ๐ Encrypted - End-to-end encryption via Kopia (AES-256-GCM)
- ๐ Multi-Backend - Local, S3, B2, Azure, GCS, SFTP, Tailscale
- ๐พ Disaster Recovery - Encrypted emergency bundles with auto-reconnect
- ๐ง Pre/Post Hooks - Custom scripts for maintenance mode
- ๐ Systemd-Native - Production-ready daemon with sd_notify & watchdog
- ๐ Restore Anywhere - Recovery on completely new hardware
Quick Start
Installation
# Recommended: pipx (isolated environment)
pipx install kopi-docka
# Or: pip (system-wide)
pip install kopi-docka
Setup
# Interactive setup wizard
sudo kopi-docka setup
The wizard guides you through:
- โ Dependency check (Kopia, Docker)
- โ Backend selection (Local, S3, B2, Azure, GCS, SFTP, Tailscale)
- โ Repository initialization
- โ Connection test
First Backup
# System health check
sudo kopi-docka doctor
# List backup units (containers/stacks)
sudo kopi-docka admin snapshot list
# Test run (no changes)
sudo kopi-docka dry-run
# Full backup
sudo kopi-docka backup
# Create disaster recovery bundle (IMPORTANT!)
sudo kopi-docka disaster-recovery
# โ Copy bundle to safe location: USB/cloud/safe!
Automatic Backups
# Generate systemd units
sudo kopi-docka admin service write-units
# Enable daily backups (02:00 default)
sudo systemctl enable --now kopi-docka.timer
# Check status
sudo systemctl status kopi-docka.timer
Unique Features
1. Compose-Stack-Awareness
Automatically recognizes Docker Compose stacks and backs them up as atomic units with docker-compose.yml included.
kopi-docka admin snapshot list
Backup Units:
- wordpress (Stack, 3 containers, 2 volumes)
- nextcloud (Stack, 5 containers, 3 volumes)
- gitlab (Stack, 4 containers, 4 volumes)
2. Disaster Recovery Bundles
Encrypted packages containing everything needed to reconnect to your repository on a new server. Time to recovery: 15-30 minutes instead of hours.
3. Tailscale Integration
Automatic peer discovery for P2P backups over your private network. Use your own hardware instead of cloud storage.
Available Backup Targets
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Status โ Hostname โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโค
โ ๐ข Online โ cloud-vps โ
โ ๐ข Online โ home-nas โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
4. Systemd Integration
Production-ready daemon with sd_notify, watchdog monitoring, PID locking, and security hardening.
Read detailed feature documentation โ
What's New in v3.6.0
- ๐ฏ Smart Restore - Recovery script uses dynamic paths from bundle metadata
- ๐ก๏ธ Safe Restore - Interactive file restoration with automatic backups
- ๐พ Complete Recovery - Password files are now restored to their original locations
- ๐ Systemd Reminder - Clear instructions to re-enable automated backups
- ๐ Idempotent Recovery - Run recover.sh multiple times without conflicts
Previous (v3.5.0):
- Rclone Backend Improvements (PermissionError fix)
- Enhanced DR Bundles (rclone.conf included)
- Kopia Flag Fix (--rclone-args)
Previous (v3.4.0):
- Simplified CLI with "The Big 6" commands
- Doctor Command for system health checks
- Organized admin subcommands
Previous (v3.3.0):
- Backup Scope Selection (minimal/standard/full)
- Docker Network Backup
- Pre/Post Backup Hooks
- Conflict Detection
Documentation
๐ Complete Documentation:
- Features - Unique features, what's new, why Kopi-Docka?
- Installation - System requirements, installation options
- Configuration - Wizards, config files, storage backends
- Usage - CLI commands, workflows, how it works
- Hooks - Pre/post backup hooks, examples
- Troubleshooting - Common issues, FAQ
- Development - Project structure, contributing
๐ Examples:
- examples/config.json - Sample configuration
- examples/docker-compose.yml - Example stack
- examples/hooks/ - Hook script examples
- examples/systemd/ - Systemd setup guide
CLI Commands
Kopi-Docka v3.4+ features a simplified CLI with "The Big 6" top-level commands and an admin subcommand for advanced operations.
Top-Level Commands ("The Big 6")
sudo kopi-docka setup # Complete setup wizard
sudo kopi-docka backup # Full backup (standard scope)
sudo kopi-docka restore # Interactive restore wizard
sudo kopi-docka disaster-recovery # Create DR bundle
sudo kopi-docka dry-run # Simulate backup (preview)
sudo kopi-docka doctor # System health check
kopi-docka version # Show version
Admin Commands (Advanced)
# Configuration
sudo kopi-docka admin config show # Show config
sudo kopi-docka admin config new # Create new config
sudo kopi-docka admin config edit # Edit config
# Repository
sudo kopi-docka admin repo init # Initialize repository
sudo kopi-docka admin repo status # Repository info
sudo kopi-docka admin repo maintenance # Run maintenance
# Snapshots & Units
sudo kopi-docka admin snapshot list # List backup units
sudo kopi-docka admin snapshot list --snapshots # List all snapshots
sudo kopi-docka admin snapshot estimate-size # Estimate backup size
# System & Service
sudo kopi-docka admin system install-deps # Install dependencies
sudo kopi-docka admin service write-units # Generate systemd units
sudo kopi-docka admin service daemon # Run as daemon
Storage Backends
Kopi-Docka supports 7 different backends:
- Local Filesystem - Local disk or NAS mount
- AWS S3 - Amazon S3 or compatible (Wasabi, MinIO)
- Backblaze B2 - Affordable cloud storage (~$5/TB/month)
- Azure Blob - Microsoft Azure storage
- Google Cloud Storage - GCS
- SFTP - Remote server via SSH
- Tailscale - P2P over private network (no cloud costs!)
System Requirements
- OS: Linux (Debian, Ubuntu, Arch, Fedora, RHEL/CentOS)
- Python: 3.10 or newer
- Docker: Docker Engine 20.10+
- Kopia: 0.10+ (automatically checked)
Feature Comparison
| Feature | Kopi-Docka | docker-volume-backup | Duplicati | Restic |
|---|---|---|---|---|
| Docker-native | โ | โ | โ | โ |
| Compose-Stack-Aware | โ | โ | โ | โ |
| Network Backup | โ | โ | โ | โ |
| DR Bundles | โ | โ | โ | โ |
| Tailscale Integration | โ | โ | โ | โ |
| systemd-native | โ | โ | โ | โ |
| Pre/Post Hooks | โ | โ ๏ธ | โ | โ |
| Multi-Cloud | โ | โ | โ | โ |
Who Is It For?
- Homelab Operators - Multiple Docker hosts with offsite backups
- Self-Hosters - Docker services with professional backup strategy
- Small Businesses - Disaster recovery without enterprise costs
- Power Users - Full control over backup and restore processes
Credits & Acknowledgments
Author: Markus F. (TZERO78)
Links:
- PyPI: pypi.org/project/kopi-docka
- GitHub: github.com/TZERO78/kopi-docka
Powered by Kopia
Kopi-Docka wouldn't exist without Kopia!
Kopi-Docka is a wrapper that uses Kopia's powerful backup engine. Kopia provides:
- ๐ End-to-end encryption (AES-256-GCM)
- ๐๏ธ Deduplication & compression
- โ๏ธ Multi-cloud support
- ๐ฆ Incremental snapshots
- ๐ High performance
Links:
- Kopia: https://kopia.io
- Kopia GitHub: https://github.com/kopia/kopia
Other Dependencies
Note: Kopi-Docka is an independent project with no official affiliation to Docker Inc. or the Kopia project.
License
MIT License - see LICENSE for details.
Copyright (c) 2025 Markus F. (TZERO78)
Support & Community
- ๐ฆ PyPI: pypi.org/project/kopi-docka
- ๐ Documentation: Complete docs
- ๐ Bug Reports: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
Love Kopi-Docka? Give us a โญ on GitHub!
Current Version: v3.6.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kopi_docka-3.7.0.tar.gz.
File metadata
- Download URL: kopi_docka-3.7.0.tar.gz
- Upload date:
- Size: 135.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59ea1a1a76d41fa7d92c60d6bec1f88a2820a18f0c3da5d10d8c7538c011dc63
|
|
| MD5 |
8fb15f27a5777397fa34a012481a39ac
|
|
| BLAKE2b-256 |
5a809e9795f4931c1b3f0e45dc639cbfd8fcfcb112fb3e1213d2a196a13b2345
|
Provenance
The following attestation bundles were made for kopi_docka-3.7.0.tar.gz:
Publisher:
publish.yml on TZERO78/kopi-docka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kopi_docka-3.7.0.tar.gz -
Subject digest:
59ea1a1a76d41fa7d92c60d6bec1f88a2820a18f0c3da5d10d8c7538c011dc63 - Sigstore transparency entry: 763310244
- Sigstore integration time:
-
Permalink:
TZERO78/kopi-docka@45c426af97a1e68d7949dcba622210a757bd824c -
Branch / Tag:
refs/tags/v3.7.0 - Owner: https://github.com/TZERO78
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@45c426af97a1e68d7949dcba622210a757bd824c -
Trigger Event:
push
-
Statement type:
File details
Details for the file kopi_docka-3.7.0-py3-none-any.whl.
File metadata
- Download URL: kopi_docka-3.7.0-py3-none-any.whl
- Upload date:
- Size: 167.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
584dbb8453880e469c5e8df1d703e01408e7d22edc29c5d1c3d8f24cf263cc8d
|
|
| MD5 |
2522c571efff05346426528a569bfeab
|
|
| BLAKE2b-256 |
e58d032824f62956f7d2be8bf53d10325aec98860235a80d41a0583a42ce8b74
|
Provenance
The following attestation bundles were made for kopi_docka-3.7.0-py3-none-any.whl:
Publisher:
publish.yml on TZERO78/kopi-docka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kopi_docka-3.7.0-py3-none-any.whl -
Subject digest:
584dbb8453880e469c5e8df1d703e01408e7d22edc29c5d1c3d8f24cf263cc8d - Sigstore transparency entry: 763310246
- Sigstore integration time:
-
Permalink:
TZERO78/kopi-docka@45c426af97a1e68d7949dcba622210a757bd824c -
Branch / Tag:
refs/tags/v3.7.0 - Owner: https://github.com/TZERO78
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@45c426af97a1e68d7949dcba622210a757bd824c -
Trigger Event:
push
-
Statement type: