Home » Articles » How to Host a Tor Relay Successfully?
Click Here To Hide Tor

How to Host a Tor Relay Successfully?

Hello everyone. My name is Dave, and today I will be teaching you on how to successfully host your own Tor relay on a Ubuntu 14.04 x64 VPS. The general method should be the same across most major Linux distros as well.

I have noticed a distinct lack of simple and clear tutorials on how to do this, so I am hoping that this will be the first mainstream one available.

The first thing you are going to want to do is run “sudo apt-get update && sudo apt-get upgrade” and accept all of the updates to the packages. This just makes sure we have the most up to date software for your systems security.

2LWOauG[1]

After this is completed, you are going to want to edit the /etc/apt/sources.list with your favourite editor, and add the following lines.

After you have added those two lines into the sources list, copy, paste, and run the following two lines separately as two different commands. It’s very important that you copy and paste each line correctly.

Once you have ran those two commands, run one more apt-get update && apt-get upgrade command, and then finally, we are ready to install the latest stable version of Tor!

Tor is now installed, and we are ready to get down and dirty with configuring and starting your Tor node. Make sure that Tor is not running before we begin to make any changes to the torrc file, or the changes will not take place. To do this, make sure you run the following command.

Once that is done, we can use our favourite editor to edit the magic file known as “torrc”, located in the /etc/tor/ folder on our VPS. This file contains all of the options to run Tor as a hidden service, as a bridge, and for today’s tutorial, a Tor relay.

We want to scroll down in this file until we see the information stating that the section is just for Tor relays. It will look something like this.

4kdKUk1[1]

It is also worth noting that I will be going down the list of configuration options out of order, since some of the options are not really needed for this tutorial.

The picture is just the first few settings in the options for our Tor relay, but don’t get overwhelmed. It’s really simple when you take your time and read through it.

The first setting we will be dealing with is the “ORPort”. This is the port that will accept connections from clients so they can use the Tor network. It is a required option, and the default selection of 9001 is the optimal way to run it. Remove the octothorpe(that is the # sign) from the front of it to make it active. The rest of the options under it can be ignored, as they are used for specific configurations.

tJGTxF6[1]

The second setting we will be dealing with is the “Nickname” setting. This is only a name for the relay you are making for you to keep track of it, and for other people to know who runs it. It can be anything you want.

4HMohZX[1]

The next two settings we will be relating to your bandwidth. These are very important to set correctly, otherwise you may end up in trouble with your hosting provider. Be sure you know your limits before setting up a Tor relay in the first place.

RelayBandwidthRate is the base line of how much bandwidth you want to allow people to use off of your relay. RelayBandwidthBurst is how much bandwidth you want to allow in one quick burst to and from a client. This does not cap the bandwidth you use outside of the Tor applications on your VPS. The default settings for both of these are usually fine. You can adjust them up or down as you need or want though.

4fdUtWp[1]

AccountingMax is the total amount of data you want to be sent in a given period of time. This could be 10 gigabytes of data in a 24 hour period, for example. AccountingStart is when that period of time starts for your relay. In the example below, I will set it so that only 10 gigabytes of data can be sent in a 24 hour period. Again, this can be set up or down to your wants or needs.

4CcGo5r[1]

The next setting is your contact information. This can be as simple as an email address, or as advanced as your PGP key, but using an email address is absolutely recommended to get you on the Tor mailing list. Usually, people put there email address, followed by their BitCoin address just in case someone wants to donate BitCoins to that relay, as shown in the example below.

PWHBTf0[1]

The final option is an important option. It is the decision as to if you want to be an exit node or not. Being an exit node is important to the Tor network, as it is where encrypted Tor traffic gets into the internet. For more information, click here.

You don’t hurt the Tor network by not being an exit node at all, so it is no worry if you want do not want to be. Just uncomment the last ExitPolicy option I did in the picture. If you do want to be an exit node, leave all of them commented just like they are.

1unQhB5[1]

Once you make sure everything is to your liking, start up Tor again with the command below, viola! You are running your own Tor relay, heloing users around the world have safer and more anonymous internet!

A few things to keep in mind that are not really listed in any help file before we end the tutorial. One, is that your relay may not be listed for a few hours on sites like Globe or Atlas. It takes a bit. Don’t go restarting your VPS or anything.

The second thing is that your bandwidth is going to be really screwy for awhile. It will jump up, it will go down to nothing, it will even out, and even sometimes go COMPLETELY INSANE like it did for me the first time I ran a Tor node. It’s entirely natural, and I recommend you take a look at this article for more reading on what to expect.

Another thing is that there is a community established that is ready to help you if you have any trouble at all. Stackexchange is a website dedicated to people who are having problems with a wide array of subjects, and Tor is one of them! It can be accessed at this link, 24 hours a day, 7 days a week, 365 days a year.

The last thing I can think of is that logs are your friend. If there is anything going wrong with your relay, it will be located in the log files at /var/log/tor. Read them, find out where the problem is, and fix it. If you need some help, use the Stackexchange link above
Well, this about covers the tutorial on how to host your own Tor relay. If you have any questions, feel free to ask them in the comments below.

Thank you all so much, and thank you for your interest in helping the Tor community.

This tutorial is by Dave, who can be reached at [email protected]

5 comments

  1. Michelina Groner

    if you are not running a web server on the host, it’s generally recommended that you move ORPort to 443 or 80 to support Tor clients behind restrictive firewall policies. 9001 is the default, but 80 or 443 are better if you can run them instead.

  2. Professor Falken

    Joshua, please use port 80 for your global thermonuclear war. 9001 is a pain for those of us buying LSD at Starbucks using the WOPR.

  3. Awesome.. Thanks I donated a Relay to tor from my server. Thank you..

  4. Hi, nice and easy to follow tutorial.
    For anyone who is overwhelmed by Linux and Tor configuration stuff I made this little tool a while ago: https://tor-relay.co/.
    It’s an online Tor Node Configurator.
    You just punch in the name of your relay and some other information and it generates an install script for your Tor relay.

  5. Hello folks,
    It would be nice if there was a purely text tutorial that went into some detail about each line in the tor config file. I happen to be blind and most of the tutorials have lots of picture examples. guess what that does for folks like me? It leaves us asking questions (that would appear on the surface to be stupid). In fact, it would help greatly is there were a man page like document (minus some of those highlighted areas that can confuse a screen reader package). Further, it might not hurt to have full comments in the config file itself (this used to be the norm back when CLI was the defacto interface for the general computer user).

    so, it would really help us blind users and administrators out if you would also publish a concurrent text ony tutorial.

    thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Captcha: *