I’ve previously gone over setting up tor to be able to access hidden services. This time I thought it would be cool to host a hidden service of my own.
Now obviously the point of hidden services is to publish sites anonymously, but since I’ll just be serving my personal site I’m not too concerned with anonymity.
Setting Up the Hidden Service
Start by installing tor (obviously). It should be available via your local package manager.
$ sudo apt install tor
Next, edit the configuration file
$ sudo vim /etc/tor/torrc
Uncomment the line that reads
as well as the line that reads
Jump down to the section labeled
############### This section is just for location-hidden services ###
Uncomment the two lines
HiddenServiceDir /var/lib/tor/hidden_service/ HiddenServicePort 80 127.0.0.1:80
Start the tor daemon
$ sudo systemctl start tor $ sudo systemctl enable tor
To see your generated .onion address, run
$ sudo cat /var/lib/tor/hidden_service/hostname
Edit your web server configuration. I’m using Apache in this case. Locate the site configuration in use, found in
/etc/apache2/sites-available/and add the line
ServerAlias <your generated address>.onion
directly under where the ServerName is specified.
Finally, restart Apache
$ sudo systemctl restart apache2
Word, the hidden service should be live. You can use the tor-browser to check this one out: 6l4nq4v7nqffriew.onion