BorgBackup vs Borgmatic: Do You Need the Wrapper?
They’re Not Competitors — One Wraps the Other
This isn’t a typical “A vs B, pick one” comparison. Borgmatic is BorgBackup — it’s a YAML-driven automation layer that calls borg commands under the hood. The real question: should you use BorgBackup directly, or let Borgmatic manage it for you?
Short answer: Borgmatic for 90% of self-hosters. Raw BorgBackup only if you need surgical control over every borg flag or you’re embedding backup commands in existing automation (Ansible, custom scripts).
How They Relate
| Aspect | BorgBackup | Borgmatic |
|---|---|---|
| What it is | Deduplicating backup engine | YAML wrapper for BorgBackup |
| Written in | Python/Cython | Python |
| Interface | CLI only | YAML config + CLI |
| Docker support | Not designed for Docker | Official Docker image available |
| Scheduling | Manual or external cron | Built-in cron via Docker |
| Configuration | Shell scripts or raw commands | Single YAML file |
| Pre/post hooks | Manual scripting | Built into config |
| Database dumps | Manual pg_dump/mysqldump | Native PostgreSQL/MySQL/MariaDB hooks |
| Monitoring integration | None built-in | Healthchecks.io, Cronitor, PagerDuty |
| Retention management | Manual borg prune commands | Declarative in YAML |
| Learning curve | Steep (many flags) | Moderate (YAML config) |
| Latest version | 1.4.3 | 1.9.14 |
When Raw BorgBackup Makes Sense
Use BorgBackup directly when:
- You have existing automation. If you already have Ansible playbooks, shell scripts, or a CI/CD pipeline handling backups, adding Borgmatic is another layer to maintain.
- You need non-standard borg flags. Borgmatic exposes most flags, but niche options (custom chunk sizes,
--nobsdflags, remote borg path overrides) sometimes require raw commands. - You’re backing up from non-Docker systems. BorgBackup installs via
pip install borgbackupor system packages. No container needed. - You want to understand what’s happening. Learning raw BorgBackup first makes you better at debugging Borgmatic when something breaks.
# Raw BorgBackup workflow
borg init --encryption=repokey /mnt/backup/repo
borg create --stats --progress /mnt/backup/repo::'{hostname}-{now}' /home /etc
borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=6 /mnt/backup/repo
borg compact /mnt/backup/repo
Four commands, four concepts, total control.
When Borgmatic Is the Better Choice
Use Borgmatic when:
- You want set-and-forget backups. Define sources, destinations, retention, and schedule in one YAML file. Borgmatic handles
init,create,prune,compact, andcheckin sequence. - You need database dumps. Borgmatic dumps PostgreSQL, MySQL, MariaDB, MongoDB, and SQLite databases before running borg, then cleans up after.
- You run Docker. Borgmatic’s official container (
ghcr.io/borgmatic-collective/borgmatic:1.9.14) includes cron scheduling, so you don’t need a separate cron container or host cron job. - You want monitoring. Built-in hooks for Healthchecks.io, Cronitor, and PagerDuty — no extra scripting.
# borgmatic config.yaml — replaces the 4-command workflow above
repositories:
- path: /mnt/backup/repo
label: main
source_directories:
- /home
- /etc
encryption_passphrase: "${BORG_PASSPHRASE}"
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
hooks:
healthchecks:
ping_url: https://hc-ping.io/your-uuid
postgresql_databases:
- name: all
hostname: postgres
username: backup_user
One file, same result, plus database dumps and health monitoring.
Performance
Both are identical — Borgmatic calls BorgBackup’s engine. No performance overhead from the wrapper. Deduplication ratio, compression speed, encryption performance — all determined by BorgBackup’s C/Cython implementation.
| Metric | BorgBackup | Borgmatic |
|---|---|---|
| Backup speed | ~150-300 MB/s (depends on I/O) | Identical |
| Deduplication | Variable-length chunking | Identical (uses borg) |
| Encryption | AES-256-CTR + HMAC-SHA256 | Identical (uses borg) |
| Compression | LZ4, ZSTD, ZLIB, LZMA | Identical (uses borg) |
| Memory usage | ~200-500 MB during backup | ~210-520 MB (minimal Python overhead) |
Complexity Comparison
BorgBackup requires you to:
- Write a shell script with
borg create,borg prune,borg compact - Set up cron or systemd timer
- Handle errors and notifications yourself
- Manually script database dumps before backup runs
- Remember to run
borg checkperiodically
Borgmatic requires you to:
- Write a YAML config file
- Run
borgmatic(or use the Docker image with built-in cron)
That’s the entire value proposition. If managing shell scripts is your thing, BorgBackup is fine. If you’d rather declare intent in YAML and let automation handle the rest, Borgmatic saves real time.
Migration
Already using raw BorgBackup? Borgmatic reads existing borg repositories without modification. Point Borgmatic at your existing repo, configure the same sources and retention, and it takes over. No re-initialization needed.
Already using Borgmatic? You can always drop down to raw borg commands for one-off operations (manual restore, repo inspection) without affecting Borgmatic’s config.
FAQ
Does Borgmatic add any overhead?
No measurable overhead. It’s a thin Python layer that constructs and executes borg commands. The actual backup engine is identical.
Can I use both?
Yes. Use Borgmatic for scheduled backups, raw borg for manual restores or inspections. They operate on the same repositories.
Does Borgmatic support Borg 2.0?
Borgmatic 1.9.x supports Borg 1.4.x. Borg 2.0 compatibility is in progress — check the Borgmatic docs for the latest status.
Which should a beginner use?
Borgmatic. It reduces the surface area for mistakes and handles the common “forgot to prune” and “forgot to compact” problems automatically.
Final Verdict
Use Borgmatic unless you have a specific reason not to. It’s not a different backup tool — it’s BorgBackup with guardrails. The YAML config replaces fragile shell scripts, the Docker image replaces cron setup, and the monitoring hooks replace DIY notification scripts.
The only people who should use raw BorgBackup are those who already have backup automation in place and don’t want another tool in the chain. Everyone else saves time and reduces mistakes with Borgmatic.
Related
Get self-hosting tips in your inbox
New guides, comparisons, and setup tutorials — delivered weekly. No spam.