How to create your own Tor hidden service 

on Debian/Ubuntu with nginx

Andrew Phillips
Jan 14, 2014 · 2 min read

One of the features of Tor is the ability to create hidden services. A hidden service is basically a server running solely on the Tor network — meaning it never exists on the ‘public’ internet — you can only connect to a hidden service using the Tor network. All Tor hidden services have the pseudo TLD .onion.

A hidden service then, does not have an ‘exit node’ (a computer whose IP Address would be listed in the server log files). Any log files on the hidden service would just reveal connection from itself, the localhost.

This is how to create a Tor hidden service using Debian and nginx.

I’m using Debian 7.3 Wheezy for the setup below.


Step 1.

Add the nginx and tor repositories to your apt sources list.

Open up the file /etc/apt/sources.list and append the following lines:

Step 2.

Import the gpg signing keys by running the following commands:

Step 3.

Update sources and install nginx and Tor

Step 4.

Configure nginx

Open the file /etc/nginx/conf.d/default.conf and replace with the following:

Create the folder /var/www/. This will be your web root.

Step 5.

Configure Tor

Open the file /etc/tor/torrc and add the following lines:

Create the HiddenServiceDirectory and give it permissions:

Step 6.

Restart Tor and nginx.

Step 7.

Fetch your new hostname and connect to your website.

In the file /var/lib/tor/hidden_service/hostname you will find your new .onion URL

Connect to the Tor network and access your new hidden service!

    Andrew Phillips

    Written by