How to Host a Tor Onion Service in 2026 (Step-by-Step) How to Host a Tor Onion Service in 2026 (Step-by-Step) — Privacy & Freedom article on LaunchPad Host PRIVACY & FREEDOM How to Host a Tor Onion Service in 2026 (Step-by-Step) LaunchPad Host 14 min read
How to Host a Tor Onion Service in 2026 (Step-by-Step) — Privacy & Freedom guide on LaunchPad Host

How to Host a Tor Onion Service in 2026 (Step-by-Step)

MO
By Marcus Okafor · Security & Abuse Desk
Published April 18, 2026 · Updated April 19, 2026 · 14 min read

Key Takeaways

  • A Tor onion service hides the server's location, not just the visitor's. Both ends are anonymous.
  • v3 onion addresses are 56 characters and use ed25519 keys — v2 is deprecated and should not be used.
  • The hardest part isn't configuring tor — it's making sure your web server doesn't leak identifying info.
  • Bind your web server to 127.0.0.1 only. If it's also reachable on public IP, correlation attacks become trivial.
  • The Tor Project documentation is the canonical reference — read it.
  • Adding an Onion-Location header to your clearnet site lets Tor Browser auto-promote the .onion.

What an Onion Service Is (and Isn't)

An onion service (formerly "hidden service") lets you run a website reachable only through the Tor network. Visitors reach you via a .onion address that doesn't require DNS, doesn't require a TLS certificate from a public CA, and doesn't reveal the server's IP address.

What it is:

What it isn't:

Step 1: Install the tor Daemon

On Debian/Ubuntu, the distro package is usually too old. Use the official Tor Project apt repo:

# Add Tor Project signing key and repo, then:
sudo apt update
sudo apt install tor deb.torproject.org-keyring

On RHEL/Alma/Rocky:

sudo dnf install epel-release
sudo dnf install tor

Verify:

tor --version
# Tor 0.4.8.x (or newer)

Step 2: Configure the Hidden Service

Edit /etc/tor/torrc and add:

HiddenServiceDir /var/lib/tor/mysite/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceVersion 3

Meaning:

Don't bind your web server on 0.0.0.0:8080 — only 127.0.0.1:8080. We'll reinforce why in Step 4.

Tired of slow, overcrowded shared hosting?

LaunchPad Host runs on NVMe SSDs + LiteSpeed with free migration, free SSL, daily backups, and crypto payments. 30-day money-back guarantee.

See Hosting Plans

Step 3: Start tor and Read Your Onion Address

sudo systemctl restart tor
sudo cat /var/lib/tor/mysite/hostname
# somethingsomething56chars.onion

That's your address. It's derived from the ed25519 keypair in the same directory (hs_ed25519_secret_key). Back up that keypair — if you lose it, you lose the address forever.

Test with Tor Browser or torsocks curl http://yourfulladdress.onion/.

Step 4: Harden the Origin

This is where most deployments leak. Rules:

  1. Bind to 127.0.0.1 only. In nginx: listen 127.0.0.1:8080;. In Apache: Listen 127.0.0.1:8080. If the site is also reachable on your public IP, an attacker can compare response fingerprints and de-anonymize you.
  2. Strip server version headers. nginx: server_tokens off;. Apache: ServerTokens Prod + ServerSignature Off.
  3. Kill access logs that store IPs. Over Tor, the visible client IP is always 127.0.0.1 anyway — but don't log X-Forwarded-For headers if anything upstream might set them.
  4. Disable ETags and default error pages that could reveal inode numbers or OS specifics.
  5. Don't run anything else on the same IP that's reachable on clearnet. Mail server, SSH, another website — each is a correlation vector.
  6. Firewall outbound if possible. A compromised web app that phones home over clearnet will leak your real IP.

For high-threat-model deployments, run the onion service on a dedicated VM with no public IP at all — only the tor daemon reaches the outside world.

Step 5: Add Onion-Location (Optional)

If you also run the site on a regular clearnet domain, add this header:

Onion-Location: http://yourfulladdress.onion$request_uri

Tor Browser sees this and prompts visitors to switch to the onion version. This is the modern standard — The New York Times, BBC, ProPublica, and many others use it.

nginx snippet:

add_header Onion-Location http://yourfulladdress.onion$request_uri always;

Operational Notes

A few things that will save you pain later:

Want us to host it for you? Our VPS plans allow onion services by default, and we'll help with the hardening review.

Frequently Asked Questions

No — any Linux VPS where you can install tor will work. Shared hosting usually can't because you can't install daemons. We allow it on our VPS plans; some hosts prohibit it in their AUP, so check first.

In most jurisdictions, yes. Running the service is not the same as running a Tor exit relay (which has a different legal profile). What you publish on the onion service is subject to normal content law.

Use <a href="https://github.com/cathugger/mkp224o" target="_blank" rel="noopener">mkp224o</a> to brute-force ed25519 keypairs until the address starts with your chosen prefix. 6–8 character prefixes are feasible on a laptop; longer needs a GPU.

No — the onion protocol already provides end-to-end encryption and authentication by the address itself. Some sites add TLS anyway for defense-in-depth and to support legacy clients, using DigiCert's .onion EV certificates. For most sites, plain HTTP over onion is fine.

No. The Tor protocol is designed so neither end knows the other's IP. A bug in your application could leak through (e.g., loading a resource from a clearnet domain), but the transport itself doesn't.

Slower than clearnet — typically 200–600ms added latency from Tor's 6-hop circuit (3 hops each side). For text content it's fine; for video streaming it's rough. Keep assets small and cacheable.

Yes, but be careful with plugins that make external requests or assume a specific hostname. Hard-code <code>WP_HOME</code> and <code>WP_SITEURL</code> to the .onion address, disable auto-updates (they'll fail without clearnet), and review plugins for anything that phones home.

Ready for hosting that just works?

NVMe + LiteSpeed hosting with free migration, crypto payments accepted, and a 30-day money-back guarantee.

See Hosting Plans
Tags: Tor onion service hidden service privacy self-hosting

Related tools, articles & authoritative sources

Hand-picked internal pages and external references from sources Google itself considers authoritative on this topic.

Related free tools

Offshore & privacy hosting

Related premium tools