Skip to content

All in one

github-actions[bot] edited this page Nov 28, 2026 · 13 revisions

All-in-one image

Release candidates only, for now. The all-in-one image is published as ghcr.io/svenger87/kinboard-aio:next (and :main, :sha-…, and each version's own tag). It gets latest after two release cycles on next, measurements on a Raspberry Pi and a rehearsed PostgreSQL upgrade on a copy of real data. Until then, a household's everyday screen is better served by the compose file.

Kinboard in one container with one folder for its data: the app, its PostgreSQL 17 database, PostgREST and the scheduled jobs, started in order and stopped safely by one supervisor. It is the same build as the compose file's image, with the database inside. Nothing must be set to start it: the passwords and keys create themselves on the first start.

It is meant for systems that install one container per app (Unraid's Docker page, Portainer's container templates, a plain docker run). Where your system takes a compose file (TrueNAS, CasaOS/ZimaOS, Umbrel, Portainer stacks, Synology), use the compose file instead.

Start it

docker run -d --name kinboard \
  --restart unless-stopped --stop-timeout 60 \
  -p 3001:3000 \
  -v /srv/kinboard:/data \
  -e TZ=Europe/Berlin \
  ghcr.io/svenger87/kinboard-aio:next

Then open http://<this machine>:3001 and create your family; every other device joins with the family's code.

  • --stop-timeout 60: the database gets up to 30 seconds to shut down cleanly inside the container. Docker's default of 10 seconds would cut it off; that is safe (PostgreSQL recovers), but slow on the next start.
  • /data: one folder on a real disk. Not a USB stick (FAT), not a Windows share or drive, not a RAM disk: the container refuses those and says why.
  • PUID and PGID (default 1000): the user and group that run everything inside, PostgreSQL included, and own every file in /data. Set them to the owner of your folder (id -u, id -g); on Unraid 99 and 100. 0 is refused: PostgreSQL does not run as root.

Optional settings: TZ, SITE_URL (the address other apps get in links, such as the calendar feed), INSTANCE_ADMIN_FAMILY_ID (the family that sees update notices when there is more than one), GO2RTC_URL (below), and the automatic backups' KINBOARD_BACKUP_* and a /backups folder (Backups).

The container speaks plain HTTP. Push notifications, the barcode scanner's live camera and installing the app need an https:// address in front of it: HTTPS has the ways, shortest first.

Health: docker ps shows the container healthy once /api/health answers, which checks the database too. A first start (creating the database and every table) takes about half a minute on a PC, longer on a Raspberry Pi.

Unraid

The template is generated with the image and lives in its own repository, svenger87/kinboard-unraid (copied from this repository's dist/unraid/). Until it is in Community Applications, add it by hand: put templates/kinboard.xml from that repository into /boot/config/plugins/dockerMan/templates-user/ on the flash drive, then Docker → Add Container → pick Kinboard. Its defaults are Unraid's: the data folder /mnt/user/appdata/kinboard-aio, PUID 99 and PGID 100, and the stop timeout above. (Installing from the template is still to be rehearsed on a real Unraid 7 box.) The data folder is not /mnt/user/appdata/kinboard, where Self-hosting puts a git install: the image refuses a folder holding another install's database, so a household with both keeps them apart. For automatic updates, add the second template, kinboard-updater (below).

HTTPS: the template carries Unraid 7's Use Tailscale settings, preset for Tailscale Serve and switched off. Switch it on for an https://kinboard.<your-tailnet>.ts.net address: HTTPS.

Cameras

go2rtc is not inside. Snapshot and MJPEG cameras work without it. For RTSP cameras, run go2rtc as its own container and set GO2RTC_URL to its address (for example http://192.168.1.10:1984, or http://go2rtc:1984 on a Docker network they share, as in the move).

What is in /data

Folder What
db/ the PostgreSQL 17 database (mode 0700)
storage/files/ uploaded files: family photos, recipe pictures, vehicle images
config/secrets/ the database password, the key that signs logins, the push keys (0600)
config/updater/ the start records: the last version that ran healthy, a failed start, a database upgrade
backups/ the checked dumps taken before migrations and database upgrades (five of each kept)
backups/scheduled/ the automatic backups, when they are on and no other folder is mapped

Back it up whole. Stop the container, copy the folder, start it again. Whoever can read the folder can read everything, the secrets included: keep the backups private. Or let Kinboard do it while it runs: Backups.

Backups

Kinboard can back itself up on a schedule. Off until you switch it on. Each backup is one file holding everything a new install needs to carry on where this one stopped: every table of every family, the uploaded photos, and the keys that must travel (the key that signs logins, so screens stay signed in; the push keys, so notifications keep working; the calendar-feed and presence tokens other systems hold). It is the same archive kinboard export writes, so a restore is kinboard import, which checks every table before it keeps anything. The database password is not in it: a new install keeps its own.

Switch it on

  • In Settings → Data & safety → Automatic backups, as the install's own family (the one that also sees update notices): daily or weekly, the time, the day for weekly, and how many to keep (7 unless you change it). Saving asks for the settings PIN; a family without one sets one first.
  • Or in the container's settings, which then win and show in Settings as set by the server: KINBOARD_BACKUP_SCHEDULE (off, daily or weekly), KINBOARD_BACKUP_TIME (HH:MM, default 03:00), KINBOARD_BACKUP_DAY (mon … sun, default sun) and KINBOARD_BACKUP_KEEP (default 7). Empty means not set. A value Kinboard doesn't understand switches the backups off, and Settings says which one.

The time is the clock of TZ (Europe/Berlin unless you set it). Pick an hour your server is on and idle; a backup reads the whole database and every photo. If the container was stopped at that time, the backup runs within a few minutes of the next start instead.

Where they go, and why another disk

By default into /data/backups/scheduled/. That protects against a mistake (a deleted family, an update you want to undo by moving to a fresh install) but not against the disk itself: when the disk under /data fails, the backups go with it. So give them a folder on another disk:

  • Unraid: the template's Backups (optional) field, for example /mnt/user/backups/kinboard on a share that doesn't live on the same disk as appdata (or on another machine, mounted with Unassigned Devices). It is mounted at /backups in the container, and Kinboard uses it as soon as it is there.
  • docker run: add -v /mnt/other-disk/kinboard-backups:/backups.
  • Any other path inside the container: set KINBOARD_BACKUP_PATH.

The folder must be writable by PUID:PGID (on Unraid, 99:100, which a new share already is). Keep it private: on Unraid 99 is the shared nobody user, so the file modes don't keep out other containers running as it or a share exported to guests: set the share's SMB export to No or Private. One folder per install: two installs given the same folder remove each other's backups. An empty folder that belongs to root (what Docker creates for a path that didn't exist) is handed to PUID:PGID at the start; anything else is left as you set it. Settings says where the backups go, and warns when that is inside /data or on the same disk.

Each backup is written under a temporary dot-name, read back in full (every table's rows, every photo's checksum, every key) and only then given its name, kinboard-backup-<date and time>-<version>-sha-<build>.tar.gz, readable by PUID only (mode 0600; a folder Kinboard creates is 0700). A backup of an install with no family yet is refused, so a fresh install sharing the folder never rotates a household's backups out. Only after that are the oldest beyond the number to keep removed. A backup that fails (a full disk, a folder it can't write to) removes only its own temporary file: the last good backup always stays. A backup cut off by a restart or an update leaves only that dot-file, which never counts and the next run removes.

When one fails

Kinboard tries again an hour later, up to three times, then at the next scheduled time. Settings shows the last good backup (when, how big), the next run and the last error, and while the last backup failed, a notice at the top of Settings says so to the install's own family. The container log has every step: docker logs kinboard 2>&1 | grep -E '\[(scheduled-)?backup\]'.

Back up now in Settings starts one at once, and Download fetches the newest through the browser (both ask for the settings PIN; the download link works once, for two minutes). The file holds every family's data and keys: keep it somewhere only you can read.

Backups and updates don't overlap: an update by kinboard-updater waits for a running backup to finish before it takes its own dump and replaces the container, and a scheduled backup doesn't start while an update's dump runs.

Restore a backup

A backup goes into a fresh install of the same build, before its first family is created. The end of the file name says which: in kinboard-backup-20261128T030000Z-1.18.0-sha-abc1234.tar.gz that is version 1.18.0, image tag sha-abc1234 (every published all-in-one image has its sha- tag; a release also has its version tag, 1.18.0). If the install it came from still runs, stop it first.

  1. Move the old data folder aside (don't delete it until the restore works), or pick a new, empty one.

  2. Start Kinboard on the empty folder with the backup's build as the image tag: ghcr.io/svenger87/kinboard-aio:sha-abc1234 for the file above, and on another port than the screens use (and without its reverse-proxy settings). On Unraid, set Repository in the template to that tag and Web UI to another port, and Apply. Wait until it is healthy; don't open it in a browser to create a family. (A screen that reaches it while it is still empty forgets its sign-in, as the move explains.)

  3. Import the backup:

    docker exec -i kinboard kinboard import - < /mnt/other-disk/kinboard-backups/kinboard-backup-20261128T030000Z-1.18.0-sha-abc1234.tar.gz

    (On Unraid the container is called Kinboard; run it in Unraid's terminal with the backup's path on the server.) It checks every table's row count and checksum before it keeps anything, restores the photos and the keys, and restarts the app inside the container.

  4. Give it the screens' port (and the proxy settings) back (on Unraid: edit the template, Apply). The families, the photos and the settings are back, and screens that were signed in stay signed in when they reach it under the same address. The automatic backups' schedule comes back with them; check that the backups folder is mapped again.

  5. To get updates again, set the tag back to next.

A backup from an older build than the image you want: restore it on its own build first, as above, then update. If the import says the archive is from another version, the tag doesn't match the file name.

Compose installs (compose.yml, TrueNAS, CasaOS, Umbrel, Portainer stacks) don't have this switch: their app container gets the config folder read-only and has no folder of its own off the database's disk, and the stores back up their app folders their own way. Back up the three folders, or run kinboard export from a scheduled task on the host. A git install keeps its own scripts (Self-hosting).

Updates

An update is a new container from a newer image, pulled by whatever runs it (Unraid's Apply Update, Portainer's Recreate, docker pull and docker run again, or kinboard-updater beside it). The image never replaces itself. At every start it:

  1. takes a checked database dump into /data/backups/ before any database change that will run. No checked dump, no change and no start; the log says why;
  2. applies the database changes once;
  3. after its first healthy minute, records its version in config/updater/last-good.

If a new version's database change fails, the container stops, and the log names the last version that ran healthy on this data: set the image tag back to it. Database changes only ever add, so the older version runs on the newer database, and Settings then shows that the update was rolled back.

PostgreSQL major upgrades

The image pins PostgreSQL 17. When a later release moves to a newer major, that image also carries 17's programs, and on its first start it:

  1. takes a checked dump of the whole database first; without one it does nothing;
  2. builds the upgraded database in /data/db.new with pg_upgrade (copy mode: /data/db is not touched), and checks free space for that copy first;
  3. starts it, checks it holds the same tables, families, recorded changes and database roles, and that it can load the safeguard against unfiltered writes, rebuilds its indexes, and only then swaps the folders by renaming: the old database becomes /data/db.old.

Any failure leaves /data/db as it was, and the container stops with the reason: run the previous image tag again and it starts as before. If the new version does not run healthy for a minute and you go back to the previous tag within a day, that one puts the old database back by itself (the new one is kept aside as db.failed-pg…, with anything written to it). Later than a day it doesn't, because the new version may have been in use all that time: set KINBOARD_PG_ROLLBACK=1 on the previous tag to put the old database back anyway. After the first healthy minute the upgrade is final: going back is refused, because data has been written to the new one since; the checked dump from before the upgrade stays in /data/backups/.

The old database folder. /data/db.old is a whole second copy of the database, so it doubles the space the database takes until it is deleted. Settings says so, under the version, to the install's own family (the one that also sees the automatic updates' status):

  • while the previous version could still go back to it (the first minute, or up to a day while the new version has not yet run healthy for a minute), it says the old database is kept, until when, and which version it is for; there is no Delete button then;
  • after that, it says it can be deleted, with its size, both PostgreSQL versions and the date of the upgrade, and a Delete button. Deleting asks for the settings PIN (a family without one sets one first), removes /data/db.old, writes a line to the log and the notice goes away.

Delete refuses while an upgrade is running, and refuses anything at /data/db.old that isn't the folder the upgrade left there (a link, another database), without touching it. Deleting the folder by hand when the container is stopped works too. Once it is gone, going back to the previous version, even with KINBOARD_PG_ROLLBACK=1, is refused with a message saying the old database was deleted, and nothing is changed; run the newer image again.

KINBOARD_PG_UPGRADE=off stops the image from upgrading on its own; it then refuses to start on the older database instead.

Automatic updates

Off unless you turn it on: a second, small container, kinboard-updater, started next to Kinboard. It is the same updater the compose file uses.

What it does. Two minutes after it starts, and then every 30 minutes, it asks the registry whether the tag Kinboard runs (next, for now) has a newer image. When it has:

  1. it pulls the new image;
  2. it takes Kinboard's own checked database dump, the one the image takes before any database change, into /data/backups/ as pre-update-<time>.sql.gz (the last five are kept). No checked dump, no update;
  3. it replaces the Kinboard container with one that has exactly the same settings (port, data folder, variables, network, labels, restart and stop settings) and only the new image. Nothing else on the machine is touched;
  4. it waits up to 10 minutes for the new one to come up healthy and to pass a check of its database tables. If it doesn't, the container that ran before is put back, on the same data, and that release is skipped until a newer one is published. Settings then says "The update to … didn't start, so Kinboard went back to …";
  5. Settings shows "Updated automatically to … on …" under the version.

The uploaded files and the keys are not copied anywhere: an update doesn't change them, and they stay in /data. Back up the whole folder as above.

The first check only looks. It notes what runs and changes nothing; the one after it is the first that can update. A version tag never moves: with kinboard-aio:1.18.0 the updater never even asks the registry.

A PostgreSQL major upgrade (above) happens inside the new container at its first start. The updater then waits up to an hour instead of 10 minutes (KINBOARD_PG_UPGRADE_TIMEOUT, in seconds). If the new version fails before it has run healthy for a minute, the previous container goes back and puts the previous database back itself. If it fails later than that, the upgrade is final and the previous version would refuse the database, so the updater keeps the new version running instead of stopping Kinboard, and Settings says that going back didn't work: the log has every step, and the dump from before the upgrade is in /data/backups/.

If the updater is stopped in the middle of an update (a reboot, a docker stop), it puts the previous container back at its next start, from the record it keeps in its own folder.

Turn it on

Whichever way, the updater gets Docker's socket, which it needs to pull and replace containers. Whoever holds the socket controls the machine: the updater is the only container that gets it, never Kinboard itself. It opens no port and takes no requests. It needs a folder or volume of its own at /kinboard for its log and its record of an update in progress; without one it refuses to update.

Unraid. A second template, kinboard-updater, next to Kinboard's in the same repository (templates/kinboard-updater.xml). Install it after Kinboard; leave Kinboard container at the name you gave Kinboard (Kinboard). Its folder is /mnt/user/appdata/kinboard-updater.

Plain Docker. With Kinboard started as above (--name kinboard):

docker run -d --name kinboard-updater --restart unless-stopped \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v kinboard-updater:/kinboard \
  -e KINBOARD_UPDATER=1 -e KINBOARD_AIO_CONTAINER=kinboard \
  --entrypoint kinboard-updater \
  ghcr.io/svenger87/kinboard-updater:next

Compose (Portainer, Dockge, a terminal): next to the Kinboard service in the same file.

services:
  kinboard:
    image: ghcr.io/svenger87/kinboard-aio:next
    container_name: kinboard
    restart: unless-stopped
    stop_grace_period: 60s
    ports: ["3001:3000"]
    volumes: ["/srv/kinboard:/data"]
  kinboard-updater:
    image: ghcr.io/svenger87/kinboard-updater:next
    container_name: kinboard-updater
    restart: unless-stopped
    entrypoint: ["kinboard-updater"]
    environment:
      KINBOARD_UPDATER: "1"
      KINBOARD_AIO_CONTAINER: kinboard
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - kinboard-updater:/kinboard
volumes:
  kinboard-updater:

A later Up of that file finds Kinboard already on the image its tag names, and leaves it alone.

KINBOARD_AIO_CONTAINER names the container to update. Without it the updater looks for the one container on the machine that runs the all-in-one image, and refuses when there are two: one updater for each, each with its name.

Its log: docker logs kinboard-updater, and updater/update.log in its folder. To check now instead of waiting for the next half hour:

docker exec kinboard-updater kinboard-updater --check-now

That runs one check, the same one the loop runs and behind the same lock (if a check is already running it says so and leaves it to finish), prints its log and exits. kinboard-updater --help lists the options. Only the container's own start runs the 30-minute loop: kinboard-updater run any other way without an option, or with one it doesn't know, prints the usage and changes nothing (before 1.18 every call started a second loop). To pause it, set KINBOARD_UPDATE_TICK=off on the updater and recreate it; to remove it, remove its container. Updating the updater itself: pull its image and recreate it (Unraid: Apply Update on it, or the Auto Update plugin, which is fine for the updater). It never replaces its own container.

Unraid's own updates

Unraid itself never updates a container on its own. Its Docker page shows update ready when the registry has a newer image under the template's tag, and Apply Update recreates the container from the template. With the updater:

  • After the updater's update, it records the new image in Unraid's update status, the way Apply Update does, so the Docker page shows Kinboard up to date. Pressing Apply Update anyway is harmless: Unraid recreates the container on the image it already runs.
  • After a rollback, the Docker page shows update ready for the release the updater skipped. Don't apply it by hand: it is the version that didn't start. The updater applies the next one by itself.
  • The Auto Update Applications plugin: leave Kinboard out of it (set Update All to No and don't tick Kinboard). It updates on its own schedule with no backup and no way back, and it would apply a release the updater skipped. Ticking kinboard-updater there is fine.
  • The template's Repository is what the updater follows: the tag in it (:next). Change it to a version (:1.18.0) and both Unraid and the updater stay on that version.

Moving between the compose file and the all-in-one image

Optional. A git install (webapp/docker/docker-compose.yml) and a one-file install (compose.yml) keep working and stay supported; nothing moves on its own. Move if you want one container instead of six or seven, updates by kinboard-updater or your NAS, and scheduled backups switched on in Settings. A git install on a plain Docker host can let one command do it all: the guided way.

The move goes only by export and import, never by pointing one at the other's folders: the compose file's database is PostgreSQL 15 built for another C library, and a database folder from one is not safe under the other. Both images have the same two commands:

# on the compose install: one archive with the database, the files and the keys
# (umask 077: the archive holds the keys that sign every login; only you may read it)
(umask 077; docker exec kinboard-webapp kinboard export - > kinboard-export.tar.gz)
# start the all-in-one image on an empty folder, wait until it is healthy, then
docker exec -i kinboard kinboard import - < kinboard-export.tar.gz

The import goes into a fresh install only, before the first family is created. It checks every table's row count and checksum before it keeps anything, and on any difference keeps nothing. It brings the uploaded files and the keys that must travel (the login key, so screens stay signed in; the push keys, so notifications keep working; the calendar-feed and presence tokens other systems hold), then restarts the app inside the container. Screens that were signed in stay signed in when they reach the new install under the same host name or IP address as before (the port may differ: a sign-in does not depend on it). A screen sent to another machine's address starts at the join screen: join it again with the family's code, which is the same as before.

That is the whole move. The steps below wrap it so that the screens are down for about a minute and nothing is lost: a dry run on your real data first, then the move with a way back at every step. A household behind Traefik with RTSP cameras moved this way was down for 44 seconds, and its tablets stayed signed in.

Names used below; change them to yours: the old install's containers kinboard-webapp and kinboard-cron (a git install with another PROJECT_NAME in .env calls them <PROJECT_NAME>-webapp and so on; docker ps lists them), the all-in-one container kinboard, its folder /srv/kinboard-aio, go2rtc's folder /srv/go2rtc, the address the screens open https://kinboard.example.com, the old port 3001, and proxy, the Docker network your reverse proxy watches.

The guided way: ./start.sh move-to-aio

For a git install on a plain Docker host, one command does the steps below, in the same order, with the same checks:

cd webapp/docker
./start.sh move-to-aio            # checks, shows the plan, then offers the dry run
./start.sh move-to-aio --dry-run  # straight to the dry run
./start.sh move-to-aio            # once the dry run passed: the move

It checks first and changes nothing: the same build on both sides (1.18.0-rc.2 or newer, and it says how to get there), disk space, an empty folder for the new install (--data; without it, one next to the old data folder), no other container on the ports it takes over, a Traefik in front (from the webapp's labels) and go2rtc. Then it prints the plan and asks. The dry run exports your data, imports it into a throwaway all-in-one container with no network, checks it and removes it all, with no downtime. The move refuses without a dry run of the same build from the last 24 hours.

The move keeps the screens without Kinboard for about a minute: a checked backup; the fence; the export; the old stack stopped, nothing removed; go2rtc started on its own; the import into the new container while it has no network and no port, checked against the archive and the old install's families; then the new container gets the old port, and Traefik's labels and network. If anything fails after the old stack stopped, it puts the old stack back by itself. No setting's value is ever printed.

  • ./start.sh move-to-aio --status shows where things are.
  • ./start.sh move-to-aio --rollback goes back to the old stack. What was saved on the all-in-one container since the move is not carried back; its folder is kept, so you can still export it.
  • A move cut off halfway (a closed terminal, a power cut) is found by the next run: --resume finishes it, --rollback goes back.
  • ./start.sh up refuses to start the old stack while the new container runs.

It does not do Unraid (its Docker page owns the containers), Synology's Container Manager, or a reverse proxy other than Traefik with labels: for those, follow the steps below by hand.

Before you start

The same Kinboard version on both sides, 1.18.0-rc.2 or newer. The import refuses an archive from another version, and before 1.18.0-rc.2 it also refused an install that had grown through years of updates (its tables' columns in another order than a new install's). kinboard export doesn't exist before 1.18: on 1.17 docker exec … kinboard answers executable file not found. So first put the old install on the tag the all-in-one image runs, next for now:

  • git install: in webapp/docker/.env, set KINBOARD_TAG=next, then

    git pull
    cd webapp/docker && ./start.sh up

    git pull and ./start.sh up alone keep the tag .env names (latest when it names none), so without the line above the webapp stays on the version it had.

  • one-file install (compose.yml): set the variable KINBOARD_TAG to next in your Compose UI (or .env beside the file), then Pull and Up.

Then check the version it runs:

curl -s -m 5 http://localhost:3001/api/health; echo

Expected: "version":"1.18.0-rc.2" or later, and "db":true.

Pull the images now, so the download isn't part of the downtime (go2rtc only if you have RTSP cameras):

docker pull ghcr.io/svenger87/kinboard-aio:next
docker pull alexxit/go2rtc:1.9.14

Room. The archive is about the size of your photos plus a little; the new folder needs the photos again and about three times the database. The import checks both first and refuses, changing nothing, when they don't fit (details in Room it needs). df -h on the disk that will hold /srv/kinboard-aio and on Docker's own disk.

Settings that travel by hand. The archive brings the keys, not your settings. From a git install's webapp/docker/.env, copy the ones you set into a private file for the new container:

(umask 077; grep -E '^(TZ|SITE_URL|INSTANCE_ADMIN_FAMILY_ID|GOOGLE_CLIENT_ID|GOOGLE_CLIENT_SECRET|GOOGLE_REDIRECT_URI|OPENWEATHERMAP_API_KEY|VAPID_SUBJECT|PHOTON_URL|SCHOOL_HOLIDAY_SYNC|SESSION_RATE_LIMIT_PER_MINUTE)=' ~/kinboard/webapp/docker/.env > ~/kinboard-aio.env)
cut -d= -f1 ~/kinboard-aio.env
grep -c '="' ~/kinboard-aio.env

(~/kinboard is your clone.) The second line lists the names it found, without their values. Docker takes the values literally, quotes included: when the third line counts more than 0, take the quotes off with sed -i 's/^\([A-Z_]*\)="\(.*\)"$/\1=\2/' ~/kinboard-aio.env. Don't copy JWT_SECRET, VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, CRON_SECRET or PRESENCE_SENSOR_TOKEN: the import brings them, and a value in the container's environment would win over the imported one. Nor POSTGRES_PASSWORD, ANON_KEY or SERVICE_ROLE_KEY: each install keeps its own. The camera variables are go2rtc's (step 5). A one-file install sets only TZ, SITE_URL and the like in its Compose UI; write those into the file by hand.

The Diun auto-update (a git install with docker-compose.diun.yml): stop it for the move, or its next run can start the old webapp again behind your back:

docker stop kinboard-diun kinboard-webhook

Way back: docker start kinboard-diun kinboard-webhook.

The dry run

Before any downtime, prove the import on your real data: export from the running install, import into a throwaway all-in-one container that has no network at all (--network none: it can't send a reminder, sync a calendar or reach a camera while it holds a copy of your family), check it, remove it. The old install keeps running and doesn't notice.

(umask 077; docker exec kinboard-webapp kinboard export - > kinboard-dryrun.tar.gz); echo "exit $?"
docker run -d --name kinboard-dryrun --network none --stop-timeout 60 \
  -v kinboard-dryrun:/data ghcr.io/svenger87/kinboard-aio:next
timeout 180 sh -c 'until [ "$(docker inspect -f "{{.State.Health.Status}}" kinboard-dryrun)" = healthy ]; do sleep 2; done'; echo "exit $?"
docker exec -i kinboard-dryrun kinboard import - < kinboard-dryrun.tar.gz; echo "exit $?"
timeout 120 sh -c 'until docker exec kinboard-dryrun curl -sf -m 5 http://127.0.0.1:3000/api/health | grep -q "\"db\":true"; do sleep 2; done'; echo "exit $?"
docker exec kinboard-dryrun curl -s -m 5 http://127.0.0.1:3000/api/setup/status; echo

Expected: [kinboard] exported Kinboard 1.18.0-rc.2: N tables (M rows), F file(s), 5 secret(s). and exit 0; the container healthy within about half a minute; imported Kinboard 1.18.0-rc.2 (compose, PostgreSQL 15.…): N tables, M rows, every table's count and checksum verified; F file(s); 5 secret(s). and exit 0; the app back within about ten seconds; and {"hasFamilies":true}. Then remove all of it; the archive holds every login key:

docker rm -f kinboard-dryrun && docker volume rm kinboard-dryrun
rm kinboard-dryrun.tar.gz

If the import refuses, it says why and has kept nothing. Don't move: your install stays as it is. The message (not the archive) is what an issue needs.

The move

About a minute of downtime for the screens. Keep one in view. Run every step in one shell, with these shorthands:

K=~/kinboard/webapp/docker        # the old install's folder (one-file: the folder with compose.yml)
CF=$(grep '^COMPOSE_FILES=' $K/.env 2>/dev/null | cut -d= -f2- | tr -d '"')
H=https://kinboard.example.com    # the address the screens open

CF is the git install's list of compose files (empty is fine). Every curl has -m 5: once the old webapp is gone, a reverse proxy can hold a request open for minutes, and a step that waits on it waits with it (a real move sat ten minutes on one).

1. A backup you have checked

A git install: Self-hosting → Backups, the database and the storage directory, each checked as described there. A one-file install: Compose UIs → Backups. Don't go on without it.

Way back: nothing has changed.

2. Fence: nothing writes after the export

Take the old webapp off the reverse proxy and stop its scheduler, so that nothing a screen saves, and no job, lands after the export:

docker network disconnect proxy kinboard-webapp
docker stop kinboard-cron
curl -s -m 5 -o /dev/null -w '%{http_code}\n' $H/api/health

Expected: 404, 502 or 504 from the proxy (or 000, the time limit). The screens show that they are offline.

  • No reverse proxy (the screens open http://<server>:3001): there is nothing to switch off. Skip the first line, and run steps 3 and 4 straight after each other: anything saved in between is lost.
  • One-file install: it has no kinboard-cron (the webapp runs the jobs); skip the second line.

Way back: docker network connect proxy kinboard-webapp; docker start kinboard-cron.

3. Export

mkdir -p -m 700 ~/kinboard-move
A=~/kinboard-move/kinboard-export.tar.gz
(umask 077; docker exec kinboard-webapp kinboard export - > $A); echo "exit $?"; ls -l $A

Expected: [kinboard] exported Kinboard 1.18.0-rc.2: N tables (M rows), F file(s), 5 secret(s)., exit 0, and -rw-------. Under a second for a small install; count on seconds per few hundred MB of photos.

Way back: as step 2.

4. Stop the old install, keep everything

cd $K && docker compose $CF stop
docker compose $CF ps -a --format '{{.Name}} {{.State}}'

Expected: every container exited. Nothing is removed: the database, the files and .env stay as they were, and the stopped stack is your way back. Containers stopped by hand stay stopped after a reboot. (One-file install: Stop in your Compose UI does the same.)

Way back: the way back, from here on.

5. Cameras: go2rtc as its own container

Only with RTSP cameras; snapshot and MJPEG cameras work without go2rtc. The all-in-one image has no go2rtc inside: run it as its own container on the same network as Kinboard, which then reaches it as http://go2rtc:1984 (GO2RTC_URL, step 6). A git install takes its go2rtc.yaml and the camera variables from .env along:

sudo install -d -o "$(id -u)" -g "$(id -g)" /srv/go2rtc
cp $K/go2rtc.yaml /srv/go2rtc/go2rtc.yaml
(umask 077; grep -E '^(CAMERA_USER|CAMERA_PASS|HIKVISION_HOST|AMCREST_HOST|WEBRTC_LAN_IP|WEBRTC_PUBLIC_HOST)=' $K/.env > /srv/go2rtc/camera.env)
docker run -d --name go2rtc --restart unless-stopped --network proxy \
  -p 127.0.0.1:1984:1984 -p 8555:8555/udp \
  --env-file /srv/go2rtc/camera.env -v /srv/go2rtc:/config \
  alexxit/go2rtc:1.9.14
docker logs go2rtc 2>&1 | tail -5

Expected: [api] listen addr=:1984, [rtsp] listen addr=:8554 and [webrtc] listen … :8555, no error. The file holds no passwords: go2rtc fills them in from the variables. A stream with #hardware=vaapi needs the GPU: add --device /dev/dri/renderD128. The port 1984 stays on the machine itself, as before: go2rtc's API has no password, and anything on the same Docker network can reach it, so keep that network to what needs it.

A one-file install's go2rtc has no file (its cameras are added in Kinboard's settings); it needs only this machine's LAN address for WebRTC. Leave out --env-file and the volume, and add after the image name go2rtc -config "{webrtc: {candidates: ['192.168.1.10:8555', 'stun:8555']}}" with your address.

Way back: docker stop go2rtc.

6. Start the all-in-one image out of reach, and import

Out of reach means another port than the old install's and no reverse-proxy settings yet. A screen that loads a page from the new install while it is still empty finds no family, forgets its sign-in and shows the join screen; it signs itself in again only at its next page load after the import, and a kitchen screen nobody reloads sits there until someone does.

docker run -d --name kinboard --restart unless-stopped --stop-timeout 60 \
  --network proxy -p 3002:3000 -v /srv/kinboard-aio:/data \
  --env-file ~/kinboard-aio.env -e GO2RTC_URL=http://go2rtc:1984 \
  ghcr.io/svenger87/kinboard-aio:next
timeout 180 sh -c 'until [ "$(docker inspect -f "{{.State.Health.Status}}" kinboard)" = healthy ]; do sleep 2; done'; echo "exit $?"
curl -s -m 5 http://localhost:3002/api/setup/status; echo

Expected: healthy after about half a minute, then {"hasFamilies":false}. Do this before step 1 if you like: the household doesn't notice it, and its first start is then out of the downtime. Without RTSP cameras leave out GO2RTC_URL. Without a reverse proxy there is no proxy network: leave out --network proxy, or, with go2rtc, give the two a network of their own (docker network create kinboard-net, and that name in steps 5 to 7). Set PUID and PGID if the folder belongs to another user than 1000 (Start it).

Then the import:

docker exec -i kinboard kinboard import - < $A; echo "exit $?"
timeout 120 sh -c 'until curl -sf -m 5 http://localhost:3002/api/health | grep -q "\"db\":true"; do sleep 2; done'; echo "exit $?"
curl -s -m 5 http://localhost:3002/api/setup/status; echo

Expected: imported Kinboard … every table's count and checksum verified; F file(s); 5 secret(s)., exit 0, the app back within about ten seconds, and {"hasFamilies":true}.

Way back: the way back. The import keeps all or nothing; a refused one changed nothing.

7. Give it the old address

The new container with the old port and the reverse proxy's settings, on the same folder. A container's port and labels can't change while it exists, so it is replaced (Unraid: edit the template, Apply). With Traefik, the labels are the ones your old webapp had (Reverse proxy below):

docker stop -t 60 kinboard && docker rm kinboard
docker run -d --name kinboard --restart unless-stopped --stop-timeout 60 \
  --network proxy -p 3001:3000 -v /srv/kinboard-aio:/data \
  --env-file ~/kinboard-aio.env -e GO2RTC_URL=http://go2rtc:1984 \
  -l traefik.enable=true \
  -l 'traefik.http.routers.kinboard.rule=Host(`kinboard.example.com`)' \
  -l traefik.http.routers.kinboard.entrypoints=websecure \
  -l traefik.http.routers.kinboard.tls.certresolver=letsencrypt \
  -l traefik.http.services.kinboard.loadbalancer.server.port=3000 \
  ghcr.io/svenger87/kinboard-aio:next
timeout 180 sh -c 'until [ "$(docker inspect -f "{{.State.Health.Status}}" kinboard)" = healthy ]; do sleep 2; done'; echo "exit $?"
timeout 60 sh -c "until curl -s -m 5 $H/api/setup/status | grep -q hasFamilies; do sleep 1; done"; echo "exit $?"
curl -s -m 5 $H/api/setup/status; echo
curl -s -m 5 $H/api/health; echo
curl -s -m 5 -o /dev/null -w 'port 3001: %{http_code}\n' http://localhost:3001/api/health

Expected: healthy after 5 to 20 seconds, then the proxy within a few seconds more (it takes a container on only once it is healthy, and answers 404 page not found until then), {"hasFamilies":true}, {"status":"ok",…,"db":true} and port 3001: 200. The downtime ends here. In the first half minute the health may say "status":"degraded" with "worker":false: the scheduler hasn't run its first job yet; it turns ok and true on its own. Without a reverse proxy, leave out the -l lines and the three $H lines.

Way back: the way back.

8. Check

  • A screen: no join screen. A screen left open stays where it was and picks up the next change within seconds of reconnecting; one reloaded is signed in. Add a shopping item on a phone and watch it arrive.
  • The scheduled jobs: within a minute, docker logs kinboard 2>&1 | grep 'Job "process-notifications"' | tail -1 shows failed: false.
  • Cameras: the camera page, a snapshot and live video.
  • Push: send one test notification. Subscriptions keep working: the push keys came along.
  • Google Calendar and the weather: Settings shows the calendar connected; the weather loads.
  • docker logs kinboard 2>&1 | grep -iE "error|refus" | grep -v 'error: none' | tail shows nothing (every finished job logs error: none, hence the second grep).

The way back

From step 4 on, about 30 seconds:

docker stop kinboard-updater 2>/dev/null; docker stop -t 60 kinboard; docker stop go2rtc
cd $K && docker compose $CF up -d
docker network connect proxy kinboard-webapp
timeout 180 sh -c 'until [ "$(docker inspect -f "{{.State.Health.Status}}" kinboard-webapp)" = healthy ]; do sleep 2; done'; echo "exit $?"
curl -s -m 5 $H/api/health; echo

The network connect line is not optional. docker compose up -d does not put back a network you removed by hand in step 2: the webapp comes up healthy, and the proxy answers Bad Gateway for as long as nobody notices. (Or recreate it: docker compose $CF up -d --force-recreate webapp, a few seconds slower.) A git install with docker-compose.image.yml pulls the webapp image again on the way (its pull policy is always); offline, it starts the one it has. "worker":false in the first minute is the scheduler not having run yet. Start Diun and its webhook again if you stopped them.

To try the move again later, the stopped containers still hold their names, and the new folder already has the family: step 5's and step 6's docker run would stop at "The container name … is already in use", and the import would refuse ("this install already has 1 family(ies)"). So first remove them and put the folder aside, then start again at step 1:

docker rm kinboard go2rtc
sudo mv /srv/kinboard-aio /srv/kinboard-aio.failed-$(date +%Y%m%d-%H%M)

The way back loses everything saved on the new install since step 3; once it has run for a while, move back with an export of it instead (Back, from the all-in-one image).

Reverse proxy

The rule for any proxy: it must reach the all-in-one container's port 3000, either over a Docker network they share (http://kinboard:3000) or at the port published on the machine (http://<server>:3001). Keep the same host name as before, and the screens stay signed in: a sign-in belongs to the host name it was made at.

  • Traefik: the labels go on the all-in-one container, as in step 7, and both sit on the network Traefik watches (proxy here, TRAEFIK_NETWORK in a git install's .env). Take the rule, entry point and certificate resolver from your old webapp (DOMAIN and TRAEFIK_CERT_RESOLVER in .env, or docker inspect kinboard-webapp). With the container on more than one network, add -l traefik.docker.network=proxy.
  • Nginx Proxy Manager and SWAG forward to the server's address and a port: give the all-in-one container the old port in step 7 and they need no change (HTTPS).

Other proxies: HTTPS.

On Unraid

The same steps, with the Docker page instead of docker run:

  • Templates. Kinboard and kinboard-updater come from svenger87/kinboard-unraid (Unraid above). go2rtc has none of ours: Add Container with Repository alexxit/go2rtc:1.9.14, a Path /config (your go2rtc folder), Ports 1984 (value 127.0.0.1:1984) and 8555 (udp), and a Variable for each camera variable. Add another Path, Port, Variable, Label or Device offers Label (Traefik's labels: name and value) and Device (/dev/dri/renderD128 for the GPU).
  • One network per template. Put Kinboard, go2rtc and your reverse proxy on the same custom network (Network Type: the proxy's, for example proxy). A network that doesn't exist silently becomes none when you Apply: the container starts, reachable by nobody. Create it first.
  • Step 6 is Add Container with Web UI on another port (3003) and the label traefik.enable set to false; step 7 is Edit, the old port and traefik.enable true, Apply. Data folder /mnt/user/appdata/kinboard-aio, PUID 99, PGID 100.
  • Apply sets no restart policy. Only Unraid's Autostart starts a container after a reboot or an array start: switch it on for go2rtc and Kinboard (and the updater), with go2rtc above Kinboard.
  • Apply pulls only a tag it doesn't have. A Repository tag already on the server, however old, runs as it is: docker pull it first (or Force update).
  • The way back is the same: the old install is a compose project, not a template; Stop Kinboard and go2rtc on the Docker page.

After the move

  • Backups. Switch on the scheduled backups in Settings → Data & safety, to a folder on another disk. Or keep your own script: dump through the all-in-one container and back up /data/storage and /data/config with it (the keys live there now, not in .env):

    (umask 077; docker exec kinboard pg_dump -U supabase_admin -F c postgres > kinboard-$(date +%F).pgdump)
    docker exec -i kinboard pg_restore -l < kinboard-$(date +%F).pgdump | grep -c ' TABLE public families '

    Expected: 1. The dump holds every family's data: umask 077 keeps it yours alone. An old script that checks a dump for the auth schema refuses every dump of the all-in-one image, which has none: check for the families table instead.

  • Automatic updates: kinboard-updater beside it.

  • Delete the export archive once all is well (rm -r ~/kinboard-move), and ~/kinboard-aio.env once the container has its settings: the archive holds every login key.

  • Keep the old install stopped, not removed, for a week or so: it is the way back. Then, in its folder, docker compose $CF down, without -v (-v deletes a one-file install's volumes), and its folders once you are sure.

What doesn't come over

  • ofelia (kinboard-cron): the all-in-one image runs the same jobs inside, on the same schedule.
  • Diun and the webhook: kinboard-updater replaces them.
  • Your old backup script's checks: see above.
  • Settings in .env and the camera variables: by hand, as above.
  • The database password: each install keeps its own.

Two installs with the same data both send every reminder and notification, and both sync the calendars: never run the old one again next to the new one. Stop the old install for good once the new one works.

Back, from the all-in-one image to a fresh compose install

(umask 077; docker exec kinboard kinboard export - > kinboard-export.tar.gz)
# compose.yml's webapp has the config volume read-only, so the import runs in
# a one-off container with the stack's network and volumes:
NET=$(docker inspect -f '{{range $net, $_ := .NetworkSettings.Networks}}{{$net}}{{end}}' kinboard-db)
docker run --rm -i --network "$NET" \
  -e POSTGRES_HOST=db -e FILES_DIR=/var/lib/storage/files \
  -v kinboard-config:/kinboard -v kinboard-storage:/var/lib/storage \
  ghcr.io/svenger87/kinboard:next kinboard import - < kinboard-export.tar.gz
docker compose restart rest webapp

(NET is the stack's network, <the compose project>_kinboard; the line above reads it off the database container. Use the image tag the all-in-one image had. With KINBOARD_CONFIG_DIR and KINBOARD_STORAGE_DIR set to folders, mount those instead of the two volumes. Run the last line in the folder with compose.yml.)

The archive holds every family's data and the keys that sign their logins: keep it private, and delete it once it is imported. The database password is not in it; each install keeps its own.

Room it needs

The import unpacks the archive in the container's own temporary folder (on Docker's disk), then needs room in /data for the uploaded files and about three times the database's data. It checks both first and refuses, changing nothing, with how much it needs and how much is free.

If an import is cut off

If the container is stopped or killed, or the power goes, before the import finished, nothing of it is kept: the all-in-one image takes out the files and keys it had put in place at its next start, before the app runs, and says so in its log. Run the import again. On a compose install, the next kinboard import does the same.

When it refuses to start

The log says What to do
holds a PostgreSQL … cluster that this image did not create the folder is from another image (a compose install's database). Move with export and import instead
is PostgreSQL 18, newer than this image's 17 you went back to an older tag after a database upgrade that has been in use since. Run the newer tag again; the dump from before the upgrade is named in the log
REFUSING to migrate without a verified backup free space in /data/backups, then start again
PUID and PGID must not be 0 set them to the folder owner's ids
not writable mount /data read-write

Third-party licences

The image's licence label names Kinboard's own licence and those of the software it is built around: PostgreSQL, PostgREST (MIT), pg-safeupdate and s6-overlay (ISC).

On arm64 the image also carries the runtime libraries PostgREST's arm64 build is linked against, taken unchanged from the official PostgREST image: glibc, libpq, OpenSSL, Kerberos, OpenLDAP, Cyrus SASL, GMP, zlib, zstd, keyutils and com_err. They are under the LGPL (some parts also offered under the GPL), the Apache License 2.0, the PostgreSQL licence, and BSD-, MIT- and zlib-style licences. Each package's copyright file is in /usr/share/licenses/postgrest-runtime/, named after the Debian package, and the image's SBOM lists them with their versions:

docker run --rm --entrypoint ls ghcr.io/svenger87/kinboard-aio:next /usr/share/licenses/postgrest-runtime
docker buildx imagetools inspect ghcr.io/svenger87/kinboard-aio:next --format '{{ json (index .SBOM "linux/arm64") }}'

The amd64 image needs none of them: PostgREST is a single static binary there.

Resources

Measured on the development machine (amd64); the Raspberry Pi measurements are still to come.

Image about 560 MB on disk, 129 MB to download (amd64); the webapp image alone is 481 MB and 108 MB
Memory, idle about 140 MiB for the whole container with one family (docker stats, 90 s after the last request)
Data the database is about 25 MB for one family; uploads are what grows

Clone this wiki locally