All docs

Running Fettlecode

Backups and upgrades

Back up and restore Fettlecode, upgrade to a new version, pin a published image, and go back if you need to.

Backups

From the Fettlecode folder:

node scripts/backup.mjs

This writes backups/fettlecode-<date>/, holding:

  • the database (a pg_dump in custom format);
  • the data volume: repositories, Git LFS files, the SSH host key, the signing key and the generated AUTH_SECRET.

The app stops for a few seconds while it runs, so the two match. Add --online to skip that, at the cost of a backup that may be a moment out of step.

Backups contain secrets. Keep them off the server, encrypted, and somewhere only you can reach. Run them on a schedule (cron, or Task Scheduler on Windows), and test a restore now and then.

Restore

node scripts/restore.mjs backups/fettlecode-2026-11-01 --yes

This replaces everything in the running Fettlecode with the backup.

Reviews live in the repositories too

Each repository's review history is also kept inside it, at refs/meta/fettlecode, and its admins can download everything else as JSON. See Taking it with you.

Knowing when there's an update

Once a day, Fettlecode checks its website for a newer release. When there is one, instance administrators see a notice at the top of the app saying which version is out, with links to what's new and how to update. Dismissing it hides it until the next version.

The check sends nothing about your install. Turn it off with UPDATE_CHECK=false. In-development builds don't check.

One-click updates

An optional updater lets you update from the notice in the app: Update now takes a backup, downloads the new version, restarts Fettlecode and checks that it answers. If the new version doesn't start within three minutes, the updater goes back to the version you had and restores the backup it took a moment before. Only instance administrators can start an update.

It needs a published image. For a new install:

./install.sh --image ghcr.io/stormhawkjordan/fettlecode:1 --updater

For an existing one, add to .env:

FETTLECODE_IMAGE=ghcr.io/stormhawkjordan/fettlecode:1.0.0
COMPOSE_PROFILES=updater

then start it:

docker compose build updater
docker compose up -d --no-build

Good to know:

  • The updater can control Docker on this machine (it has the Docker socket), which is as powerful as root. It only acts when someone clicks Update in Fettlecode, and only on Fettlecode's app container. Leave it off if you'd rather update by hand.
  • It updates within a major version (1.x to 1.y). A new major version needs steps from you, so it says so and leaves the update to you.
  • It pins FETTLECODE_IMAGE in .env to the exact version it installed.
  • Backups collect in backups/: copy them somewhere safe, and delete old ones.
  • What it did is in docker compose logs updater.

Upgrades

Take a backup first: it's your way back if something goes wrong.

Building from the source

git pull
docker compose up -d --build

Running a published image

Set FETTLECODE_IMAGE in .env to an exact version, then pull and start without building:

docker compose pull
docker compose up -d --no-build

Pin an exact version (such as fettlecode:1.0.0) rather than latest, so upgrades happen when you choose.

Either way, the new version applies any database changes when it starts, and carries on with the same data. A few seconds of downtime is normal. Read the changelog first, for anything a version asks of you, such as a new setting.

Going back

Database changes can't be undone by starting an older version: it may not understand the newer database. To go back:

  1. Stop the app: docker compose stop app.
  2. Set FETTLECODE_IMAGE (or check out the older version) to the previous version.
  3. Restore the backup you took before upgrading.

Anything done between the upgrade and the restore is lost, so go back soon or not at all. It's usually better to wait for a fix.