I’m using Ubuntu 8.04 Server LTS but most Linux installs should be similar if not the same. There are a few sites out there that explain how to install steam based games on Linux. Unfortunately none of them I’ve seen have given a line by line install of TF2. Here are some of my notes because I’ve done this a few times. First we need to install Steam:
mkdir srcds && cd srcds
wget http://www.steampowered.com/download/hldsupdatetool.bin
chmod +x hldsupdatetool.bin
./hldsupdatetool.bin
./steam
You can run the command ./steam to see a list of commands. If you want to install TF2, type:
./steam -command update -game “tf” -dir .
This will create a directory called “orangebox” in your “srcds” folder. Go make a sandwich because unless you’re hosting in a colocation facility (like me
), it’s going to take a while. When it’s done, or when it appears done, I would run the command again with the “verify_all” flag to make sure it’s 100% installed:
./steam -command update -game “tf” -dir . -verify_all
Note: I had to run this a couple times when I installed this at home before because it wouldn’t complete in one download “session”.
If you want to see a list of games available for download from steam run:
./steam -command list
Let’s move on to… Scripts
First, let’s see how we can manually run the server, and we’ll explore putting it into a script to run in the background so closing your terminal window won’t kill the process. To manually run the server via shell access cd to the orangebox directory and:
./srcds_run -console -game tf +map ctf_2fort -maxplayers 24
-autoupdate
Change variables where you see fit. I highly recommend using screen so you can detach the process in the background rather than just having source run as a background process.
sudo apt-get install screen
Now create a file, call it whatever you want. I called it “tf2.sh”. Enter the following and save:
#!/bin/sh
echo “Starting TF2 Server”
sleep 1
screen -AmdS tf2 ./srcds_run -console -game tf +map ctf_2fort -maxplayers 24 -autoupdate
After the file is saved, the permissions need to be executable: chmod +x tf2.sh
In my next post, I’ll review the server.cfg file. If people actually read this and like this, I’ll post this as a static page. I’ll also add a script that will reboot the server when there is an upgrade. [More to come]
Tags: half life, hl2, install, linux, server.cfg, source, tf2, ubuntu
6 Responses to “Howto: Install Team Fortress 2 (Linux Dedicated)”
Leave a Reply
Pages
Archives
- September 2010
- July 2010
- November 2009
- October 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008

Nice work Tyler!
Thanks for the howto. Really helpful.
Did you ever write the article about the server.cfg?
[...] Just setup a TF2 server following this article [...]
@Patrick Connelly
I’m thinking I’ll post my server.cfg soon. All I did was read the post at srcds found here: http://forums.srcds.com/viewtopic/5264 and tailored it to the settings I wanted. Thanks for reading.
Nice post, but the official guide (http://forums.steampowered.com/forums/showthread.php?t=292495) might prove more useful, and frequently updated…
did everything that was done in this tutorial and got this
tf2@Tf2:~/srcds/orangebox$ ./srcds_run -console -game tf +map ctf_2fort -maxplayers 24 -debug
Auto detecting CPU
Using default binary: ./srcds_linux
Enabling debug mode
Server will auto-restart if there is a crash.
Illegal instruction (core dumped)
warning: Can’t read pathname for load map: Input/output error.