In this tutorial I will show you how to run a tor middle relay inside a VPS.

  1. Get a VPS from any service providers.

  2. Launch a Linux machine.

  3. Get tor from the default package manager

# Ubuntu
$ apt-get install tor
# Arch
$ pacman -S tor

Or you can compile tor from source.

  1. Edit the /etc/tor/torrc file using $EDITOR.

  2. Add the following lines to that file.

Nickname    myNiceRelay  # Change "myNiceRelay" to something you like
ContactInfo mail@example.com # Write your e-mail and be aware it will be published
ORPort      443          # You might use a different port, should you want to
ExitRelay   0               
SocksPort   0
RelayBandwidthRate 100 KBytes  # Throttle traffic to 100KB/s (800Kbps)
RelayBandwidthBurst 200 KBytes # But allow bursts up to 200KB (1600Kb)
  1. Restart the tor service by running
    systemctl restart tor@default

Now you are all set as a relay operator! :)

You can monitor the live traffic using nyx command line tool.

# On Ubuntu
$ apt-get install nyx
# On Arch
$ pacman -S nyx

nyx ui

More info

lifecycle-of-a-new-relay