Skip to content

Upgrades & backups

  1. Make a backup: Admin › Backup, Back up now. The new version migrates the database as it starts, and a migration can’t be undone: going back to the previous version means restoring this backup.

  2. From the repository’s root, check out the files of the version you are moving to, then fetch its images and start it:

    Terminal window
    git fetch --tags
    git checkout v1.15.0
    docker compose pull
    docker compose up -d

    Use the tag of the release your IMAGE_TAG points at (below): with the default latest, the newest one on the releases page. On edge, check out main instead.

The compose files and .env.example come with the code, and the images with IMAGE_TAG: both have to match. git pull on main brings files written for changes not released yet, which a release image may not understand, or a variable it requires without using it.

The API applies database migrations on its own as it starts: nothing else to run. Skipping several versions is fine; read the notes of each one you skip.

Before upgrading, read the changelog and the notes below: a few releases ask for a step of your own.

IMAGE_TAG in .env picks which images docker compose pull fetches, for amd64 (most servers) and arm64 (Raspberry Pi, ARM NAS) alike:

IMAGE_TAG What you get
latest (default) The latest release. Moves only when a new version comes out.
1, 1.12 The latest release within that major or minor version: fixes come, larger changes wait for you.
1.12.0 That exact release, until you change it.
edge Every commit merged into main, as loomkeep.app runs it. Newer, less settled.
a 12-character commit SHA That exact build of main. Only the 30 most recent stay available.

Each release’s notes, on GitHub and in the changelog, say when an upgrade asks for a step of your own.

Each image published from main carries two records, stored next to it in the registry:

  • a provenance signed through Sigstore with GitHub’s identity, which proves it was built by this repository’s workflow from a given commit;
  • an SBOM, the list of every package it contains, in SPDX format.

With the GitHub CLI, check an image before running it:

Terminal window
gh attestation verify oci://ghcr.io/logan2234/loomkeep-api:latest -R Logan2234/loomkeep

and list what it contains:

Terminal window
docker buildx imagetools inspect ghcr.io/logan2234/loomkeep-api:latest --format '{{ json (index .SBOM "linux/amd64").SPDX.packages }}'

Replace api by web for the other image, and linux/amd64 by linux/arm64 on an ARM server. Images built before 1.15 have no signature.

  • Instance settings moved out of Unleash. Social features, gamification, registration and the public API are now set in Admin › Instance settings. Flags of the same names in Unleash are ignored. A variable in .env still wins: remove SOCIAL_ENABLED & co. from it to manage them from the page.

Loomkeep backs its database up every night at 3 a.m. on its own, keeping the last seven. Each dump is encrypted before it touches the disk, for a key only you hold:

  1. On your own machine, not the server, create a key pair with age:

    Terminal window
    age-keygen -o loomkeep-backup-key.txt
  2. Copy the age1… public key it prints into BACKUP_ENCRYPTION_PUBLIC_KEY in .env.

  3. Keep loomkeep-backup-key.txt somewhere safe and separate, like a password manager. Without it, no backup can ever be read.

Admin › Backup lists the backups, makes one on demand, downloads or deletes them, and restores one, which replaces the whole database.

Backups kept on the server die with it. Copy them elsewhere regularly. The repository’s docker/backup-offsite.sh is the script the hosted instance runs from cron to ship its encrypted dumps to Cloudflare R2 through rclone; its header explains how to adapt it.

  1. Decrypt the dump on your machine:

    Terminal window
    age -d -i loomkeep-backup-key.txt -o dump.sql backup-file.sql.age
  2. Restore it from Admin › Backup.

Restoring from Admin › Backup needs an API that starts and an administrator who can sign in. When that’s exactly what’s broken (a failed upgrade, a lost database, a new server), restore from the command line.

  1. Get a dump out of the server, if it’s still reachable. The nightly ones live in the api container:

    Terminal window
    docker compose exec api ls /data/backups
    docker compose cp api:/data/backups/loomkeep-….sql.age .
  2. Decrypt it on your machine, as above.

  3. On a new server, clone the repository and put back your whole .env, not a fresh one: MFA_ENCRYPTION_KEY decrypts the authenticator-app secrets stored in the database, POSTGRES_PASSWORD and the JWT secrets must stay the same, and BACKUP_ENCRYPTION_PUBLIC_KEY keeps the next backups readable with your key.

  4. Start the database alone, on an empty volume:

    Terminal window
    docker compose up -d db
  5. Load the dump in one transaction, so a truncated file leaves the database empty rather than half restored (replace loomkeep if you changed POSTGRES_USER or POSTGRES_DB):

    Terminal window
    docker compose exec -T db psql -U loomkeep -d loomkeep --set ON_ERROR_STOP=1 --single-transaction < dump.sql
  6. Start everything with an image at least as recent as the version the dump came from: the API applies the migrations the dump lacks when it starts, but an older image doesn’t know the newer tables.

    Terminal window
    docker compose up -d
  7. Delete dump.sql: it holds every account in clear.

Each person can also take a full copy of their own data at any time: see Your data.