> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novacula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade Self-hosted Novacula

> Install a new release: verify it, load the mirror, upgrade the Hub, then the Agents and nodes from the console

Each release `0.1.N` arrives as one platform archive (Hub, Agent, telemetry) and one pack per chain. The node client catalog is compiled into the Agent, so **new client versions always arrive with a new release** — there is no node update outside one. Upgrade in the order below: the Hub goes before the Agents.

> [!NOTE]
>
> 0.1.21 is the first Self-hosted release, so there is nothing to upgrade from yet. This page describes how every later release is installed.

**1. Verify the delivery**

Check every delivery on the Hub host, in a copy only `root` can write (as `/root/nvcl-incoming` in [Install](https://docs.novacula.io/recipes/self-hosted/install.md#verify-the-delivery-kit)), against the release key you pinned at `/etc/nvcl/nvcl-release.pub.pem` — never against a `nvcl-release.pub.pem` that arrives with the delivery. When Novacula announces a new key, pin it in place of the old one first, only if its fingerprint matches the one sent over the second channel (the same command as at install).

```bash theme={null}
openssl dgst -sha256 -verify /etc/nvcl/nvcl-release.pub.pem -signature SHA256SUMS.sig SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
```

The first must print `Verified OK` and the second `OK` for each archive. Check too that every name in the listing carries the new release — a whole older release is signed as well, and would pass both commands under its own names — and that every archive you received is listed. Both commands must print nothing:

```bash theme={null}
v=<new release>
awk '{print $2}' SHA256SUMS | grep -vF -- "-$v-linux-x64.tar.gz"
for a in *.tar.gz; do awk '{print $2}' SHA256SUMS | grep -qxF -- "$a" || echo "not in SHA256SUMS, delete it: $a"; done
```

Then extract the verified platform archive and check its own file listing, as at [install](https://docs.novacula.io/recipes/self-hosted/install.md#verify-the-delivery-kit). The steps below take the manifest, the Hub tarball, the Agent's `.sha256`, and the telemetry tarball from it:

```bash theme={null}
rm -rf /root/nvcl-kit && mkdir -p /root/nvcl-kit
tar -xzf nvcl-platform-$v-linux-x64.tar.gz -C /root/nvcl-kit
(cd /root/nvcl-kit/nvcl-platform-$v && sha256sum -c --quiet SHA256SUMS) || echo "FAILED"
```

**2. Check the upgrade is allowed**

The new platform archive's `manifest.json` (`/root/nvcl-kit/nvcl-platform-<new release>/manifest.json`) names `minimumUpgradeFrom`. A jump is allowed when the running Hub is at least that release and every client version your nodes run has a transition to a version in the new release. Otherwise upgrade through an intermediate release first. Read the running release with any signed-in token:

```bash theme={null}
curl -fsS -H @<(printf 'Authorization: Bearer %s\n' "$TOKEN") https://hub.example.local/v1/hub | jq -r .release
```

**3. Load the mirror first**

Extract the `mirror/` trees of the new platform archive and of the new pack for every chain you run into the mirror, then check it with the **new** Agent. Loading is additive: never delete files a running node may still use, since a node keeps its version until you upgrade it. This block stops at the first problem rather than loading part of a release, and takes the new Agent out of the verified archive rather than out of the mirror:

```bash theme={null}
(
  set -eo pipefail
  openssl dgst -sha256 -verify /etc/nvcl/nvcl-release.pub.pem -signature SHA256SUMS.sig SHA256SUMS
  verified=$(sha256sum -c --ignore-missing SHA256SUMS | sed -n 's/: OK$//p')
  mkdir -p /srv/nvcl-mirror
  for a in $verified; do
    tar -xzf "$a" --strip-components=2 -C /srv/nvcl-mirror "${a%-linux-x64.tar.gz}/mirror"
  done
  cdn=nvcl-prod-releases.fra1.cdn.digitaloceanspaces.com
  v=<new release>
  new=$(mktemp -d)
  tar -xzOf nvcl-platform-$v-linux-x64.tar.gz \
    nvcl-platform-$v/mirror/$cdn/agent/$v/nvcl-agent-$v-linux-x64.tar.gz | tar -xz -C "$new"
  "$new/agent/bin/agent" mirror-check --mirror <the Agents' [sources] mirror> \
    --chains <the chains you run, e.g. bitcoin,ethereum> --arch x86_64 \
    --agent-url https://$cdn/agent/$v/nvcl-agent-$v-linux-x64.tar.gz
)
```

Check the mirror exactly as the Agents reach it: with an http(s) mirror, publish the files first and run the check from a host on the Agents' network against that URL; for one under your CA, add `--ca-file /etc/nvcl/hub-ca.pem`. See [Check the mirror](https://docs.novacula.io/recipes/self-hosted/agent-sources.md#check-the-mirror).

**4. Upgrade the Hub**

Skip this when `components.hub.version` in the new manifest equals the running Hub (releases normally version every component, so expect to run it). [Back up the database](https://docs.novacula.io/recipes/self-hosted/install.md#postgres-17), then replace the Hub with `hub/nvcl-hub-<new release>-linux-x64.tar.gz` from the platform archive:

```bash theme={null}
cd /root/nvcl-kit/nvcl-platform-<new release>/hub
systemctl stop nvcl-hub
rm -rf /opt/nvcl/nvcl-hub
tar -xzf nvcl-hub-<new release>-linux-x64.tar.gz -C /opt/nvcl
cp /opt/nvcl/nvcl-hub/systemd/nvcl-hub.service /etc/systemd/system/
systemctl daemon-reload
systemctl start nvcl-hub
```

The Hub migrates its database schema on start. Compare `/etc/nvcl/hub.env` with the new `hub.env.example` for added keys. To roll back, restore the backup and start the previous tarball.

**5. Register the Agent release and upgrade the executors**

Register the new Agent release as a super-admin, with its URL under the mirror (written exactly as the Agents' `[sources] mirror`) and the sha256 from the `.sha256` file next to it in the verified kit — the same call as at [install](https://docs.novacula.io/recipes/self-hosted/install.md#hub), with the new version.

Each Agent then takes the release under its executor's upgrade policy. Unless you turned on [automatic updates](https://docs.novacula.io/docs/executors/upgrade-executor.md#automatic-updates), start the upgrade on each executor in the console — see [Upgrade an executor](https://docs.novacula.io/docs/executors/upgrade-executor.md). The Agent downloads the tarball through its mirror, checks the sha256, swaps `/opt/nvcl/agent`, and keeps the old image as `/opt/nvcl/agent.prev` for a manual rollback. Its nodes keep running.

**6. Upgrade the nodes**

With the new Agent running, the console offers the new client versions along the supported update path. Start each node update from the console — see [Upgrade a node](https://docs.novacula.io/docs/nodes/upgrade-node.md). The binaries are already in the mirror.

**7. Update telemetry, if it changed**

Only when `components.telemetry.version` changed: run the **Update** section of the `README.md` inside `telemetry/nvcl-telemetry-<new release>-linux-x64.tar.gz`, from `/root/nvcl-kit/nvcl-platform-<new release>/telemetry/`, leaving out its first command (`sha256sum -c`). The stored metrics and logs under `/var/lib/nvcl` stay in place.

## Other changes

* **An urgent client update** is a new release, with an Agent carrying the new catalog and that chain's pack. Follow the steps above; the Hub and telemetry steps follow the manifest as for any release.
* **Adding a chain later** — verify the current release's pack for that chain as in the first step, and load it with the mirror step's block up to its `done`: that delivery has no platform archive, so the block's own Agent check would stop. Then run the check with the Agent already installed — `/opt/nvcl/agent/bin/agent mirror-check --mirror <the Agents' [sources] mirror> --chains <chain>` — and create the nodes. The platform is untouched.
* **License renewal** is independent of releases: upload the new file — see [License](https://docs.novacula.io/recipes/self-hosted/license.md). No restart.
* **Snapshots** aren't part of the delivery. When you refresh one, change its `url` and `sha256` under `[[sources.snapshot]]` and restart the Agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.