docker.recipes

Kopia

intermediate

Fast and secure backup tool.

Overview

Kopia is a modern, open-source backup tool developed by Google engineers that focuses on fast, secure, and efficient data protection through content-addressable storage and incremental snapshots. Unlike traditional backup solutions, Kopia uses advanced deduplication algorithms and parallel processing to minimize storage requirements while maximizing backup and restore speeds, making it particularly effective for large datasets and frequent backup operations. The tool supports end-to-end encryption, compression, and multiple storage backends including cloud providers and local storage. This Docker configuration deploys Kopia in server mode, providing a web-based management interface alongside the powerful CLI tools for backup operations. The containerized setup includes dedicated volumes for configuration, cache, and repository data, with the ability to mount any host directories for backup operations. The server mode enables centralized backup management and remote access to backup operations through the web UI. This stack is ideal for system administrators managing multiple backup sources, developers requiring reliable version control for project data, and organizations needing enterprise-grade backup solutions with modern encryption standards. The combination of Kopia's performance advantages over traditional tools like Borg or Restic, combined with Docker's portability, makes this particularly valuable for hybrid cloud environments and containerized infrastructure deployments.

Key Features

  • Content-addressable storage with advanced deduplication reducing storage requirements by up to 90%
  • Parallel processing architecture delivering significantly faster backup speeds than Borg or Restic
  • Multiple storage backend support including S3, Azure Blob, Google Cloud Storage, Backblaze B2, SFTP, WebDAV, and Rclone
  • End-to-end AES-256 encryption with per-snapshot key derivation and optional compression
  • Built-in retention policies with flexible scheduling for automatic snapshot cleanup
  • Web-based management interface for monitoring backup status and browsing snapshot contents
  • Cross-platform snapshot mounting for direct file system access to backup data
  • Incremental forever backup strategy with block-level change detection

Common Use Cases

  • 1Enterprise server backup with automated retention policies and cloud storage integration
  • 2Development team project backup with version control-like snapshot browsing capabilities
  • 3Media server content protection with efficient handling of large file repositories
  • 4Database backup automation with point-in-time recovery capabilities
  • 5Multi-site backup coordination through centralized web interface management
  • 6Ransomware protection with encrypted off-site snapshot storage
  • 7Home lab data protection with cost-effective cloud storage utilization

Prerequisites

  • Docker and Docker Compose installed with at least 2GB available RAM for large backup operations
  • Network access to port 51515 for web interface and API communication
  • Sufficient storage space in Docker volumes for repository data and cache (recommend 10% of source data size for cache)
  • Valid credentials and network access if using cloud storage backends (S3, Azure, GCS, B2)
  • Understanding of backup retention requirements and storage backend configuration
  • KOPIA_PASSWORD environment variable configured with strong password for web interface access

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 kopia:
3 image: kopia/kopia:latest
4 container_name: kopia
5 restart: unless-stopped
6 command: server start --address=0.0.0.0:51515 --server-username=admin --server-password=${KOPIA_PASSWORD}
7 environment:
8 KOPIA_PASSWORD: ${KOPIA_PASSWORD}
9 volumes:
10 - kopia_config:/app/config
11 - kopia_cache:/app/cache
12 - kopia_repository:/repository
13 - /path/to/data:/data:ro
14 ports:
15 - "51515:51515"
16
17volumes:
18 kopia_config:
19 kopia_cache:
20 kopia_repository:

.env Template

.env
1KOPIA_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://kopia.io/docs/
  2. 2Web UI at http://localhost:51515 (admin / KOPIA_PASSWORD)
  3. 3Backends: local, S3, Azure, GCS, B2, SFTP, WebDAV, Rclone
  4. 4Faster than Borg/Restic for large repos - parallel processing
  5. 5CLI: kopia snapshot create /data, kopia snapshot list
  6. 6Built-in retention policies and compression

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 kopia:
5 image: kopia/kopia:latest
6 container_name: kopia
7 restart: unless-stopped
8 command: server start --address=0.0.0.0:51515 --server-username=admin --server-password=${KOPIA_PASSWORD}
9 environment:
10 KOPIA_PASSWORD: ${KOPIA_PASSWORD}
11 volumes:
12 - kopia_config:/app/config
13 - kopia_cache:/app/cache
14 - kopia_repository:/repository
15 - /path/to/data:/data:ro
16 ports:
17 - "51515:51515"
18
19volumes:
20 kopia_config:
21 kopia_cache:
22 kopia_repository:
23EOF
24
25# 2. Create the .env file
26cat > .env << 'EOF'
27KOPIA_PASSWORD=changeme
28EOF
29
30# 3. Start the services
31docker compose up -d
32
33# 4. View logs
34docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/kopia/run | bash

Troubleshooting

  • Repository not found error on startup: Ensure the kopia_repository volume is properly mounted and initialize repository with 'kopia repository create filesystem --path=/repository'
  • Web interface shows 'server not connected': Verify KOPIA_PASSWORD environment variable matches between server startup and login attempts
  • Backup operations failing with permission denied: Check that source data volumes are mounted with appropriate read permissions and paths exist
  • High memory usage during large backups: Increase Docker container memory limits and adjust --parallel flag in backup commands
  • Cache volume filling up rapidly: Monitor kopia_cache volume size and configure cache size limits using --cache-directory-max-size parameter
  • Cloud backend authentication failures: Verify storage backend credentials are properly configured and accessible from container network

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space