Tor Relay, an AWS experience - Corwin McKnight

Tor Relay, an AWS experience

I've always had a fascination with the Tor network. It has always seemed so cool, it's goal so noble. I'm actually a decently private person, and sometimes I'd prefer my traffic to be encrypted. However, running a proxy server on my local network is a bit difficult in my current situation. Running a Relay Server is a way I can help out the network.

I'm a big fan of Amazon Web Services. They host this site, and their rates have been very affordable. The price of bandwidth on AWS is cheap, and a Tor relay doesn't really need much of a CPU or Memory (though RAM does help). Since AWS has instances that'll be affordable with enough bandwidth, it's a decent choice to host a Tor Relay.

Initial Setup

Creating the instance

First, I logged onto the AWS portal. I went to EC2, and created a new T2.Micro Ubuntu instance. My rational for this is threefold:

  • Despite one VCPU, Tor will never fully load it, and therefore we can rely on burst performance.
  • RAM is good, but 1 GB is more then enough for Tor with the minimal overhead of Ubuntu Server.
  • The network performance is "Low to Moderate". What does that mean, I dunno. What I did discover is that it can transfer 1Gb/s Up and Down from experimental testing (North California), and that the system was holding up at minimum 500kbps.

Once the instance is setup, I used SSH to access it. First thing to do is always update the instance with apt update and apt upgrade.

Then, since it was an Ubuntu based VM, I added the repository to APT, and ran sudo apt install tor

Configuration

My Torrc had this in it:

Nickname [required]
ContactInfo [email, required]
ORPort 9001 # For onion routing, make sure sg is open on 9001!
ExitPolicy reject :*: # No exits allowed
ControlPort 9051 # For nyx
CookieAuthentication 1 # For nyx

RelayBandwidthRate 300 KBytes
RelayBandwidthBurst 500 KBytes

DirPort 9030 # Not nessisary, just wanted to run a Directory Service.

AccountingMax 50 GBytes # 50GB a month. Disables DirPort!
AccountingStart month 3 15:00

Traffic

By day 3, I was receiving traffic around 300kbps, and by day 5, about 500KB/s. Most of the time, I received low amounts of traffic, but I would get larger and larger spikes until I started consistantly getting 2.5MB/s of traffic.

Costs

On average, for the server and bandwidth, I paid about $30 a month to host this server on AWS. This is actually cheaper then I expected, and most costs went to bandwidth, not CPU time.

Will I Keep hosting?

Yes, I will. I believe that access to a free and open internet without prying eyes is a good thing, and it's fun to administer the server.

© Corwin McKnight 2023