For the most in-depth resource on running a relay, see the Tor Relay Guide.

  • Run "pkg install tor" (as root).
  • Make sure your clock, date, and timezone are set correctly. Enabling ntpd is suggested.
  • Edit /usr/local/etc/tor/torrc to look like the following:
## Set the nickname of this relay
Nickname ididnteditheconfig

## Set your own contact info
ContactInfo 0xFFFFFFFF Random Person <nobody AT example dot com>

ORPort 9001
DirPort 9030

## Set your bandwidth rate (leave commented and Tor will run without bandwidth caps)
#RelayBandwidthRate 30 MBytes
#RelayBandwidthBurst 100 MBytes

ExitPolicy reject *:*

## If you control multiple relays, include them in the family
#MyFamily $keyid,$keyid,...

RunAsDaemon 1
Log notice file /var/log/tor/notices.log
  • Make sure tor starts on boot by running "sysrc tor_enable=YES" (as root)
  • Run "service tor start" (as root)
  • After your relay connects to the network, it will try to determine whether the ports you configured are reachable from the outside. This step is usually fast, but it may take a few minutes. Look for a log entry in /var/log/tor/notices.log such as "Self-testing indicates your ORPort is reachable from the outside. Excellent." If you don't see this message, it means that your relay is not reachable from the outside. You should re-check your firewalls, check that the IP and ports you specified in your torrc are correct, etc.
  • When it confirms that it's reachable, it will upload a "server descriptor" to the directory authorities to let clients know what address, ports, keys, etc your relay is using. After a few hours (to give it enough time to propagate), you can query Metrics to see whether your relay has successfully registered in the network. If it hasn't, re-check firewalls, IP and ports again.