BorgBackup
Active and stableRuns locally ✓No paid APIA local backup tool that deduplicates, compresses, and encrypts data into versioned archives you can verify and restore.
brew install borgbackupIdeal use for this tool
Best for a developer or small team backing up server or project files to a disk or SSH host with encrypted history and retention. It adds deduplication, verification, and restore drills instead of an unverified folder sync. It is not a managed cloud service and should not copy a live database without a consistent dump or snapshot.
Details and illustrated features
Copying a directory to another disk is not a complete backup plan: repeated files consume space, a remote destination may expose data, an accidental deletion can propagate, and you may discover during an incident that restore was never tested. BorgBackup, or Borg, turns files into dated archives in a repository, splits content for deduplication, compresses it, and can encrypt it locally before sending it to a disk or an SSH server. The practical result is versioned, checkable, restorable backups instead of an opaque copied folder.
🧭 What is BorgBackup and how does it work?
BorgBackup is an open-source command-line backup tool. You create a repository that holds many archives, and every borg create run produces an archive representing the files at that time. Files are split into variable-length chunks; an existing chunk is referenced instead of stored again. Borg can add compression and authenticated encryption, and later list, extract, or mount archives with FUSE.
This card covers the stable 1.4 series and 1.4.5. The repository's master branch is unstable Borg 2. Its own README warns against production use of beta builds and documents that some beta-to-beta changes require recreating repositories. Do not copy Borg 2 commands into a 1.4 setup without the migration and compatibility documentation.

Original Borg 1.4 workflow diagram, not a product screenshot.
🎯 How does it help you?
Borg fits a developer or small team backing up project files, server configuration, or user directories to a local disk or SSH server while retaining control of history, restore, and encryption. Instead of copying everything again, it transfers new chunks, applies a retention policy, and lets you check the repository.
The added value is a visible lifecycle: create an archive, inspect the return code, apply retention, reclaim space, verify integrity, and test restore. It is not a managed cloud service or a full graphical product, and it does not create a transactionally consistent database backup by reading live database files.
🌟 Key features and capabilities
1. Deduplication across files and archives
Borg splits content into content-defined chunks. Later backups reference an existing chunk rather than storing or transferring it again. This helps when a small section of a large file changes or libraries repeat across machines and archives in the same repository.
- Where it happens: automatically during
borg create. - How to use it: create the first archive, then create dated archives for later states.
- Value: archives remain logically independent while sharing physical chunks.
- Important: deduplication is scoped to a repository; separate repositories create separate security and deduplication boundaries.

2. Authenticated encryption on the client
You select encryption when creating the repository. repokey stores the encrypted key in the repository, while keyfile keeps it on the client. In both documented encrypted modes, data is encrypted locally before it leaves for a remote server.
- Use it: choose the mode once with
borg init; changing it later is not a casual toggle. - Value: store backups on a destination you do not fully trust without revealing plaintext.
- Main risk: losing the key or passphrase can make the backup unrecoverable. Export the key and keep it away from both repository and source system.
- Automation: use
BORG_PASSCOMMANDwith a secret manager instead of hard-coding a passphrase where appropriate.

3. Local repository or remote SSH server
A repository can live on an attached disk or an SSH-accessible host. When Borg is installed remotely, borg serve handles low-level storage while the client performs chunking, compression, and encryption. The manual shows how to restrict an SSH key to Borg and one path.
- Example:
borg init -e repokey-blake2 user@host:/srv/backups/appuses Borg 1.4 syntax. - Permissions: the client reads source paths; the remote account writes only the backup repository.
- Reduce exposure: use
borg serve --restrict-to-path /srv/backups/appwith SSH'srestrictoption. - Watch out: sshfs and other mounted remote filesystems are possible, but the docs warn that not every remote filesystem is stable enough for a repository.

4. Retention with prune and compact
borg prune can keep, for example, seven daily, four weekly, and six monthly archives. In Borg 1.4 it marks archives for deletion, while borg compact reclaims repository space. Match only archives from the intended machine or data set.
- Use it: preview and test retention before placing it in cron or a systemd timer.
- Value: controlled history instead of unlimited growth or ad hoc deletion.
- Risk:
pruneanddeleteare logically destructive; a broad pattern can remove more archives than intended. - Append-only: it delays physical deletion inside Borg, but does not prevent
rmor filesystem-level deletion outside Borg.

5. Restore with extract or mount
List archives, extract selected paths into an empty directory, or mount an archive through FUSE for browsing. The manual recommends extract for large, fast restores and mount for browsing or copying a small amount.
- Where:
borg list, thenborg extractorborg mount. - Practical verification: restore into a separate directory and open representative files; a successful create command alone is not enough.
- Important: FUSE support depends on OS and installation. The basic Homebrew formula and official macOS binary do not provide it automatically.
- Permissions: restoring owners and ACLs can require the same user or root, depending on the data.

6. Repository and data verification
borg check validates repository and archive structure. --verify-data reads all data for cryptographic verification and can take a long time. Long checks can be split across scheduled runs with a maximum duration.
- Value: detect damage before an incident forces you to use the copy.
- Operation: run lighter checks regularly and schedule full verification around data size and maintenance windows.
- Important: repair mode is a separate, riskier operation than read-only checking; do not automate it blindly.
- Rule: integrity checking still does not replace restoring real files.

7. Automation with observable return codes and warnings
Borg can continue after an unreadable file, log a warning, skip the item, and return a warning code. “The job did not stop” is therefore not success. Capture output and return codes and alert on warnings or errors. A complete script should preserve the highest code from create, prune, and compact.
Live files can change while they are read. Use filesystem snapshots, a consistent database dump, or a controlled service stop when needed. Borg backs up files; it does not understand PostgreSQL or MySQL transactions automatically.

8. Separate stable Borg 1.4 from experimental Borg 2
The latest stable release verified here is 1.4.5, released on July 19, 2026. Borg 2 development is active, but the repository explicitly warns against using its beta releases for production backups and notes breaking beta changes.
Use the /en/stable/ documentation and Borg 1.4 commands for this card. The master README describes Borg 2 and commands such as repo-create, which differ from 1.4's init workflow.

🪜 Practical example: encrypted backup to a small server
Illustrative; not run on a live system: back up /srv/app/config and a database dump to a separate SSH server.
- Produce a consistent database dump in a restricted temporary directory.
- Install Borg 1.4.5 on client and server and confirm
borg --version. - Create a dedicated remote user and restrict its key to
borg serveand one repository path. - Initialise encryption with
borg init -e repokey-blake2 user@host:/srv/backups/app. - Export the Borg key to a separate location and document passphrase recovery.
- Create a dated archive and exclude caches only after reviewing the patterns.
- Monitor the return code and warnings without logging the passphrase or secret contents.
- Apply a machine-specific prune pattern, then compact, after testing the policy on non-critical data.
- Schedule checks and perform a monthly restore of one config file and one dump into a separate directory.
⚖️ Compared with manual copy or rsync alone
| Task | Manual copy / direct sync | With BorgBackup |
|---|---|---|
| Historical versions | Manually named folders | One archive per run |
| Repeated data | May be copied again | Shared chunks in one repository |
| Remote destination | Depends on transport and storage | Documented client-side encryption |
| Retention | Manual deletion | Prune rules followed by compact |
| Verification | Open a few files | check and verify-data plus restore testing |
| Restore | Search copied directories | list, then extract or mount |
| Source deletion | Can propagate through sync | Older archives remain until policy removes them |
This is a workflow comparison, not a measured storage or speed claim. Results depend on the data, duplication, compression, network, and encryption.
⚙️ Important configuration
BORG_REPOavoids repeating the repository URL, but document it clearly in scripts.BORG_PASSCOMMANDcan call a secret manager and is preferable to a fixed passphrase in a script. A keychain may not unlock in cron without the right session.--exclude-cachesand patterns remove unwanted data, but a bad exclude can omit required files from every backup.lz4is fast; stronger compression can use more CPU and memory. Test with your data.- Do not use
--bypass-lockin ordinary automation; locks protect the repository from concurrent runs.
🚀 Installation and first run
The verified stable release is 1.4.5. On macOS the official installation guide documents:
brew install borgbackup
Distribution packages cover Debian/Ubuntu, Fedora/RHEL, Arch, FreeBSD, and more, with single-file binaries for Linux, macOS, and FreeBSD. Windows through WSL is experimental in the 1.4 manual and FUSE does not work there. The release page also gives a pinned pip command:
pip install "borgbackup==1.4.5"
Start with a disposable repository, then test create and restore before scheduling a real job.
🔗 Integrations and compatibility
Borg CLI runs on Linux, macOS, and BSD and uses SSH for remote repositories. FUSE is optional and depends on package and OS support. External projects such as borgmatic, graphical interfaces, and hosted services exist, but they are not Borg core and should be evaluated separately.
💰 Cost, local operation, and privacy
The project is free software under BSD-3-Clause. Borg itself needs no paid API or cloud account; use your own disk or server. Storage, offsite server, hosted provider, or commercial support costs are separate.
Deduplication, compression, and encryption happen on the client in the documented remote workflow. The server observes repository files, size, and traffic timing but not plaintext content or the unencrypted key according to the docs. Core operation needs no central Borg service. We did not independently audit network behaviour or a specific storage provider.
⚠️ Limitations and when not to use it alone
- Borg 1.4 is not a managed cloud service and has no built-in monitoring dashboard.
- Windows/WSL is experimental in the 1.4 docs; FUSE has separate requirements.
- Full verification, restore, and compression can use substantial CPU, RAM, and time; documented Borg 1.4 core work is single-threaded.
- A live database needs a consistent dump or snapshot; copying open data files can produce an unusable state.
- One repository is not your only copy: keep multiple destinations and a separate key backup under an appropriate 3-2-1 plan.
prune,delete,compact, repair mode, and filesystem permissions can cause permanent loss.- Borg 2 beta is not for production backups according to the project warning at verification time.
🔐 Security and permissions

- Give the backup process only the source read access it needs; macOS may require Full Disk Access for protected paths.
- Avoid a general remote shell when the account only needs backups; use forced
borg servewith--restrict-to-path. - Keep passphrases in a secret manager, never Git, logs, or exposed command history.
- Export the key away from both source and repository; encryption you cannot unlock is not a recoverable backup.
- Append-only mode reduces some client-side deletion risk inside Borg but cannot stop filesystem-level deletion.
- Monitor warning return codes because unreadable files can be skipped while the job continues.
- Test restore with an account and permissions close to the incident workflow.
📚 Sources and verification date
Verified on November 20, 2026 using the official site, original repository, release 1.4.5, stable Borg 1.4.5 documentation, installation, quick start, initialisation and encryption, check, and borg serve. GitHub showed 13.9k stars and 884 forks at check time; these are changing popularity signals, not quality or security ratings. We did not install Borg or run backup and restore, and production commands were based on 1.4 documentation rather than the Borg 2 master README.