Repository navigation
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.
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.
From any 2.1.x release nothing else is needed: pull the new image and recreate the container with the same compose file, the same key folder and the same *_TOR_SERVICE_HOSTS lines. The address stays the same. Upgrading a 2.1.6 volume to 3.0.0 and rolling it back were both tested with the same key.
What changed is inside the image: it has no shell and no Python. Commands 2.x ran inside the container (the healthcheck, cat of the hostname, su-exec tor ..., hiddenforge ...) still answer in the forms 2.x used. Anything else, such as docker exec <container> sh, is refused with a message pointing to hiddenforge <command>. Use hiddenforge status, doctor and show instead. The 3.0 options (setup --no-root, setup --encrypt-keys, client-auth, full vanguards) are all off until you turn them on. See The hiddenforge CLI. If you are on 2.0.4, read the README's section on upgrading from 2.0.4 first.
-
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.
-
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>-
Update the tag in your
docker-compose.ymlif you pin a specific version (recommended overlatest, so upgrades are a deliberate choice). -
Recreate the container:
docker compose up -dYour 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:
hiddenforge show --keys ./tor-keys --name mysite-
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-keyssays when it is ready and, if not, why.
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.
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, and the address answers again after the usual restart time; 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.
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.
Sealed keys cannot be rolled back as they are. If you turned on key encryption at rest (setup --encrypt-keys), 2.1.6 cannot read the sealed key. Before rolling back, stop the service and turn encryption off:
hiddenforge unseal-keys --keys ./tor-keys --name myapp --passphrase-file ./key-passphrase.txtunseal-keys puts the plaintext key back, checks it matches the sealed one, and only then removes the sealed copy. Remove HIDDENFORGE_KEY_PASSPHRASE_FILE and the passphrase secret from the compose file as well, or a 3.0 start would seal the key again.
Start here
Older releases
Going deeper
- The Security Model
- Verifying the Image
- Reproducing the Build
- The hiddenforge CLI
- Rootless Podman
- Backing Up Your Onion Address
- Upgrading Safely
- Running Multiple Services
Help