Skip to content

Install on Linux

dxcufgb edited this page Nov 5, 2026 · 2 revisions

Install on Linux

Runs as a systemd service on Linux, e.g. a Raspberry Pi.

Before you start

  • git: sudo apt install git
  • the acl package, when the Foundry data folder is only readable by the Foundry user (it usually is): sudo apt install acl
  • Node.js 18+ is used when installed system-wide; otherwise the installer downloads the official Node.js 22.
  • The GitHub token (you can also paste it on the admin page later).

Install

curl -fsSL https://raw.githubusercontent.com/dxcufgb/install/main/install.sh | sudo bash -s foundry-world-backup

Or download foundry-world-backup-linux.tar.gz from the latest release, tar xzf it, cd foundry-world-backup-X.Y.Z and run sudo ./install.sh.

The installer asks for:

  • the Foundry user data folder (it guesses /home/*/foundrydata and the like),
  • the GitHub token (Enter = paste it on the admin page later),
  • the admin page password (required: the page is where everything is set up),
  • the notification e-mail addresses and mail server (Enter = none),
  • whether to turn on automatic updates.

Then it:

  • creates the system user foundry-backup,
  • gives it read access to the worlds folder with a POSIX ACL (inherited by new worlds; --grant-access repeats that later),
  • writes the settings to /etc/foundry-world-backup/, the state to /var/lib/foundry-world-backup/ and the code to /opt/foundry-world-backup/,
  • installs and starts the systemd service,
  • prints the address of the Admin Page (https://<host>:8484/; the self-signed certificate makes the browser warn once, see Trusting the Certificate).

Re-running the installer updates the code and keeps every setting.

Non-interactive install

With --yes, the settings come from FOUNDRY_BACKUP_* variables passed through sudo --preserve-env:

export FOUNDRY_BACKUP_GITHUB_TOKEN=github_pat_... FOUNDRY_BACKUP_ADMIN_PASSWORD='a long password'
sudo --preserve-env=FOUNDRY_BACKUP_GITHUB_TOKEN,FOUNDRY_BACKUP_ADMIN_PASSWORD ./install.sh --yes \
  --foundry-data /home/foundry/foundrydata --auto-update

Variables the installer reads:

Variable What
FOUNDRY_BACKUP_GITHUB_TOKEN the GitHub token
FOUNDRY_BACKUP_ADMIN_PASSWORD the admin page password
FOUNDRY_BACKUP_DATA the Foundry user data folder (like --foundry-data)
FOUNDRY_BACKUP_ADMIN_PORT the admin page port (default 8484)
FOUNDRY_BACKUP_ADMIN_PUBLIC_URL the address the admin page is reached at from outside, e.g. https://backup.example.com:8484
FOUNDRY_BACKUP_FOUNDRY_URL where Foundry answers (default http://localhost:30000; empty = no active-world check)
FOUNDRY_BACKUP_NOTIFY_EMAILS notification recipients, comma separated (first install or --set-notify)
FOUNDRY_BACKUP_SMTP_* the mail server: _HOST, _PORT, _SECURITY (starttls, tls or none), _USER, _PASSWORD, _FROM
UPDATER_GITHUB_TOKEN optional, see Automatic Updates

Installer options

sudo ./install.sh --help lists them all.

Option What it does
--yes non-interactive: settings from the FOUNDRY_BACKUP_* variables
--foundry-data DIR the Foundry user data folder
--run-as USER run as the Foundry user instead of foundry-backup, so no ACL is needed
--admin-port PORT the admin page port
--grant-access give the service user read access to the worlds folder again
--set-admin-password change the admin page password
--set-notify enter the e-mail settings for notifications again (also editable on the admin page)
--renew-admin-cert make a new certificate for the admin page
--auto-update / --no-auto-update see Automatic Updates (off unless asked for)
--enable-auto-update / --disable-auto-update see Automatic Updates
--check-update only check: exit 0 = up to date, 10 = newer release available, 75 = another update run holds the lock, other = error
--update-now install the latest release now (same path as the daily updater)
--uninstall [--purge] remove the service; --purge also deletes the settings, the local git copies and the service user (the repositories on GitHub stay)
--install-node / --no-install-node download the official Node.js 22 without asking when none is usable / never download it

Check that it runs

systemctl status foundry-world-backup
journalctl -u foundry-world-backup -f

The log shows the worlds folder, the state folder, the admin page address, the result of the token check and one line per backup (<world id>: backed up to <repo> (new commit, scheduled run for …) or backup FAILED (…)). The token never appears in the log.

Where things are

Path What
/opt/foundry-world-backup the code (root-owned, replaced by updates)
/etc/foundry-world-backup/ settings: config.json, admin.json, env with the token, admin-tls.crt/.key, update-request
/var/lib/foundry-world-backup/ the git copies and status.json (service user, mode 700)

The three JSON/env files are owned by the service user, mode 600, and rewritten in place by the admin page.

The service runs under systemd hardening: ProtectSystem=strict, ProtectHome=read-only (so a data folder under /home stays readable), and ReadWritePaths = the state folder and the four settings files.

Clone this wiki locally