ScriptsApr 14, 2026·3 min read

BorgBackup — Deduplicating Archiver for Efficient Encrypted Backups

Borg is the reliability-focused deduplicating backup program. It encrypts, deduplicates, and compresses backups on the fly — so 100 daily snapshots of your 100GB server use far less than 10TB of storage.

TL;DR
Reliability-focused deduplicating backup tool with encryption, compression, and efficient snapshot storage.
§01

What it is

BorgBackup (Borg) is a deduplicating backup program that encrypts and compresses backups on the fly. Its block-level deduplication means that 100 daily snapshots of a 100GB server use far less than 10TB of storage because only changed data blocks are stored. Borg supports local and remote repositories via SSH, making it suitable for both personal backups and server infrastructure.

System administrators, DevOps engineers, and self-hosters who need reliable, space-efficient backups benefit from Borg. It is particularly valuable for servers with large datasets that change incrementally.

§02

How it saves time or tokens

Borg's deduplication dramatically reduces backup storage costs and transfer times. Instead of copying entire file trees on each backup, Borg identifies duplicate data blocks across all archives and stores each block only once. A backup that would take hours with rsync completes in minutes with Borg after the initial full backup.

§03

How to use

  1. Install BorgBackup via your package manager
  2. Initialize an encrypted repository
  3. Create archives with borg create and prune old ones with borg prune
§04

Example

# Install
brew install borgbackup  # macOS
sudo apt install borgbackup  # Debian/Ubuntu

# Initialize encrypted repository
borg init --encryption=repokey /backup/myrepo

# Create a backup
borg create /backup/myrepo::daily-{now} /home /etc \
  --exclude '*.cache' --exclude '__pycache__'

# List archives
borg list /backup/myrepo

# Prune: keep 7 daily, 4 weekly, 6 monthly
borg prune /backup/myrepo \
  --keep-daily=7 --keep-weekly=4 --keep-monthly=6
§05

Related on TokRepo

§06

Common pitfalls

  • Losing the repository key and passphrase means permanent data loss; export and store the key securely offline
  • Remote repositories over SSH require borg installed on both client and server with compatible versions
  • Large initial backups over slow networks can take hours; consider seeding the repository locally first

Frequently Asked Questions

How does deduplication work in Borg?+

Borg splits files into variable-size content-defined chunks and hashes each chunk. If a chunk already exists in the repository from any previous archive, Borg references the existing copy instead of storing it again. This works across all files and all archives.

Is BorgBackup encryption secure?+

Yes. Borg uses AES-256 encryption with HMAC-SHA256 authentication. Data is encrypted before leaving your machine, so the backup server never sees unencrypted content. You choose between a repokey (key stored in repo) or keyfile (key stored locally) mode.

Can I back up to a remote server?+

Yes. Borg supports remote repositories over SSH. The remote server needs BorgBackup installed. Use the format user@host:/path/to/repo for remote repository paths.

How much storage does deduplication save?+

Savings depend on data change rate. For typical server backups with daily snapshots, deduplication ratios of 10:1 to 50:1 are common. A month of daily backups may only use 1.5-2x the size of the original data.

What is the difference between Borg and restic?+

Both are deduplicating backup tools with encryption. Borg is more mature and generally faster for local/SSH backups. Restic supports more storage backends (S3, Azure, GCS) natively. Choose Borg for SSH-based backups and restic for cloud storage.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets