Tools: Borgmatic Vs Borgbackup

Tools: Borgmatic Vs Borgbackup

Quick Verdict

Overview

Feature Comparison

When You Need Borgmatic

Use BorgBackup directly if:

Use Borgmatic if:

Docker Setup Comparison

BorgBackup in Docker (manual)

Borgmatic in Docker (automated)

Database Backup Integration

The Verdict

Do I need to install BorgBackup separately if I use Borgmatic?

Can Borgmatic use existing BorgBackup repositories?

Does Borgmatic support remote repositories over SSH?

Can I run Borgmatic without cron?

How do I test restores with Borgmatic?

Can Borgmatic notify me if a backup fails?

Related Borgmatic isn't an alternative to BorgBackup — it's a wrapper around it. BorgBackup is the backup engine. Borgmatic is the automation layer that makes BorgBackup easier to configure, schedule, and monitor. Use BorgBackup directly for simple manual backups. Use Borgmatic for anything automated. The relationship: BorgBackup does the actual work — reading files, deduplicating, compressing, encrypting, and writing to the repository. Borgmatic wraps those BorgBackup commands behind a YAML config file and adds features BorgBackup doesn't have: scheduling, hooks, health checks, database dumps, and monitoring integrations. Example direct BorgBackup workflow: Equivalent Borgmatic config: Run with a single command: You need to write your own backup.sh script handling init, create, prune, and check. Borgmatic's Docker image includes cron built-in. Set the CRON environment variable and it handles scheduling automatically. One of Borgmatic's strongest features is built-in database dumping: Borgmatic dumps the databases before creating the backup archive, ensuring consistent database snapshots. With bare BorgBackup, you'd write separate dump scripts and coordinate them with backup timing yourself. Bottom line: If you're setting up automated BorgBackup, there's no reason not to use Borgmatic. It makes BorgBackup better without adding complexity. Think of it like Docker Compose for Docker — you can use Docker directly, but Compose makes everything more manageable. If you use the Borgmatic Docker image (ghcr.io/borgmatic-collective/borgmatic), no — it bundles both BorgBackup and Borgmatic. If you install Borgmatic via pip on a host system, you need BorgBackup installed separately (apt install borgbackup or pip install borgbackup). Borgmatic does not include BorgBackup — it wraps it. Yes. If you have an existing Borg repository created with borg init, point Borgmatic at it by setting the repository path in config.yaml. Borgmatic uses the same repository format — no migration needed. Your existing archives, retention history, and encryption keys all carry over. Yes — it uses BorgBackup's SSH support. Set the repository path as ssh://user@hostname/path/to/repo in your Borgmatic config. The remote server needs BorgBackup installed. SSH key authentication is recommended (mount your SSH key into the Docker container if using the Borgmatic image). Yes. You can run borgmatic manually at any time. The Docker image includes cron built-in (set via the CRON or BACKUP_CRON environment variable), but you can also trigger backups on demand: docker compose exec borgmatic borgmatic. For integration with external schedulers (systemd timers, Kubernetes CronJobs), disable the built-in cron and trigger externally. Use borgmatic extract --archive latest --destination /tmp/restore-test to restore a specific archive to a test directory. Or use borgmatic mount --archive latest --mount-point /mnt/borg to FUSE-mount an archive and browse it. Regular restore testing is essential — a backup that cannot be restored is not a backup. Yes. Borgmatic supports multiple notification methods: on_error hooks (run shell commands on failure), Healthchecks.io pings (failed ping = alert), Cronitor, PagerDuty, ntfy, and custom webhook URLs. The Healthchecks.io integration is the most popular — create a check, add the ping URL to your config, and get alerted if a backup misses its schedule. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

# Initialize borg init --encryption=repokey ssh://backup@nas/~/borg-repo # Backup borg create ssh://backup@nas/~/borg-repo::backup-$(date +%Y%m%d) /data # Prune old backups borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=6 ssh://backup@nas/~/borg-repo # Initialize borg init --encryption=repokey ssh://backup@nas/~/borg-repo # Backup borg create ssh://backup@nas/~/borg-repo::backup-$(date +%Y%m%d) /data # Prune old backups borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=6 ssh://backup@nas/~/borg-repo # Initialize borg init --encryption=repokey ssh://backup@nas/~/borg-repo # Backup borg create ssh://backup@nas/~/borg-repo::backup-$(date +%Y%m%d) /data # Prune old backups borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=6 ssh://backup@nas/~/borg-repo # config.yaml repositories: - path: ssh://backup@nas/~/borg-repo label: nas source_directories: - /data - /config exclude_patterns: - '*.tmp' - '.cache' retention: keep_daily: 7 keep_weekly: 4 keep_monthly: 6 consistency: checks: - repository - archives hooks: before_backup: - echo "Starting backup..." after_backup: - echo "Backup complete." healthchecks: ping_url: https://hc-ping.com/your-uuid # config.yaml repositories: - path: ssh://backup@nas/~/borg-repo label: nas source_directories: - /data - /config exclude_patterns: - '*.tmp' - '.cache' retention: keep_daily: 7 keep_weekly: 4 keep_monthly: 6 consistency: checks: - repository - archives hooks: before_backup: - echo "Starting backup..." after_backup: - echo "Backup complete." healthchecks: ping_url: https://hc-ping.com/your-uuid # config.yaml repositories: - path: ssh://backup@nas/~/borg-repo label: nas source_directories: - /data - /config exclude_patterns: - '*.tmp' - '.cache' retention: keep_daily: 7 keep_weekly: 4 keep_monthly: 6 consistency: checks: - repository - archives hooks: before_backup: - echo "Starting backup..." after_backup: - echo "Backup complete." healthchecks: ping_url: https://hc-ping.com/your-uuid services: borgbackup: image: monachus/borgbackup:1.4.0 container_name: borgbackup -weight: 500;">restart: unless-stopped volumes: - /data:/source:ro - /backup:/repository - ./borg-scripts:/scripts:ro entrypoint: /scripts/backup.sh services: borgbackup: image: monachus/borgbackup:1.4.0 container_name: borgbackup -weight: 500;">restart: unless-stopped volumes: - /data:/source:ro - /backup:/repository - ./borg-scripts:/scripts:ro entrypoint: /scripts/backup.sh services: borgbackup: image: monachus/borgbackup:1.4.0 container_name: borgbackup -weight: 500;">restart: unless-stopped volumes: - /data:/source:ro - /backup:/repository - ./borg-scripts:/scripts:ro entrypoint: /scripts/backup.sh services: borgmatic: image: ghcr.io/borgmatic-collective/borgmatic:2.1.3 container_name: borgmatic -weight: 500;">restart: unless-stopped volumes: - /data:/source:ro - /backup:/repository - ./config.yaml:/etc/borgmatic/config.yaml:ro - borgmatic-state:/root/.borgmatic - borgmatic-cache:/root/.cache/borg environment: BORG_PASSPHRASE: "your-encryption-passphrase" # CHANGE THIS TZ: UTC CRON: "0 3 * * *" # Run daily at 3 AM volumes: borgmatic-state: borgmatic-cache: services: borgmatic: image: ghcr.io/borgmatic-collective/borgmatic:2.1.3 container_name: borgmatic -weight: 500;">restart: unless-stopped volumes: - /data:/source:ro - /backup:/repository - ./config.yaml:/etc/borgmatic/config.yaml:ro - borgmatic-state:/root/.borgmatic - borgmatic-cache:/root/.cache/borg environment: BORG_PASSPHRASE: "your-encryption-passphrase" # CHANGE THIS TZ: UTC CRON: "0 3 * * *" # Run daily at 3 AM volumes: borgmatic-state: borgmatic-cache: services: borgmatic: image: ghcr.io/borgmatic-collective/borgmatic:2.1.3 container_name: borgmatic -weight: 500;">restart: unless-stopped volumes: - /data:/source:ro - /backup:/repository - ./config.yaml:/etc/borgmatic/config.yaml:ro - borgmatic-state:/root/.borgmatic - borgmatic-cache:/root/.cache/borg environment: BORG_PASSPHRASE: "your-encryption-passphrase" # CHANGE THIS TZ: UTC CRON: "0 3 * * *" # Run daily at 3 AM volumes: borgmatic-state: borgmatic-cache: # config.yaml postgresql_databases: - name: nextcloud hostname: postgres port: 5432 username: nextcloud password: changeme mysql_databases: - name: wordpress hostname: mariadb username: root password: changeme # config.yaml postgresql_databases: - name: nextcloud hostname: postgres port: 5432 username: nextcloud password: changeme mysql_databases: - name: wordpress hostname: mariadb username: root password: changeme # config.yaml postgresql_databases: - name: nextcloud hostname: postgres port: 5432 username: nextcloud password: changeme mysql_databases: - name: wordpress hostname: mariadb username: root password: changeme - You run manual, one-off backups - You have a simple single-directory backup to one repository - You're comfortable writing shell scripts for automation - You want minimal dependencies - You want automated, scheduled backups - You back up multiple directories or to multiple repositories - You need pre/post backup hooks (database dumps, -weight: 500;">service stops) - You want health monitoring integration - You run in Docker and want a clean cron setup - How to Self-Host BorgBackup - How to Self-Host Borgmatic - Restic vs BorgBackup - Restic vs Kopia vs BorgBackup - Kopia vs Restic - Best Self-Hosted Backup Solutions - Self-Hosted Alternatives to CrashPlan - Backup Strategy