--- url: https://docs.codefox.ai/self-host/update.md --- # Update and restart the apps This page lets you update the apps on your server to their newest build, turn automatic updates on or off, roll back to an earlier build, and restart an app. ## How an update works Each app on the server runs one build, named by the commit it was built from (the `TAG` setting in its `.env`). People see it as a version such as `0.2.0.143` in the app's settings. Every update, by hand or automatic, follows the same steps, run by the app's own updater on the server: 1. Check that the server has enough free disk (4 GB by default, the `UPDATER_MIN_FREE_GB` setting). 2. Download the new images, trying up to three times. 3. Arctic only: wait, for up to 20 minutes, while meetings are being recorded. 4. Take a snapshot of the app's database. 5. Start the new build. 6. Wait up to 200 seconds for the app to report that it is healthy and running the new build. 7. Save the new `TAG`. If the new build does not start or does not report healthy, the updater puts the database snapshot back and starts the previous build again. The app is **Rolled back**, and the message says why. A build that rolled back is not tried again automatically; the next published build is. The updater keeps the last two snapshots (`UPDATER_SNAPSHOT_KEEP`). They exist only to roll back an update; they are not backups. ## Update in Admin 1. Open **Server** › **Products**. The table shows what each app is running, and **Newer version published** marks an app with a newer build. 2. Select **Update** on the app's row, or **Update all** at the top. 3. Confirm. The app restarts and is back in a minute or two. Admin itself is a row of the same table. While it updates, the console is away for a minute or two and the page carries on by itself. ## Update with the CLI 1. See what would change: `foxden update --product fennec --dry-run`. It shows the build running now and the newest one. 2. Run `foxden update --product fennec` and confirm. `foxden` follows each step and prints the result. `foxden update --all` updates the `foxden` tool first, then every app on the server; `--all --no-self` skips the tool. `--yes` answers the question for a script. `foxden update` also brings the server any new compose files and new settings that the release added. It only replaces files a release shipped, and never changes a value you set. ## Turn automatic updates on or off With automatic updates on, the app's updater checks once an hour and installs each newer build through the same steps, with the same rollback. A new install starts with them on for every app except two: * **Arctic** keeps its own switch, **Install updates automatically** in Arctic's **Settings** › **Updates**, and starts with it off. The `UPDATER_AUTO_UPDATE` setting does not apply to Arctic. * **Cape** never updates by itself, because an update would cut live calls. Update it by hand when no calls are running. **In Admin:** on **Server** › **Products**, use the **Updates itself** switch on the app's row. **With the CLI:** `foxden update --auto on --product fennec` or `--auto off`. `foxden update --all --auto on` switches every app. `foxden update --auto` shows whether it is on and what the last hourly check decided. To keep an app from asking for newer builds until someone runs an update, set `UPDATER_CHECK` to `0` in its settings. This also keeps automatic updates from running. ## Pin or roll back to a build With the CLI only: `foxden update --product fennec --tag `, where `` is the 40-character build commit. With automatic updates on, the app stays on that build until a newer one is published. ## Update the foxden tool `foxden self-update` replaces the `foxden` tool itself and changes nothing on the server. It checks the release's checksum and signature, so it needs `cosign` installed. `foxden self-update --check` only says whether a newer release exists. ## Restart an app A restart recreates the app's containers so that changed settings take effect. People using it are interrupted for a minute or two. **In Admin:** on **Server** › **Products**, select **Restart** on the app's row, or select the app's name and then **Restart to apply**. Admin asks the server to run the same restart as the CLI below. **With the CLI:** `foxden restart --product fennec`. It recreates the containers, then waits for the app to report healthy. `foxden restart --product fennec worker` restarts one service; `--dry-run` says what would be recreated. A restart never runs while an update is in progress. ## An app without Admin An app installed on its own has its own **Updates** page in its settings, with **Update now** and **Install updates automatically**. They use the same updater. When the app is connected to Admin, that page moves to Admin's **Server** › **Products**. ## Troubleshooting ### The update was rolled back The previous build is running, and nothing is lost. The message the update showed says why; the updater's log has more: `foxden logs updater --product fennec`. Wait for the next build, or ask for help with a support bundle; see [Check the server's health](/self-host/health). ### Rollback failed The message says **Rollback failed** and names a database snapshot whose name starts with `recovery-`. The updater keeps that file and stops automatic updates until you act. Check what is running with `foxden status` and `foxden logs`, put the snapshot back if the database needs it, then run `foxden update` to try again. ### There is not enough free disk `Only ...G is free on this box and the update needs ...G; nothing on this box changed.` Free disk space (old backups in the app's `backups` folder, unused images with `docker image prune`), then update again. ### The registry rejected this box's pull token `The registry rejected this box's pull token (UPDATER_REGISTRY_TOKEN); nothing on this box changed.` The pull token in the app's settings expired or was revoked. Set a new one with `foxden config set UPDATER_REGISTRY_TOKEN --stdin --product ` (Arctic: `RECALL_REGISTRY_TOKEN`). ### An update is already in progress `foxden update: refused; an update is already in progress`. Wait until `foxden status` shows it finished.