Home / Guides / Run a Tor onion service on a VPS
Guide

Tor onion service on a VPS.

An onion service gives your site a .onion address reachable only over Tor, with no public IP exposed.

Why use one

  • Reach a service without exposing the server's IP in DNS.
  • Put admin panels behind Tor so they are not reachable from the open internet.
  • Offer your site to people who browse over Tor.

Install Tor and a web server

apt update && apt install -y tor nginx

Bind the web server to localhost

Make nginx listen only on 127.0.0.1:8080 so the site is not directly reachable from the internet.

# /etc/nginx/conf.d/onion.conf
server { listen 127.0.0.1:8080; root /var/www/html; }

Configure the hidden service

The hostname file contains your .onion address. Back up the key files in the same directory. Whoever holds them controls the address.

# /etc/tor/torrc
HiddenServiceDir /var/lib/tor/my_site/
HiddenServicePort 80 127.0.0.1:8080

systemctl restart tor
cat /var/lib/tor/my_site/hostname

Test it

Open the address in Tor Browser. If it loads, the service is live.

Stay private

  • Do not serve content that mentions your clearnet IP.
  • Keep software patched. See the hardening checklist.
  • Remember the host can still see that the VPS exists. An onion service hides the address, not the server from its provider.
AnonVPS also offers a managed onion service as an add-on in the configurator.

Operational notes

  • An onion service hides the server's network location from visitors, not what the site publishes.
  • Keep the hidden service directory private and back up the keys.
  • Do not run the same site on a clearnet address with identifying details.
FAQ

Common questions

Do I need a public IP for an onion service?

The server has one, but visitors reach it through Tor without learning it.

Which plan is enough?

BASE handles a small site. Larger traffic needs more.

Is hosting an onion service allowed?

Yes, within the acceptable use policy.

Keep reading

Related pages

VPS hardening checklist: secure a new Linux server in 15 minutes

A practical checklist for a new Linux VPS: SSH keys, a non-root user, firewall, automatic updates and backups, with the commands.

Read more →

Your own VPN,

Why and how to host a personal VPN on a VPS: what it protects, what it does not, which plan to pick and a minimal WireGuard setup.

Read more →

Host your own

Host your own apps on a private VPS: what size to choose for common self-hosted services, backups, updates and where to start.

Read more →

Privacy architecture

How AnonVPS is built to keep your data small: access-key sign-in, optional contact, RAM-only plans, encrypted storage and an honest threat model.

Read more →

Put it into practice on a VPS.

Open the configurator