💾 Setup Borgmatic — Automated, Encrypted Borg Backups
Deploy Borgmatic on Ubuntu with Docker — a configuration-driven wrapper around BorgBackup that runs encrypted, deduplicated, scheduled backups from a single YAML file. No web UI.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/backup/borgmatic/borgmatic-ubuntu.sh
chmod +x borgmatic-ubuntu.sh
sudo bash borgmatic-ubuntu.sh
Tutorial Steps
1 Download the Script
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/backup/borgmatic/borgmatic-ubuntu.sh
2 Make it Executable
chmod +x borgmatic-ubuntu.sh
3 Run the Installer
The script installs Docker if needed and starts Borgmatic with a generated BORG_PASSPHRASE and a nightly cron (02:00). Save the passphrase it prints — without it your encrypted backups can't be restored. Your source, repository, config, and cache are mounted as volumes.
sudo bash borgmatic-ubuntu.sh
4 Initialize the Repo and Verify
There's no web UI. Edit config/config.yaml for your sources and retention, initialize the Borg repository once, then list archives to confirm backups are being made:
docker exec -it borgmatic borgmatic list
Ports Used
| Port | Purpose |
|---|---|
| No ports | Headless, cron-driven — no web UI |
| BORG_PASSPHRASE | Generated encryption key — save it or backups are unrecoverable |
| config.yaml + cron | One YAML file defines the policy; nightly 02:00 backup |