Skip to content

Upgrading Safely

Sam Bent edited this page Oct 19, 2026 · 13 revisions

Upgrading Safely

Moving to a new version of HiddenForge keeps your .onion address, as long as you keep your key folder. The upgrade never touches existing keys. Here's the safe way to do it.

Before you start

Back up your key folder if you haven't lately. An upgrade shouldn't lose it, but a backup costs nothing and the address is irreplaceable. See Backing Up Your Onion Address.

The upgrade

  1. Check what changed. Read the release notes / changelog for the new version, especially anything under "Security" or "Changed." Occasionally a new version changes a default worth knowing about.

  2. Pull the new image and verify it. Don't skip verification just because it's an upgrade. See Verifying the Image.

docker pull sambent.dev/sam/hiddenforge:<new-version>
  1. Update the tag in your docker-compose.yml if you pin a specific version (recommended over latest, so upgrades are a deliberate choice).

  2. Recreate the container:

docker compose up -d

Your key folder is a mounted volume, so the new container starts with the same keys and serves the same address. You should see the same .onion when you check:

docker compose exec tor cat /var/lib/tor/hidden_service/mysite/hostname
  1. Wait until it reports ready, then confirm the address loads in Tor Browser. Tor starts from scratch on every restart (its state is not kept), so allow from tens of seconds to a few minutes; hiddenforge status --container tor --keys ./tor-keys says when it is ready and, if not, why.

Why your address survives

On every start, HiddenForge creates the service folder only if it's missing and leaves any existing key exactly as it found it. It never regenerates or overwrites a key. So a new image with a newer Tor version reuses the key you already have. This is tested as part of each release: upgrading from the previous release and rolling back again both keep the same key and the same address.

Upgrading your backend

You don't need to touch the tor container when you upgrade or recreate your backend. Tor itself only accepts IP addresses, so HiddenForge looks the backend's name up at startup, then re-checks it every 30 seconds. When the backend comes back on a different internal IP, HiddenForge restarts itself to follow it, typically within a minute; your .onion doesn't change. The same happens if the backend was not up yet when HiddenForge started, as after a host reboot. This relies on the restart policy the shipped compose files set (restart: unless-stopped for Docker, always for Podman); keep it.

Rolling back

If a new version misbehaves, roll back by setting the image tag to the previous version and running docker compose up -d again. Because your keys are untouched, the older version comes back with the same address. This is another reason to pin an explicit version rather than latest: you always have a known-good tag to return to.

Clone this wiki locally