Since we live troubled times with regards to freedom of expression, I thought of sharing a simple configuration file in helping others who might want to donate to Tor Project some bandwidth from their servers. Others might have idling servers around (like me), therefore I believe they might want to put them to good use too, until some project comes up to occupy that server and no longer consider it as idling.
Anyway here are some basic settings for /etc/tor/torrc file. I use Debian latest version (13 Trixie at the moment) with the latest version compatible of Tor.
RunAsDaemon 1
ExitPolicy reject *:*
ORPort 9001
DirPort 9030
Address server-ipv4-address
ORPort [server-ipv6-address]:9001
Nickname SomeNickName
RelayBandwidthRate 30 MB
RelayBandwidthBurst 60 MB
# AccountingMax 4 TB
# AccountingStart month 1 00:00
ContactInfo JohnDoe <johndoe@proxiedmail.com>
Let's explain what this does:
RunAsDaemon 1 sets Tor to run as daemon controlled by services.
ExitPolicy reject *:* sets the server as relay. Setting this line is highly important if you do not wish to make your server an Exit node. (If however you want an Exit node please read the provider policies carefully and make sure to get their consent in a support ticket, then follow the recommendations of Tor Project.)
ORPort 9001 designates the port for incoming connections on Tor Relay. The default is 9001.
DirPort 9030 designates the port for directory services communication within Tor Relay. This is not always necessary, but it helps with server's discovery and public visibility.
Address server-ipv4-address This is optional, however helpful if the server has multiple IPv4 addresses; you may choose which IPv4 address to use. Replace the text "server-ipv4-address" with the IPv4 address of your server.
ORPort [server-ipv6-address]:9001 specifies the IPv6 address to be used. Tor Relay can not work without IPv4, therefore IPv6 is optional, however nowadays many servers come with IPv6 connectivity and it would be sad not to use that too.
RelayBandwidthRate 30 MB sets the bandwidth to be donated. In this case I wish to donate 30 megabytes (not megabits) per second.
RelayBandwidthBurst 60 MB sets the bandwidth to be donated as burst, in case Tor needs it. Please note this is taken into account as an average along with RelayBandwidthRate.
AccountingMax 4 TB sets the maximum monthly bandwidth allowed for Tor to use. If the relay server reaches this limit, it will no longer transmit any data. Please check your server's details for the maximum bandwidth allowed by provider, and set this value lesser than that. This way you may avoid possible fees for extra monthly bandwidth used, or the suspension of your server.
AccountingStart month 1 00:00 sets the day of month (in my case 1) and the time (in my case 00:00) when the month resets. Please consult your provider's terms on when the server's bandwidth gets reset, or you may simply choose a day of your liking.
Nickname SomeNickName - replace "somenickname" with a nickname for your server. This is set to identify it in Tor metrics database.
ContactInfo JohnDoe <johndoe@proxiedmail.com> needs to be set so that Tor may know who is operating a server. In my case I use ProxiedMail provider because it is a simple and cheap mail forwarder, so that I don't have to expose my real email address. No advertising is intended, so feel free to choose whatever email provide you like. Please note that such information is public online, and you will receive a lot of spam. Do not use your real information, and especially don't expose your real email address.
As a side note, some system administrators prefer to disable RelayBandwidthRate and RelayBandwidthBurst, in favour of AccountingMax and AccountingStart, so that they may provide more bandwidth from their month, within a shorter period of time. Feel free to adjust settings as you see fit - in my case I disabled accounting (lines are commented) because my server comes with unlimited bandwidth in this case.
I hope this guide helps others donate their bandwidth to Tor Project. In troubled times I believe we need freedom of speech and anonymity online.