Documentation

Updating Desk

New Desk versions are published to the Docker image ghcr.io/modelriver/desk and the GitHub repository. Updating is one command or a click, and every option can do it on a schedule.

What an update changes

  • Your data stays. Articles, notes, settings, branding and conversations are untouched.
  • The database updates itself. Any database changes run on their own when the new version starts.
  • Back up before a big jump. Going back to an older version after its database has been updated isn't supported, so copy your data folder first.
  • Major versions wait for you. The 1 image tag follows every 1.x release, so a 2.x release never arrives on its own. To stay on one exact version, use its full tag, like 1.0.1.

Update now, or on a schedule

WhereUpdate nowOn a schedule
Ubuntu serversudo desk-updateA root cron entry that runs it (below)
Docker Composedocker compose pull && docker compose up -dA cron entry (below)
Fly.iofly deployA scheduled job that runs fly deploy (below)
RenderManual Deploy → Deploy latest referenceA scheduled job that calls the deploy hook
RailwayRedeploySettings → Image Auto Updates
By handgit pull && npm ci && npm run build, then restartA cron entry that runs it

Weekly with cron (Docker Compose)

Every Monday at 04:00, in the folder with docker-compose.yml:

0 4 * * 1 cd /path/to/desk && docker compose pull -q && docker compose up -d

Add it with crontab -e. For a monthly update, use 0 4 1 * *.

Weekly with GitHub Actions (Fly.io)

Create a deploy token with fly tokens create deploy, save it as the repository secret FLY_API_TOKEN in a repository holding your fly.toml, and add .github/workflows/update-desk.yml:

YAML
1name: Update Desk
2on:
3 schedule:
4 - cron: '0 4 * * 1'
5 workflow_dispatch:
6jobs:
7 deploy:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v4
11 - uses: superfly/flyctl-actions/setup-flyctl@master
12 - run: flyctl deploy --remote-only
13 env:
14 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

The same schedule can call Render's deploy hook instead: replace the last two steps with run: curl -fsS -X POST "${{ secrets.RENDER_DEPLOY_HOOK }}" and save the hook URL as RENDER_DEPLOY_HOOK.

Ubuntu server

setup-server.sh installs desk-update, which updates to a release without any options to remember:

Bash
sudo desk-update --check # what's installed, and what's out
sudo desk-update # the newest release of the major version you run
sudo desk-update 1.1.1 # a given release, newer or older
sudo desk-update --rollback # back to the version before the last update

Each update:

  1. Backs up /var/lib/desk and /etc/desk to /var/backups/desk, with a consistent copy of the database taken while Desk keeps running. The last 3 are kept.
  2. Builds the new release beside the running one, in /opt/desk.next. If the download or build fails, it stops there and nothing changes.
  3. Switches over and restarts, a few seconds of downtime. The version you had is kept as /opt/desk.prev.
  4. Checks it answers. If the new version doesn't respond within 30 seconds, it switches back on its own.

Releases come from the repository you installed from. A new major version waits until you name it. Settings, data, nginx and HTTPS are never touched.

Weekly, every Monday at 04:00, with sudo crontab -e:

0 4 * * 1 /usr/local/bin/desk-update

To restore a backup, unpack it into an empty folder (never over /) and copy it back with Desk stopped. Removing the old database's -wal and -shm files keeps them from being replayed onto the restored copy:

Bash
sudo systemctl stop desk
sudo mkdir /tmp/desk-restore && sudo tar -xzf /var/backups/desk/FILE.tgz -C /tmp/desk-restore
sudo rsync -a /tmp/desk-restore/var/lib/desk/ /var/lib/desk/
sudo rm -f /var/lib/desk/desk.db-wal /var/lib/desk/desk.db-shm
sudo install -o desk -g desk -m 640 /tmp/desk-restore/desk.db /var/lib/desk/desk.db
sudo systemctl start desk

The archive also holds etc/desk/env, if you need your settings back.

An install from before Desk 1.1.2 doesn't have desk-update yet. Get it once from your copy of the repository, then use it from then on:

Bash
cd ~/desk && git pull && sudo install -m 755 deploy/update.sh /usr/local/bin/desk-update

After updating

Open Dashboard → Settings → System (admins only): it shows the version that's running. General shows whether ModelRiver is reachable.