Borgmatic vs Restic: Which Backup Tool to Use?

Quick Verdict

Both are excellent CLI backup tools. Restic is faster, supports more backends natively (S3, B2, Azure, GCS), and is easier to learn. Borgmatic (wrapping BorgBackup) has better compression, more mature deduplication, and Docker-native scheduling via cron. Choose Restic for cloud backups, Borgmatic for local/SSH backups.

Overview

Borgmatic is a configuration wrapper around BorgBackup that adds YAML-based config, scheduling, and hooks. BorgBackup is a deduplicating archiver focused on efficiency and security. Restic is a standalone backup tool with similar goals — deduplication, encryption, and speed — but supports more storage backends natively.

Feature Comparison

FeatureBorgmatic (BorgBackup)Restic
ConfigurationYAML config fileCLI flags / env vars
Docker supportOfficial image with cronCLI tool (script + cron)
Storage backendsLocal, SSH/SFTP onlyLocal, SFTP, S3, B2, Azure, GCS, REST
EncryptionAES-256 (repokey or keyfile)AES-256 (always on)
CompressionLZ4, zstd, zlib, lzmazstd (since v0.16)
DeduplicationContent-defined chunkingContent-defined chunking
Incremental backupsYesYes (snapshots)
Mount backupsYes (FUSE)Yes (FUSE)
Pre/post hooksYes (database dumps, notifications)Via scripts
Healthcheck integrationYes (healthchecks.io, Apprise)Via scripts
Database dump hooksBuilt-in (PostgreSQL, MySQL, MongoDB)Via scripts
Backup verificationborg checkrestic check
Pruning/retentionBuilt-in (keep-daily, keep-weekly, etc.)Built-in (—keep-daily, etc.)
SpeedFastFaster (especially restores)
RAM usageModerateModerate
Key managementCRITICAL — export with borg key exportPassword-only (simpler)

Installation Complexity

Borgmatic has an official Docker image (ghcr.io/borgmatic-collective/borgmatic:2.1.3) that includes BorgBackup, cron scheduling, and a YAML config file. Mount your config, your SSH keys (for remote repos), and your source data. The YAML config is well-documented and supports hooks for database dumps before backup.

Restic is typically installed as a system package (apt install restic) and scheduled via cron or systemd timers. The Docker image exists but is less commonly used since Restic is a one-shot CLI tool, not a daemon.

Borgmatic’s Docker approach is more self-contained. Restic’s system-level approach is simpler but requires more manual setup for scheduling and hooks.

Performance and Resource Usage

Restic is generally faster, especially for restores. Both use content-defined chunking for deduplication, but Restic’s implementation is slightly more efficient for large file changes.

BorgBackup has better compression options — it supports LZ4 (fast), zstd (balanced), zlib, and lzma (maximum compression). Restic added zstd compression in v0.16 but offers fewer options.

For backups over SSH (the primary use case for BorgBackup), performance is comparable. Restic’s advantage shows more with cloud storage backends.

Community and Support

Both are mature, well-maintained projects with active communities. BorgBackup has been around longer (fork of Attic, 2015). Restic started in 2014 and has gained significant momentum in the self-hosting community.

Use Cases

Choose Borgmatic If…

  • Your backup destination is another server over SSH
  • You want built-in database dump hooks (PostgreSQL, MySQL)
  • You want Docker-native backup scheduling with cron
  • You need the best possible compression ratios
  • You want YAML-based configuration (no scripts needed)
  • You use healthchecks.io or Apprise for monitoring

Choose Restic If…

  • You’re backing up to S3, Backblaze B2, or cloud storage
  • You want the fastest restore performance
  • You prefer CLI simplicity over config files
  • You’re already familiar with Restic’s interface
  • You need multiple storage backends for 3-2-1 backups
  • You want the simplest possible password-based encryption

Final Verdict

Restic wins for cloud storage backups. Native S3 and B2 support, faster performance, and simpler encryption (password-only, no key export needed) make it the better choice for cloud-based backup strategies.

Borgmatic wins for SSH-based backups. The Docker image with built-in cron, YAML config, database dump hooks, and notification integrations make it the most turnkey backup solution for server-to-server backups.

Both are excellent. The biggest factor is your backup destination: cloud storage → Restic, SSH server → Borgmatic.

FAQ

What is the difference between Borgmatic and BorgBackup?

BorgBackup is the backup engine — it handles deduplication, encryption, and storage. Borgmatic is a wrapper that adds YAML configuration, cron scheduling, pre/post hooks (database dumps, notifications), and healthcheck integration. You always need BorgBackup installed; Borgmatic is optional but recommended for automated setups. The Borgmatic Docker image bundles both together.

Can I use Restic with Borgmatic’s YAML config?

No. Borgmatic only works with BorgBackup. For a similar config-driven approach with Restic, use Resticprofile (YAML/TOML config) or Autorestic (YAML config). Both provide scheduling, hooks, and multi-backend support.

Which is safer if my backup server gets compromised?

BorgBackup supports append-only repositories, where the client can create new backups but cannot delete or modify existing ones. This protects against ransomware or a compromised client wiping backups. Restic does not have append-only mode. If your threat model includes a compromised backup client, BorgBackup with append-only repos is the safer choice.

Can both back up running Docker containers?

Both can back up container data by targeting volume directories, but you should stop database containers or run database dumps before backing up to avoid corruption. Borgmatic has built-in hooks for PostgreSQL, MySQL, and MongoDB dumps — add them to your YAML config. With Restic, write a shell script that dumps databases before calling restic backup.

How much storage do I save with deduplication?

Both achieve roughly 50-80% deduplication on typical server data across multiple snapshots. The exact savings depend on your data profile — large media files with few changes deduplicate well, while databases with frequent changes deduplicate less. Compression (available in both tools) adds another 20-40% reduction on text-heavy data.

Should I use both for 3-2-1 backups?

A practical approach is to use Borgmatic for local/SSH backups (fast, high-compression) and Restic for cloud storage backups (S3, B2). This gives you two different tools with two different storage locations — reducing the risk of a bug in one tool affecting all your backups. See our Backup Strategy guide for the full 3-2-1 approach.

Comments