Hosting your own hidden onion service
Running your own service in Tor under a Debian based operating system is easy:
-
Install tor:
sudo apt-get install tor
-
You’ll need a webserver already. I assume, you are running apache.
-
Configure your onion service in
/etc/tor/torrc
:HiddenServiceDir /var/lib/tor/hidden_service_myname/ HiddenServicePort 80 127.0.0.1:80
Replace
myname
with your choice. Any request on port 80 on your hidden service will then be redirected to port 80 on localhost - that’s where your apache webserver is running. -
Restart tor service:
sudo systemctl restart tor.service
-
Check out your hostname of the hidden service:
sudo cat /var/lib/tor/hidden_service_myname/hostname
. You’ll see a hostname ending in “.onion”. Remember this - this is your onion hostname. -
Configure your webserver, add a name-based virtual host:
<VirtualHost *:80> ServerName xyzyourhiddenservicehostnamexyz.onion DocumentRoot /srv/www/myname/htdocs </VirtualHost>
-
Restart your webserver
-
Try it out with the tor browser.
That way, I made this homepage also available as t2irhp5ym2ioy7jivr7oomg2gt2y3mbmtshenveh7eymp7ho3l3hvhyd.onion.
One note: the hostname depends on the generated public/private key pair that
tor generated for your onion service.
These keys are available in the “HiddenServiceDir” (e.g. /var/lib/tor/hidden_service_myname/
). If you want to keep your address,
you better make sure, to backup this directory.
More detailed information can be found on Configuring Onion Services for Tor.
Comments
No comments yet.Leave a comment
Your email address will not be published. Required fields are marked *. All comments are held for moderation to avoid spam and abuse.