Website review
This review may include AI-generated content and is not individually verified. Domain, certificate and other facts come from the observed data on this page.
What is BorgBackup?
BorgBackup (Borg) is a free, BSD-licensed command-line backup program that stores your data in a deduplicated, compressed and authenticated-encrypted repository. Instead of keeping repeated copies of the same content, it splits files into content-defined chunks and stores each identical chunk only once — across files, machines and years of history. That means a daily "full" backup costs little more than the changes since the previous run, while older versions remain browsable.
Its main pieces, as described on BorgBackup:
- Deduplication — identical chunks collapse into a single stored copy, so repeated backups stay small.
- Authenticated encryption — AES encryption with cryptographic authentication; the server holding the repository only ever sees ciphertext, so it does not need to be trusted.
- Compression — choose lz4 for speed, zstd for balance, zlib or lzma for maximum squeeze, or none.
- Mountable archives — mount any archive as a normal filesystem with FUSE and browse old file versions like folders.
- Portability — runs on Linux, macOS, BSD and more, installed via distribution packages, single-file binaries or pip.
Who it suits
Borg fits people comfortable with a terminal who want efficient, encrypted, versioned backups to a local disk, a USB drive, or any machine reachable over SSH. It is a single command with no daemons, agents or proprietary lock-in — attractive for servers, workstations and self-hosters. If you need a graphical scheduler or cloud-storage integration out of the box, you would typically pair Borg with a wrapper or front-end rather than use it alone.
A practical next step
Decide first where the repository will live (local, USB, or a remote SSH host) and how much you trust that host — Borg's design assumes the storage side may be untrusted. Then try one small backup and one restore before trusting it with everything: a backup you have never restored is only a hope.
How does BorgBackup's deduplication actually save space across multiple backups?
BorgBackup saves space by splitting your files into content-defined chunks and storing each distinct chunk only once in the repository. Every later backup reuses those stored chunks and adds only the chunks it has never seen before. Because chunk boundaries follow the content rather than fixed byte offsets, small edits don't shift everything downstream into "new" chunks.
The page illustrates this with three nightly backups of the same machine: night 1 stores chunks A–H, night 2 sees the same chunks plus a new one (I) and stores only I, and night 3 adds only J. Across those three nights, 24 chunks are seen but duplicates collapse into a single stored copy, so the history stays complete while the repository stays small. The same principle applies across files and across machines, not just across nights.
What this means in practice:
- Daily full backups are cheap. You can take a full backup every night and pay roughly the cost of the changes since yesterday, rather than the cost of the whole dataset.
- History is retained, not traded away. Old versions remain restorable because the chunks they reference are still in the repository.
- Compression and encryption stack on top. Borg compresses chunks (lz4 for speed, zstd for balance, zlib or lzma for maximum squeeze, or none) and applies authenticated AES encryption, so the storage server only ever sees ciphertext.
A useful next step: run two backups of the same dataset in a row and compare repository growth. The second run should add little, which confirms deduplication is working on your actual data. If it doesn't, the usual causes are data that changes everywhere at once (for example, large database files rewritten in place) or per-run encryption settings that prevent chunk reuse. For those cases, consider dumping databases to a stable format first, or keeping such data in a separate repository.
Borg is free software under a BSD license and runs on Linux, macOS, BSD and more; the project site is BorgBackup.
How do I set up BorgBackup to back up to a remote server over SSH?
Set up BorgBackup for SSH backups in three parts: create a repository on the remote machine, initialize it once, then run borg create with the remote path. Borg does not need a daemon or agent on either side — it talks over SSH and the remote server only ever sees encrypted data. The repository path takes the form ssh://user@host/./path/to/repo, where the /./ separates the SSH destination from the filesystem path and is required for correct remote path handling.
One-time setup
- Ensure
borgis installed on both the local and remote machines — from your distribution's packages, a single-file binary, or pip. The remote needs theborgexecutable on itsPATHfor the SSH connection. - Create the repository:
borg init --encryption=repokey ssh://user@host/./backups/myreporepokeykeeps the key in the repository (protected by your passphrase), which is convenient for unattended jobs.keyfilekeeps it only on the local machine, so a stolen repository is useless without that file — more secure, but you must back the key up yourself. Borg uses authenticated encryption, so the remote host cannot read or silently alter your data. - Export your key and store it somewhere safe (offline, printed, or in a password manager). Losing it makes
repokey/keyfilerepositories unrecoverable.
Regular backups
borg create --stats --compression zstd \
ssh://user@host/./backups/myrepo::'{now:%Y-%m-%d}' \
/home/you /etc
Borg stores files as content-defined chunks and keeps identical chunks only once — across files, machines, and years of history — so a nightly "full" backup costs little more than the day's changes. zstd balances speed and size; lz4 is faster, zlib/lzma squeeze harder, and none skips compression entirely.
Housekeeping and recovery
borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 ssh://user@host/./backups/myrepoto thin old archives.borg checkperiodically to verify repository integrity.borg mount ssh://user@host/./backups/myrepo::archive /mnt/borgto browse an old version like a folder via FUSE.borg extractrestores files.
Practical trade-offs
| Choice | Benefit | Cost |
|---|---|---|
repokey |
No key file to lose; simpler automation | Key sits in the repo (passphrase-protected) |
keyfile |
Key never leaves your machine | You must back it up; unattended jobs need care |
zstd |
Good default balance | Slower than lz4 |
lzma |
Smallest repositories | Slowest, CPU-heavy |
Next step: test a restore immediately after your first backup — extract one file to a temp directory and confirm it opens. A backup you have never restored is only a hypothesis. For a concrete scenario: if your laptop dies tonight, you want to be able to run borg extract from a USB live system onto a fresh machine and get your home directory back, so verify that path now rather than during an emergency.
Official documentation and installation options are at BorgBackup.
Can I browse or restore individual files from a Borg archive without extracting the whole backup?
Yes. Borg supports both browsing and selective restore without unpacking a whole archive.
Browse first: borg mount exposes any archive as a FUSE filesystem, so you can open it like a normal folder and copy out just the files you want. borg list prints archive contents, and borg extract accepts path filters, so you can pull a single file or directory straight out of a repository.
Restore selectively: run borg extract with the specific paths you need. Deduplication means the repository stores each chunk once, so restoring one file does not require the rest of the backup to be written out first.
A practical scenario: a user deletes one project folder by mistake. They mount last night's archive, verify the correct version exists, then extract only that folder to a temporary location before moving it back. No full restore, no downtime for the rest of the machine.
Decision criteria:
- Use
borg mountwhen you are unsure which version you need, or want to compare files across several archives. - Use
borg extractwith a path filter when you already know exactly what to recover. - Prefer extracting to a staging directory rather than overwriting live files, then move things into place after checking.
For installation and command reference, see BorgBackup.
What compression options does BorgBackup offer, and how do I choose between them?
BorgBackup lets you pick a compression algorithm per repository, and the right choice depends on whether you care more about backup speed or repository size. The options named on the page are lz4, zstd, zlib, lzma, and none.
The trade-off at a glance
| Option | Typical priority | When it makes sense |
|---|---|---|
| lz4 | Speed | Fast-changing data, frequent runs, or slow/weak hardware where backup time matters |
| zstd | Balance | A sensible default for most people; good compression without heavy CPU cost |
| zlib | Smaller size | When you want more space savings and can accept slower runs |
| lzma | Smallest size | Archival or rarely changing data where CPU time is cheap and storage is tight |
| none | No CPU cost | Already-compressed data (media, some archives) where compression wastes effort |
How to choose in practice
Start with zstd if you have no strong reason to pick otherwise. Move to lz4 if backups are running too slowly or you run them very often. Move to zlib or lzma if repository size is the binding constraint and you can afford longer runs. Choose none for data that is already compressed, since it will not shrink much anyway.
One thing worth noting: because Borg deduplicates at the chunk level, compression savings and deduplication savings overlap. Daily full backups cost little more than the changes since yesterday, so experimenting with a slower algorithm affects run time more than it affects how much new data gets stored.
A useful next step
Pick one repository, run a backup with zstd, then re-run with lzma and compare both wall-clock time and repository growth. That gives you a concrete answer for your own data rather than a guess. For setup details and the full option list, see BorgBackup.
How does BorgBackup keep my backups secure if the storage server is untrusted?
BorgBackup is designed so the storage server only ever holds encrypted, authenticated data. You create the repository passphrase locally, and Borg encrypts and authenticates your data on your machine before anything is sent. The server — a VPS, a NAS, a friend's disk, or a cloud host — sees ciphertext, not your files, filenames inside archives, or usable content. Even someone with full access to the server cannot read or undetectably alter your backups.
What the server can and cannot see
| Server has access to | Server does not get |
|---|---|
| The encrypted repository files | Your passphrase or keys |
| Repository size and chunk counts | File contents |
| Timing of uploads | File and directory names inside archives |
| That a Borg repository exists | Which chunks belong to which file |
The page evidence describes AES encryption with cryptographic authentication, and states explicitly that the backup server never needs to be trusted because it only ever sees ciphertext. That authentication matters as much as the encryption: it lets Borg detect tampering or corruption, so a malicious or compromised server cannot silently swap chunks and have you restore corrupted data.
A concrete scenario
Suppose you back up a laptop to a cheap VPS over SSH. You run one command locally; Borg chunks and deduplicates your files, compresses them, encrypts and authenticates the result, then transfers it. If the VPS provider is breached, the attacker finds an opaque repository. If the provider tries to modify stored chunks, Borg's authentication catches it at restore time. To restore, you need the repository passphrase — so losing it means losing the data, and a weak passphrase is the main practical risk.
Practical trade-offs
- Encryption is always on; there is no plaintext mode, so you cannot browse the repository directly on the server.
- Deduplication happens on encrypted chunks, so identical content across machines is stored once — but the server can still observe approximate repository size and change patterns.
- Compression choices (lz4 for speed, zstd for balance, zlib or lzma for maximum squeeze) affect speed and size, not the security model.
- Mounting archives via FUSE lets you browse old versions locally like folders, which is how you inspect history without decrypting files onto the server.
Next step
Decide where your passphrase lives before your first backup: store it in a password manager and keep an offline copy somewhere separate from the server. Then test a restore from a different machine to confirm you can decrypt without the original host. If you want alternatives to compare, see restic and Duplicacy, which also target untrusted storage with different designs.
User reviews (0)