My first blog in ages, and possibly my most uninteresting I’ve ever posted (for almost anyone), however, I’m hoping they’ll be a niche that will find this post useful. After discussing with someone on the Steam Official Forums how not straight forward it is to set up a Team Fortress 2 listen server for public play, and how there are no instructions on the internet, I’ve decided to put together this guide.
Step One - Consider your bandwidth
A TF2 server needs to kick out around 6 - 10 KBps to each client playing on that server. This means that if you have a 256kbps upload (common in the UK) you’re only going to be able to host 3/4 players max, before it starts getting seriously uncomfortable. If you want to host for more than this, you might want to consider a gaming host - I would recommend Gibsworld.
Step Two - Configuring your router
So you’ve decided you still want to go ahead? Maybe you just want to farm some achievements with a few friends? To play behind a router, you need to forward the appropriate ports to your PC. How to do this type of port forwarding is extensively covered on many websites all over the internet, so I won’t go into it here. I can tell you though, you’ll need to forward UDP 27015.
Step Three - Running the server
Run TF2 normally through Steam. Once the menu loads, choose ‘Create Server’. On the first tab, you can choose a map, but don’t bother, as we’ll be changing it later. On the second tab, you can set up max players (like I said, I recommend 4) and the server name. Once you’ve done that, click ‘Create’.
Step Four - Configuring for public play
Once your server has loaded, open up the console. You’ll need to enable this in the Advanced options under Keyboard set up. You can then access it using the ` button (next to 1 key). Type in ’sv_lan 0′ without the quotes. This tells your server to accept connections from people outside of the subnet 192.168.x.x. Now this is the crucial step. In other Source games, such as CS:S or HL:Deathmatch your server would now work, however, in TF2 you need to invoke a map change. Do this now, by typing ‘map <map of your choice>’ into the console.
If you look in the console, you’ll see after the map change it reports that it connects to the steam servers, and is now VAC secure.
That’s it! Your server is now able to accept connections from the public, and with your ports forwarded correctly clients should be able to connect. To invite people to connect, tell them to type ‘connect <your external ip>:27015′ into the console. You can get your external ip here. They should connect without any problems.
(Optional) Step 5 - Getting your server listed
So your friends are noobs and can’t use the console? Fine, but be prepared for anyone to be able to join your server.
Once you’ve set your server to sv_lan 0, find out your external ip, and then type ip <external ip> into the console. Then invoke a map change as before. Your server should now be listed with all the others, and people should be able to connect to your game via Steam Friends. You may want to set sv_password though, to restrict access.
(Optional) Step 6 - Automagic
Sick and tired of all this typing huh? Ok, ok, we’ll set it up to be automatic.Go to Steam\steamapps\paranoiapersonified\team fortress 2\tf\cfg and create a file called listenserver.cfg. Edit it with notepad, and type:
//Listen server config
hostname “Server name here”
sv_lan 0
sv_password “choose password”
ip <external ip> //note, you’re external ip changes… only add this if you have a static ip from your ISP!
map <map of choice>
Now, when you load your server, your settings will be applied automatically, however, you will need to set ip, and then invoke another map change. You can also add other settings to listenserver.cfg, such as respawn timers etc.
Happy Gaming - hope this guide works!