How one can help Tor anonymity network by setting up relay on his/her server?

First, the relay should be a server hosted in professional datacenter or the computer with high bandwidth stable internet and public IPv4.

How to setup Tor relay on Debian Linux:

wget https://raw.githubusercontent.com/d0xkb/debian/master/scripts/tor.sh
sed -i "s|[email protected]|YourEmailVisibleToPublicHere|g" tor.sh
sed -i "s|d0xkb|PublicNameOfTheRelayHere|g" tor.sh
sh tor.sh;systemctl restart [email protected]

How to setup Tor relay on CentOS Linux:

Edit highlighted phrases and then copy & paste whole block of code to the command line and enter.

yum install epel-release -y;yum clean all;yum install tor -y;systemctl stop tor;chkconfig tor on;mv /etc/tor/torrc /etc/tor/torrc.bak;
cat > /etc/tor/torrc <<EOF
Nickname myNiceRelay
ORPort 9001
SocksPort 0
ExitRelay 0
# Change the email address bellow and be aware that it will be published
ContactInfo [email protected]
EOF
systemctl enable tor;systemctl start tor;
done

===========
After a few hours or one day, you should be able to see your server on tor relays index here and here


To limit data transfer of the Tor relay, one can add following into /etc/tor/torcc file and restart tor:
RelayBandwidthRate 1 MB
RelayBandwidthBurst 2 MB
AccountingStart month 1 00:00
AccountingMax 100 GB

Official documentation for Tor relay setup here: https://trac.torproject.org/projects/tor/wiki/TorRelayGuide