Skip to content
OpenSourceSoftware.ai

GitHub stars

36,882
—Awaiting first sync

Awaiting first sync

No measured star history yet

What is restic?

restic is a backup tool for people who are comfortable with the command line or with scripting their servers. It encrypts everything before it leaves the machine, so backups can sit on cloud storage or a shared server without others reading them. Each run only stores what changed, and restic can check that your backups are complete and restorable.

restic is a command-line backup program for Linux, macOS, Windows, FreeBSD and OpenBSD. It saves encrypted, deduplicated snapshots to a local folder, an SFTP server, a REST server, S3-compatible storage, Backblaze B2, Azure Blob Storage, Google Cloud Storage or other services through rclone. It is a single executable and needs no server.

Core capabilities

  • Encrypts every backup and treats the storage location as untrusted.
  • Uploads only changed data and removes duplicates before writing to storage.
  • Restores whole snapshots or single paths, or mounts backups as a folder.

Back up to the storage you already use

restic writes backups to a repository, which can sit in a local directory, on an SFTP server, behind a REST server or in cloud storage. Native backends include Amazon S3 and S3-compatible services, OpenStack Swift, Backblaze B2, Microsoft Azure Blob Storage and Google Cloud Storage. Many other services can be reached through rclone. The separate rest-server project has an append-only mode that allows new backups but blocks deleting or changing existing ones.

  • S3
  • SFTP
  • rclone
  • REST server

Encryption, deduplication and checks

restic assumes the place where backups are stored is not trusted, and uses cryptography to protect both the confidentiality and the integrity of your data. Every repository needs a password, and losing it means the data cannot be recovered. Duplicate data is removed before it is written, and repository format version 2 also compresses data. The check command verifies the repository, and --read-data reads stored data back to confirm it can be restored.

  • Encryption
  • Deduplication
  • Compression
  • Integrity

Install it under BSD-2-Clause

restic is a single executable, with official binaries on GitHub, packages for apt, Homebrew, Scoop and WinGet, and a minimal Docker image. Release binaries since version 0.6.1 are reproducible, so they can be rebuilt byte for byte from the source code. restic has no graphical interface or scheduler of its own, so backups are usually run from cron, systemd or Task Scheduler. restic is released under the BSD-2-Clause licence.

  • CLI
  • Single binary
  • Docker
  • BSD-2-Clause

Where it fits

Use cases

  1. 01

    Back up a server to cloud storage

    Create a repository with restic init, pointing it at an S3 bucket, Backblaze B2 or another backend, and choose a password. Run restic backup on the folders you want to protect, using --exclude options to skip caches or very large files. restic has no built-in scheduler, so the docs suggest cron or systemd on Linux and Task Scheduler on Windows.

  2. 02

    Keep a sensible backup history

    Run restic forget with options such as --keep-daily, --keep-weekly and --keep-last to decide which snapshots to keep. Add --prune so data no longer used by any snapshot is removed from storage. Use --dry-run first to see what would be deleted.

  3. 03

    Check that backups can be restored

    Run restic check to verify the repository, and add --read-data or --read-data-subset to read stored data back in parts. To recover files, use restic restore with --target and --include, or restic mount to browse snapshots as a folder. Database dumps can be saved directly with --stdin-from-command, for example from mysqldump.