Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (64 sloc) 3.53 KB
<link rel="stylesheet" type="text/css" href="style.css" />
<title>tor2web: how to run a proxy</title>
<body><div class="header">
<h1><a href="/">tor2web</a>: how to run a proxy</h1>
</div><div class="body">
<p>Want to set up a proxy of your own? Here's how! For simplicity, we'll assume you're running a recent version of Ubuntu, but the instructions should be easy to adapt to any other OS. (Don't have a server? You can get one using Amazon's EC2 with <a href="">Ubuntu AMIs</a>.)</p>
# Install the latest version of tor, with the tor2web flag
sudo apt-get install python-software-properties
sudo apt-add-repository
gpg --keyserver --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get install dpkg-dev autoconf
sudo apt-get build-dep tor
git clone git://
cd tor
curl | patch -p 1
echo "all:" > src/test/Makefile
echo "check:" >> src/test/Makefile
echo "install:" >> src/test/Makefile
DEB_BUILD_OPTIONS="enable-tor2web-mode" fakeroot debian/rules binary
cd ..
sudo dpkg -i tor_0.2.3.12-alpha-1_amd64.deb
# (this will return an error, ignore it)
sudo sh -c "echo Tor2webMode 1 >> /etc/tor/torrc"
sudo /etc/init.d/tor restart
# Install privoxy to translate normal web requests to SOCKS, which Tor speaks:
sudo apt-get install privoxy
sudo sh -c "curl <a href="/conf/privoxy-config"></a> > /etc/privoxy/config"
sudo /etc/init.d/privoxy restart
# Install Apache to serve web requests
sudo apt-get install apache2
sudo sh -c "curl <a href="/conf/apache2.conf"></a> > /etc/apache2/apache2.conf"
sudo sh -c "curl > /etc/apache2/"
sudo sh -c "curl > /etc/apache2/"
# Make the cache directory (edit apache2.conf if you want this somewhere else)
sudo mkdir /mnt/apache2-cache
sudo chown www-data /mnt/apache2-cache
sudo /etc/init.d/apache2 restart
<p>To debug, you can check the individual components to make sure they work:</p>
# Tor
curl -i --socks4a http://duskgytldkxiuqc6.onion/
# privoxy
curl -x http://duskgytldkxiuqc6.onion/
# Apache
curl -k -H "Pragma: none" -H "Host:" -i
# run again to see if it serves from cache:
curl -k -H "Pragma: none" -H "Host:" -i
<p>That's it!</p>
<p>Send your IP address to <a href=""></a> and ask to be added to the <code>*</code> round-robin. This will allow your server to respond to requests from the public for Tor hidden services. (We'll also send you the real SSL keys; the ones above are only for testing purposes.)</p>
<p>If you have trouble with the process or would like a different way of doing it, let me know. If you want to build scripts or tools to simplify this process, that would be great too. You might also be interested in <a href="">running a Tor relay</a>.</p>
<p><strong>See also:</strong> <a href="legal">Is this legal?</a></p>
<address><a href=""></a></address>
Something went wrong with that request. Please try again.