Monthly Archives: December 2015

Raspberry Pi as tor2web service running apache


In this article I will describe how to set up a Raspberry Pi, install tor and access it using tor2web.

Start by installing RASPBIAN JESSIE LITE (Minimal image based on Debian Jessie) from the raspberry pi web . I will be using this version:

Version:November 2015
Release date:2015-11-21
Kernel version:4.1

I will walk you through everything until you have a raspberry pi online with a hidden tor2web url that you can access from anywhere.

1 – Change root password
The default password is “raspberry” and user is “pi”. Make sure you change this.

2 – Updating the Pi
Once you have connected the Pi to the network make sure you update it.

apt-get update -y; apt-get upgrade -y

3 – Installing apache2

I will refer to Raspberry Pi documentation for how to install apache.
We will also configure it to only listen on localhost, as we do not need it to listen on the public interface, we will only have ssh there. This is also they way tor hidden services work, but more on that later!

This is optional. Install php, mysql and php-pdo

4 – Configure apache
We only want it to listen on localhost because we want to use it on tor. So let’s change that. Modify the file /etc/apache2/ports.conf so that it looks like this. Make sure the line is changed from “Listen 80” to “Listen”.

5 – Installing tor

6 – Configure tor
We will now create the directories and configure the hidden service. If you want to read more check the reference documentation here

Edit the file /etc/tor/torrc

Time to start, “service tor start”

Your hostname will now be visible in this file:

Your website will now be available by accessing a url such as

Replace the x’s with your hostname found in the hostname file. This works because of the “.to” that is added to the onion domain. More information here

To make tor start on boot, enter the following command

References and additional reading