Installation and Setup
Restic is written in Go and distributed as a single static binary. This means it has zero dependencies—no Python, no Ruby, no libc version issues. You download it, make it executable, and it works.
We recommend installing the pre-compiled binary directly from GitHub. Package managers (apt/yum) often lag behind by several versions, missing critical features like compression (V2) or cloud backend fixes.
Method 1: Official Binary (Recommended)
This method ensures you have the absolute latest version with all features.
Linux / macOS
-
Download the latest release: Visit the GitHub Releases page and find the correct asset (usually
linux_amd64ordarwin_amd64).# Example for Linux AMD64
wget https://github.com/restic/restic/releases/download/v0.16.2/restic_0.16.2_linux_amd64.bz2 -
Unzip and Install:
bunzip2 restic_0.16.2_linux_amd64.bz2
chmod +x restic_0.16.2_linux_amd64
sudo mv restic_0.16.2_linux_amd64 /usr/local/bin/restic -
Verify:
restic version
# Output: restic 0.16.2 compiled with go1.21.3 on linux/amd64
Windows
- Download the
.zipfile (e.g.,restic_0.16.2_windows_amd64.zip). - Extract
restic.exe. - Move it to a folder in your
%PATH%(e.g.,C:\Program Files\Restic\).
Method 2: Package Managers
While convenient, check the version after installing. If it's older than 0.14.0, uninstall it and use Method 1.
Ubuntu / Debian
sudo apt update
sudo apt install restic
macOS (Homebrew)
brew install restic
Windows (Scoop / Chocolatey)
scoop install restic
# or
choco install restic
Method 3: Self-Update
Once installed, Restic can update itself (if installed via binary/Method 1).
sudo restic self-update
Repository Initialization (The First Run)
Unlike rsync, Restic requires a "Repository" to be initialized before you can use it.
# 1. Choose a location (Local disk example)
export RESTIC_REPOSITORY="/var/backups/restic-repo"
# 2. Set a strong password
export RESTIC_PASSWORD="correct-horse-battery-staple"
# 3. Initialize
restic init
If you lose this password, your data is gone forever. Restic encryption has no backdoors. Store this password in a secure manager like 1Password or Bitwarden.
Environment Variables (Best Practice)
To avoid typing passwords in your terminal history, always set environment variables in your .bashrc or systemd service using EnvironmentFile.
# ~/.restic.env
export RESTIC_REPOSITORY="s3:s3.amazonaws.com/my-bucket"
export RESTIC_PASSWORD_FILE="/etc/restic/password"
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="secret..."
Then simply load it:
source ~/.restic.env
restic snapshots
What's Next
Now that Restic is installed, configure your Professional Strategy or learn the Core Commands.