This is a slightly spartan, though step-by-step, set of instructions for installing the software and setting up a Linux Team Fortress 2 server. This dedicated server software is free.

You'll need a system with at least 2.8 gigabytes free on its /home/ partition - I'd have even more (if you want to add all the optional maps, allow _at least_ 15GB more). To check, run:

df -h /home/

To give the server higher CPU priority - which _may_ make it be a little more responsive on a heavily loaded system - run this as root after you've started the server:

renice -4 `/sbin/pidof srcds_i486` `ps axf | grep srcds_run | grep -v grep | awk '{print $1}'`

Ports needed:

tcp        0      0 127.0.0.1:27015         0.0.0.0:*               LISTEN     22685/srcds_i486    
udp        0      0 0.0.0.0:27015           0.0.0.0:*                          22685/srcds_i486    
udp        0      0 0.0.0.0:27020           0.0.0.0:*                          22685/srcds_i486    
udp        0      0 0.0.0.0:26901           0.0.0.0:*                          22685/srcds_i486    
udp        0      0 0.0.0.0:27005           0.0.0.0:*                          22685/srcds_i486    

Not sure if all of these are needed. Replace $OutsideIP with your outside IP address, eth0 with the outside nic name, and 172.27.1.178 with the TF2 internal ip address:

#for OnePort in 27015 27020 26901 27005 ; do
for OnePort in 27015 ; do
    iptables -A PREROUTING -t nat -p udp -d $OutsideIP --dport $OnePort -j DNAT --to 172.27.1.178:$OnePort
done

#for OnePort in 27015 27020 26901 27005 ; do
for OnePort in 27015 ; do
    iptables -I FORWARD -i eth0 -m state --state new -d 172.27.1.178 -p udp --dport $OnePort -j ACCEPT
done

faq gameinfo.txt documentation