Repository navigation
Running Multiple Services
One HiddenForge container can host several independent .onion addresses at once: a public site, a private admin panel, a file drop, each with its own address and its own key. This page shows how.
Every environment variable ending in _TOR_SERVICE_HOSTS becomes its own hidden service, with its own .onion. Add more variables, get more services. Each one is independent: knowing one address tells an outsider nothing about the others.
Start from the shipped docker-compose.yml (see Quickstart) and
keep every setting on the tor service as it is. Change only its
environment and depends_on, and add one backend per site:
services:
tor:
# ...everything else exactly as shipped...
environment:
BLOG_TOR_SERVICE_HOSTS: "80:blog:80"
ADMIN_TOR_SERVICE_HOSTS: "80:admin:8080"
depends_on:
- blog
- admin
blog:
image: nginx:alpine
# ...the same hardening as the shipped `web` service...
networks:
- tor-internal
admin:
image: your-admin-app:latest
# ...the same hardening as the shipped `web` service...
networks:
- tor-internalRemove the shipped web service if nothing uses it any more.
You now have two .onion addresses, one per service folder:
docker compose exec tor cat /var/lib/tor/hidden_service/blog/hostname
docker compose exec tor cat /var/lib/tor/hidden_service/admin/hostnameThe folder name comes from the variable prefix, lowercased with underscores turned into hyphens. BLOG becomes blog, and MY_ADMIN would become my-admin.
You can also expose more than one port for a single service by separating mappings with commas:
WEB_TOR_SERVICE_HOSTS: "80:web:80,443:web:443"Both ports belong to the same .onion address.
Each mapping is onion_port:backend_name:backend_port. There is a two-part shorthand, onion_port:backend_port, but it points at 127.0.0.1 inside the tor container itself, which is only useful if your app runs in the same container. That is not the normal setup here. For the standard "separate backend container" layout, always use the three-part form with the backend's service name.
HiddenForge is forgiving about mistakes. A single bad mapping (an invalid port, a malformed entry) is skipped, and the rest of your services still come up. An invalid service name skips just that one variable. A backend name that doesn't resolve yet is skipped too, and added automatically once it resolves. The container keeps running either way. If a service is missing, hiddenforge status --json lists every skipped mapping and why under dropped_mappings (container logging is off by design, so the logs won't tell you).
Each backend you add should follow the same pattern as the example: on tor-internal only, no ports: mapping, read_only with small noexec,nosuid,nodev tmpfs mounts for anything it must write. A backend with a published port or an internet route is the one mistake that undoes the whole design. See OPSEC: Mistakes That Deanonymize You.
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