Need a Minecraft server? BeastNode offers the highest performance servers with DDoS protection!

Shop for plans now


Install Team Fortress 2 Server on a VPS

To run your very own Team Fortress 2 server on a BeastNode VPS (running CentOS 6 64-bit, not guaranteed to work on other distros), just follow these steps:

1. SSH into your VPS with your root login details.

2. Now install these packages with these commands:

yum install screen

 

yum install libgcc



3. Create a non-root user:

adduser tf2user



4. Set the password for the user:

passwd tf2user



5. Now log into your VPS with that new user account and use it for the rest of the following steps.

6. Create a new directory for the SteamCMD software files

mkdir steamcmd



Navigate to the folder:

cd steamcmd



7. Download SteamCMD:

wget
http://media.steampowered.com/installer/steamcmd_linux.tar.gz



Once downloaded, extract it:

tar -zxvf steamcmd_linux.tar.gz



8. Launch SteamCMD:

./steamcmd.sh



Let SteamCMD update itself. Once completed you'll see a "Steam>" prompt

9. Login to Steam:

login anonymous



Then set the directory to isntall the TF2 server files to:

force_install_dir /home/tf2user/server/



Then to start the TF2 server file download (this may take a while):

app_update 232250 validate



Exit the prompt once completed:

quit



10. Create a script to start up your new server:

cd /home/tf2user

 

vi tf2.sh



Once you are in the editor, hit the "i" key on your keyboard to enable editing
Then copy and paste the following:

#!/bin/sh
sleep 1 screen -m -d -S tf2-server ./server/srcds_run -console -game tf +map cp_badlands +maxplayers 24
echo "TF2 Server Started, type screen -r to view console (CTRL+A then d to detach from screen)"



After that is pasted, hit the "Esc" key on your keyboard, then type in ":x" and hit enter.

Now make the script executable:

chmod 755 tf2.sh



11. Start the server up:

./tf2.sh



To change server settings, simply navigate to the /home/tf2user/server/tf/cfg folder and edit the server.cfg file. If it doesn't exist, create one by entering this command while in the cfg directory:

vi server.cfg



From there, you can add in common settings such as the name of your server:
hostname "BeastNode TF2 Server"

You can check out this guide for more information on the available settings: https://wiki.teamfortress.com/wiki/Dedicated_server_configuration#Example_Server.cfg_for_TF2_dedicated_server

Was this answer helpful?

 Print this Article

Also Read

Installing a Minecraft Server on Your VPS

For this guide, we'll be going over how to install a Minecraft CraftBukkit server on a CentOS 5...

Common Linux SSH/Shell Commands

This is a list of frequently used Linux SSH/shell commands. It may not apply to all Linux...

How to Login to Your VPS

In this guide, we'll be going over how to login to your VPS via SSH terminal/console....

How To Set A Hostname For Your BeastNode VPS

To set a host name for your BeastNode VPS running on a RedHat distro (CentOS for example), just...

Operating System Templates / ISOs

OpenVZ Templates: CentOS 5 (x86_64/x86) CentOS 6 (x86_64/x86) CentOS 6 Minimal (x86_64/x86)...