Team Fortress 2 (TF2) is Valve's class-based multiplayer FPS game. This guide covers hosting a TF2 dedicated server using Source Dedicated Server (srcds) on VPS or dedicated servers.
27015 (UDP)27015 (TCP)27020 (TCP/UDP)# Install SteamCMD
# Linux:
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install lib32gcc1 steamcmd
# Create server directory
mkdir -p ~/tf2server
cd ~/tf2server
# Download TF2 server files (App ID 232250)
steamcmd +login anonymous +force_install_dir ~/tf2server +app_update 232250 validate +quit
Windows (start_tf2.bat):
srcds.exe -console -game tf +map ctf_2fort +maxplayers 24 -port 27015 +exec server.cfg
Linux (start_tf2.sh):
#!/bin/bash
./srcds_run -console -game tf +map ctf_2fort +maxplayers 24 -port 27015 +exec server.cfg
Create tf/cfg/server.cfg:
// Server Information
hostname "My TF2 Server"
sv_region 1
rcon_password "your_secure_password"
// Server Settings
sv_lan 0
sv_pure 2
mp_autoteambalance 1
sv_visiblemaxplayers 24
mp_timelimit 30
mp_maxrounds 5
// Communication
sv_alltalk 0
sv_voiceenable 1
// Logging
log on
sv_logbans 1
# Required ports:
UDP 27015 - Game server
TCP 27015 - RCON
TCP/UDP 27020 - SourceTV
# Linux:
sudo ufw allow 27015
sudo ufw allow 27020
Most TF2 servers use SourceMod for admin commands and plugins. Install Metamod:Source first, then SourceMod.
steamcmd +app_update 232250 validatesv_lan 0