Tor Project - Hidden Service

Create a Tor Website on Ubuntu

This article will show you how to create a Tor Hidden Service website on Ubuntu Linux.

This is in no way an exhaustive set up procedure and we highly encourage you to read Tor best practices. With that said though, if you follow the instructions below, by the end of this article you will have yourself a fully working Hidden Service website on the Tor network.

Throughout this article I use apt in place of apt-get . It should work with Ubuntu, if not use apt-get in place of apt

Meanwhile, If you’ve got any suggestions or feedback for this article then please message me here.

Install Nginx:

Type: sudo apt install nginx
Type: sudo nano /etc/nginx/sites-available/default

Replace the entire contents of the file with the code block below.

Save and exit by pressing CTRL+X , Y and ENTER.

Install Tor:

Type: lsb_release -a

Note down your Linux release version and codename.

Then visit this link and select your Linux version and codename from the drop down menu.

Follow the instructions on that page, then continue here.

Type: sudo nano /etc/tor/torrc

Look for the following two lines of code and uncomment them, then change “127.0.0.1:80” to “127.0.0.1:8080”.

After making those changes, the two lines should now look like this:

Save the file by pressing CTRL+X, Y then ENTER.

Type: sudo service nginx restart
Type: sudo service tor restart
Type: sudo nano /var/lib/tor/hidden_service/hostname

Copy your .onion hostname and try it out in your Tor Browser.

Your websites html files can be found in /usr/share/nginx/html

As a final note, I strongly advise you to read Tor Hidden (Onion) Services Best Practices.