Installation

Installation

Full bare-metal installation of fsbackup using fs-install.sh — user, ZFS permissions, systemd units, and web UI.

fsbackup v2.0 runs directly on the backup server as a systemd service. There is no Docker container.

Prerequisites

  • Ubuntu 22.04+ or Debian 12+
  • A ZFS pool with backup/snapshots dataset created (see ZFS pool setup)
  • Internet access to download packages

Run the installer

The installer must be run as root:

curl -fsSL https://raw.githubusercontent.com/fsbackup/fsbackup/main/bin/fs-install.sh | sudo bash

Or clone the repo and run it locally:

git clone https://github.com/fsbackup/fsbackup.git
sudo bash fsbackup/bin/fs-install.sh

The installer runs interactively and walks through each step.

What the installer does

1. Packages

Installs: rsync, openssh-client, jq, zstd, curl, unzip, python3, python3-venv, acl, zfsutils-linux, sanoid

Installs separately (not in Ubuntu 24.04 apt):

  • AWS CLI v2 — via official AWS installer
  • yq (mikefarah/yq v4) — via GitHub releases

2. fsbackup user

Creates system user fsbackup (UID 993) with home at /var/lib/fsbackup. Adds to groups: systemd-journal, nodeexp_txt, docker (if they exist).

3. Scripts

Rsyncs the repo to /opt/fsbackup/. Excludes .git, web/.venv, web/.env, and conf/targets.yml.

4. Config skeleton

  • Creates /etc/fsbackup/, /var/lib/fsbackup/log/, /var/lib/fsbackup/.ssh/
  • Copies fsbackup.conf.example/etc/fsbackup/fsbackup.conf if not present
  • Copies targets.yml.example/etc/fsbackup/targets.yml if not present
  • Grants fsbackup user write ACL on /etc/fsbackup/ (for web UI targets editor)

5. ZFS delegation

zfs allow fsbackup create,snapshot,mount,destroy backup/snapshots
chown -R fsbackup:fsbackup /backup/snapshots

If the pool doesn't exist yet, the installer prints the commands to run later.

6. Systemd units

Copies all units from systemd/ to /etc/systemd/system/ and enables timers based on which *_SCHEDULE vars are set in fsbackup.conf.

7. Schedule

Runs fs-schedule-apply.sh to write OnCalendar= drop-ins for each enabled timer.

8. Web UI

Runs web/install.sh which creates a Python venv, installs dependencies, generates web/.env, and installs fsbackup-web.service.

Post-install steps

Create per-target ZFS datasets

sudo /opt/fsbackup/bin/fs-provision.sh --dry-run   # preview first
sudo /opt/fsbackup/bin/fs-provision.sh

Edit config

sudo nano /etc/fsbackup/fsbackup.conf
sudo nano /etc/fsbackup/targets.yml

Trust remote SSH host keys

sudo /opt/fsbackup/utils/fs-trust-host.sh <hostname>

Apply local path ACLs

For any targets using local paths (Docker volumes, shared directories):

sudo /opt/fsbackup/bin/fs-fix-permissions.sh

Security note: fs-fix-permissions.sh runs setfacl -R -m u:fsbackup:rX on each local source path. This grants the fsbackup user read access to every file in that directory tree — including application secrets your containers may store. Review each path before applying, especially paths under /docker/volumes/.

Apply schedule changes

After editing schedule vars in fsbackup.conf:

sudo /opt/fsbackup/bin/fs-schedule-apply.sh

Verify

# List active timers
systemctl list-timers | grep fsbackup

# Run doctor
sudo -u fsbackup /opt/fsbackup/bin/fs-doctor.sh --class class1

# First backup (dry run)
sudo -u fsbackup /opt/fsbackup/bin/fs-runner.sh daily --class class1 --dry-run

Upgrading

cd /path/to/fsbackup-repo
git pull

sudo rsync -a --delete \
  --exclude='.git' \
  --exclude='web/.venv' \
  --exclude='web/.env' \
  --exclude='conf/targets.yml' \
  ./ /opt/fsbackup/

sudo systemctl restart fsbackup-web

Web UI

The web UI runs as fsbackup-web.service and binds to 0.0.0.0:8080 by default.

sudo systemctl status fsbackup-web
sudo systemctl restart fsbackup-web
sudo journalctl -u fsbackup-web -f