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.
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.
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.
How to use
- Install BorgBackup via your package manager
- Initialize an encrypted repository
- Create archives with
borg createand prune old ones withborg prune
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
Related on TokRepo
- Self-hosted tools — Browse self-hosted infrastructure and backup solutions
- DevOps tools — Explore operations and reliability tools
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
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.
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.
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.
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.
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)
- BorgBackup GitHub— Deduplicating archiver with encryption and compression
- BorgBackup Documentation— Block-level deduplication with AES-256 encryption
- BorgBackup Website— Variable-size content-defined chunking for deduplication
Related on TokRepo
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.