Yes, it's not uncommon for people run two relays on a single server in cases where bandwidth isn't the bottleneck, to take advantage of two CPU cores (since much of Tor's functionality is locked to a single core, running two can increase throughput).
If you're not currently using up an entire CPU core for just one Tor instance, then it may not be worthwhile for you to do this. One faster relay is probably more helpful than two slower ones on the same IP.
Under the Tor project packages, for systems that use systemd (most modern Linux distributions), there is a tool distributed with it called tor-instance-create
which can create multiple Tor instances. If this is available, the process will be much more simple.
tor-instance-create second # replace "second" with whatever you want the instance to be called
This will create a new systemd service entry, a new /etc/tor/instances/second/
folder that contains the torrc for the second instance and a new /var/lib/tor-instances/second
for use as the DataDirectory
.
Edit the torrc, ensure that you use different ports for each relay, to avoid conflicts then run the commands
systemctl enable tor@second
systemctl start tor@second
You should now have the second Tor instance providing a relay.
You should, as a courtesy, set the MyFamily
lines in each to include each others fingerprints (they don't need their own, they just both need to have the relay fingerprint for the other). You can find their fingerprints under /var/lib/tor/fingerprint
and /var/lib/tor-instances/second/fingerprint
respectively.
If you're not using a Debian derived Linux distro then you'll need to set this up manually, you'll need to look at whatever system daemon management software it's using and create a new entry for the second relay.
The important points for setting it up are:
- They both need to use different
DataDirectory
folders, otherwise they will conflict and cause problems.
- They both need to use different ports, for all services (you may need to specify
SocksPort 0
on the second's torrc, to avoid it trying to use the default of 9050).
- Setup
MyFamily
using the fingerprint found in the fingerprint
file in the Tor instances DataDirectory
, each relay should contain the fingerprint for the other relay (although it doesn't hurt to add it's own too).
Other than those points, you should be fine.