Sep 09 2012

Team Fortress 2 Dedicated Server In Linux

Now that Team Fortress 2, or TF2 for the sake of this article, is free to play just about everyone with some sense of computer gaming has played it. A dedicated server allows you to have control over the server and invite all your friends to play! In this guide we will set up a TF2 server in CentOS Linux.

Setting up TF2 in Linux is quite simple. Follow the steps below and you should be playing with your friends in no time. If you run into trouble, just leave a comment and I’ll try to give you a hand.

Step One

You are going to need terminal access to your Linux server. This means either using SSH or opening a terminal through your GUI.

Once we are in a terminal we will create a new user just for TF2. Although not required it provides extra security measures for your server.

Type the following to create a new user for TF2. Change the password accordingly.

useradd tf2server

Now we will create a password for this new user.

passwd tf2server

Finally switch to that user by typing:

su tf2server


Step Two

Now we will install the server!

Type cd ~ to change the current directory to the users home directory.

Now type mkdir hlds and then cd hlds to switch to the directory for the TF2 installation.

Now execute the following commands, in order, to install the server:
wget http://www.steampowered.com/download/hldsupdatetool.bin
chmod +x hldsupdatetool.bin
Type yes when prompted.
chmod +x steam
./steam -command update -game "tf" -dir .
You may have to run the previous command a few times to fully complete the installation. I would run it at least three times.

Your server is now installed!

Step Three

Now we must create a configuration file for the server.

Create a file at called server.cfg in /home/tf2server/hlds/orangebox/tf/cfg

Paste the dedicated server configuration example from this website into that file. Be sure to edit the appropiet fileds like hostname and rcon password.

Step Four

Launch your new TF2 server!

Use this command to start the server.
./srcds_run -console -game tf +maxplayers 24 +map ctf_2fort


Congratulations on your new Team Fortress 2 server!


  • scott

    Andy, I’m trying to run tf2 on a machine with cent os 6.5 when i follow your instructions it fails after the ./hldsupdatetool.bin command is said it was not a tar file and failed I used to be an IT person for microsoft unix and novell but that was 15 years ago and things change. I have found several different pages that tell you how to set this up and none have worked yours was the only one that was specifically for cent os any help would be appreciated my son really wants to get this working Thanks Scott

    • Scott, would you be able to include a screenshot of the exact error and previous commands you entered?

      You might be missing an unzip utility. Try running ‘yum install unzip’

  • Dedicated Linux Server

    Every business has unique IT requirements, and that’s why we provide a wide portfolio of hosted solutions. IT Monteur offers Managed Dedicated Server with Delightful Support for your business at best price.