Restic backup setup
in 5 minutes.

Updated November 2026

Copy-paste commands to connect Restic to your ServerCrate vault over HTTPS, on Linux, macOS, Windows and FreeBSD.

On this page

Fastest path on Linux

The Vault page in your portal shows this line with your vault filled in: click Reveal token and copy it. It installs restic, creates your encryption password on your machine, takes a first snapshot of /etc /home /root /var/www /srv and schedules a daily backup.

Linux, one-line installer
curl -fsSL https://servercrate.net/install.sh | sudo sh -s -- --repo "rest:https://vaultuser:YOUR_TOKEN@a1b2c3d4.vault.servercrate.net/"

The password is saved to /etc/servercrate/backup.env and never reaches us, so yours is the only copy: store it somewhere safe. Add --dry-run to see what the installer would do without changing anything. On macOS or Windows, or to do it by hand, follow the six steps below.

Step 1: Install Restic

Restic is a free, open-source backup tool: a single binary that encrypts your files on your machine and sends them to your vault.

Debian, Ubuntu
sudo apt update && sudo apt install -y restic
Fedora
sudo dnf install -y restic
RHEL, Rocky, AlmaLinux (from EPEL)
sudo dnf install -y epel-release && sudo dnf install -y restic
Arch
sudo pacman -S restic

Distribution packages can trail the current restic release. The official binary below is always the latest release on GitHub, checked against its published SHA256SUMS before it is installed.

Any Linux, official binary
# Pick the build for this machine
case "$(uname -m)" in
  x86_64) ARCH=amd64 ;;
  aarch64|arm64) ARCH=arm64 ;;
  armv7l) ARCH=arm ;;
  *) ARCH="$(uname -m)" ;;
esac

# Find the latest release from the redirect GitHub gives for /releases/latest
VER="$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/restic/restic/releases/latest)"
VER="${VER##*/v}"
F="restic_${VER}_linux_${ARCH}.bz2"

# Download, verify the checksum, then install
curl -fsSLO "https://github.com/restic/restic/releases/download/v${VER}/${F}"
curl -fsSLO "https://github.com/restic/restic/releases/download/v${VER}/SHA256SUMS"
grep " ${F}\$" SHA256SUMS | sha256sum -c - \
  && bunzip2 -f "$F" \
  && sudo install -m 755 "${F%.bz2}" /usr/local/bin/restic
macOS, Homebrew
brew install restic
Windows, PowerShell (winget)
winget install --exact --id restic.restic
Windows, PowerShell (Scoop)
scoop install restic

Open a new PowerShell window afterwards so restic is on your PATH. You can also download the Windows build from the restic releases on GitHub.

FreeBSD, as root
pkg install -y restic

Check it with restic version: it prints the installed version number.

Step 2: Connect to your vault

Open the Vault page in your portal. Its Connection panel shows your vault address and user; click the token to reveal it. Then set these two environment variables.

The Connection panel on the Vault page of the ServerCrate portal, showing the vault's REST endpoint URL, the user name vaultuser, and the access token hidden behind a Click to reveal control
sh, bash, zsh
# Replace YOUR_TOKEN and the vault hostname with the values from your portal
export RESTIC_REPOSITORY='rest:https://vaultuser:YOUR_TOKEN@a1b2c3d4.vault.servercrate.net/'
export RESTIC_PASSWORD='YOUR_ENCRYPTION_PASSWORD'
PowerShell
# Replace YOUR_TOKEN and the vault hostname with the values from your portal
$env:RESTIC_REPOSITORY = 'rest:https://vaultuser:YOUR_TOKEN@a1b2c3d4.vault.servercrate.net/'
$env:RESTIC_PASSWORD = 'YOUR_ENCRYPTION_PASSWORD'

The token signs you in to the vault. The encryption password is a different secret that you choose: it never reaches us and it is the only key to your data.

Persist these in your shell profile or in an env file only your user can read (chmod 600). Never commit them to git.

Step 3: Initialize the repository

Run this once to create your encrypted Restic repository on the vault.

Any OS
restic init

Your password encrypts everything. restic init uses the RESTIC_PASSWORD you set, or asks for one if you did not. Your data is encrypted with it before it leaves your machine, and ServerCrate never sees it. Store it in a password manager: lose it and your backups are unrecoverable.

Step 4: Run your first backup

Back up any directory. After the first run, only changed data uploads.

sh, bash, zsh
# Back up your home directory
restic backup ~/

# Back up several paths
restic backup /home /etc /var/www

# Skip folders you don't need
restic backup ~/ --exclude ~/.cache --exclude ~/Downloads

# List your snapshots
restic snapshots
PowerShell
# Back up your Documents folder
restic backup "$env:USERPROFILE\Documents"

# List your snapshots
restic snapshots

Step 5: Schedule automatic backups

On Linux, save a script and run it nightly with cron. Run these as root (sudo -i).

Linux, as root
# 1. Save your encryption password where only root can read it
( umask 077; printf '%s\n' 'YOUR_ENCRYPTION_PASSWORD' > /root/.restic-pass )

# 2. Create the backup script
cat > /usr/local/bin/sc-backup.sh << 'EOF'
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/bin
export RESTIC_REPOSITORY='rest:https://vaultuser:YOUR_TOKEN@a1b2c3d4.vault.servercrate.net/'
export RESTIC_PASSWORD_FILE=/root/.restic-pass
exec restic backup /home /etc --exclude /root/.cache
EOF
chmod 700 /usr/local/bin/sc-backup.sh

# 3. Run it every night at 02:00
echo '0 2 * * * root /usr/local/bin/sc-backup.sh >> /var/log/sc-backup.log 2>&1' > /etc/cron.d/sc-backup

Prefer systemd? The systemd timer guide has the units. On Windows or a Mac, Backrest schedules the same restic backups from a window.

Retention runs with your cleanup key from one trusted machine, never from the hosts you back up. See retention on ServerCrate vaults.

On paid plans, ServerCrate can alert you if backups stop running as expected, so a broken schedule does not quietly stay broken.

Step 6: Restore files

No restore fees. Restore everything, a specific snapshot, or a single file.

Any OS
# List snapshots
restic snapshots

# Restore the latest backup to /restore
restic restore latest --target /restore

# Restore a specific snapshot (use an ID from restic snapshots)
restic restore a2f4e91c --target /restore

# Restore a single file
restic restore latest --target /tmp/restore --include /home/user/document.pdf
Linux, macOS: browse a backup like a folder
mkdir -p ~/restic-mnt && restic mount ~/restic-mnt

The restore guide covers restoring after a complete system loss and checking backups before you need them.

Automation (advanced)

For unattended backups, the one-line installer above sets up a systemd timer, cron or launchd job for you, and the systemd timer guide shows how to build one by hand.

Helper scripts: our open-source restic-toolkit wraps backup, prune and healthcheck commands with sane defaults, plus drop-in systemd unit templates.

Stuck? Email us.

A real person responds, usually within a few hours on weekdays.

hello@servercrate.net

After setup: pick the right fit

You've seen the commands. Now get the vault.

10 GB free, vault ready in under a minute, no credit card required.

Need more than 10 GB? Starter is 250 GB for $30/yr, and every plan keeps the same vault and key when you move up.