This guide walks you through setting up a production-ready Team Fortress 2 dedicated server on Ubuntu 22.04 LTS. Every command has been tested on live servers running real player loads.

01 // Requirements

  • VPS or dedicated server running Ubuntu 22.04 LTS (recommended) or Windows Server 2022
  • Minimum 4GB RAM for a small server — 8GB+ for 32+ slots
  • li>2 vCPU cores minimum, 4+ recommended for larger servers
  • 20GB SSD storage — TF2 server files
  • Root or sudo access to the server
  • A static IP address or dynamic DNS
Tip

A 24 slot TF2 server will use around 4-6GB RAM during peak usage. Budget accordingly.

Recommended VPS for TF2

Hostinger KVM 2 — 8GB RAM

2 vCPU, 8GB RAM, 100GB NVMe. Handles a 24-slot TF2 community server with SourceMod plugins comfortably. Run 2-3 servers on one box if you want a small community cluster. €8.49/mo.

Get KVM 2 →
Alternative — Managed Hosting

Nitrado — One-Click Game Servers

Prefer a managed option? Nitrado sets up your server in under 2 minutes. No Linux, no terminal, no maintenance — they handle everything. Perfect for beginners who want to focus on playing, not server admin.

Get Nitrado →

02 // System Preparation

Start by updating the system and installing dependencies needed for SteamCMD:

sudo apt update && sudo apt upgrade -y
sudo apt install -y software-properties-common lib32gcc-s1 curl wget unzip

Create a dedicated user

Never run game servers as root. Create an isolated user account:

sudo useradd -m -s /bin/bash tf2server
sudo su - tf2server

03 // Install SteamCMD

SteamCMD is Valve's command-line tool for downloading Steam content including game servers.

mkdir -p ~/steamcmd && cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz

04 // Install TF2 Dedicated Server

Now download the TF2 dedicated server using SteamCMD. The app ID for the TF2 server is 232250:

./steamcmd.sh +force_install_dir ~/tf2-server +login anonymous +app_update 232250 validate +quit

This download is around 8-10GB and takes several minutes depending on your connection. Once complete you'll have all server files in ~/tf2-server.

05 // Configure the Server

Create the server configuration directory and base config file:

mkdir -p ~/tf2-server/tf/cfg
nano ~/tf2-server/tf/cfg/server.cfg

Add your core server settings:

// Server Settings
hostname "Your Server Name | Community TF2 Server"
sv_lan 0
rcon_password "CHANGEME_STRONG_PASSWORD"

// Map Settings
mp_timelimit 30
mp_winlimit 0
mp_maxrounds 0

// Team Settings
mp_autoteambalance 1
mp_teams_unbalance_limit 1

// Player Settings
mp_idlemaxc

// Game Settings
sv_cheats 0
sv_allow_wait_command 0
sv_pure 1
sv_pure_kick_clients 1

// Network Settings
sv_maxcmdrate 66
sv_maxupdaterate 66

// Write-Ahead Logging
log on
sv_log_onefile 0
sv_logbans 1
sv_logecho 1
sv_logfile 1
sv_logflush 1

// Rate limiting
sv_maxrate 30000
sv_minrate 5000

// Server Hibernation
sv_hibernate_think 1
sv_hibernate_when_empty 0

// Password Settings
sv_password "" // Add password if needed

// Bots
bot_challengemode 1
bot_dontcountplayers 0
bot_join_after_player 1
bot_quota 6
bot_quota_mode fill

Create launch script

Next create a launch script that starts the server with the right parameters:

nano ~/start-tf2.sh
#!/bin/bash
cd ~/tf2-server
./srcds_run -game tf -usercon -console -autoupdate -port 27015 +ip 0.0.0.0 +hostport 27015 +hostip 0.0.0.0 +map c1713a297f7f

Make it executable:

chmod +x ~/start-tf2.sh

06 // Configure Firewall

Open the required ports for the server:

sudo ufw allow 27015/udp
sudo ufw allow 27015/tcp
sudo ufw allow 27020/udp
sudo ufw allow 26900/udp

07 // Start Server

Now start the server with:

./start-tf2.sh

08 // Next Steps