A complete walkthrough for running your own Team Fortress 2 dedicated server — install it with SteamCMD, claim a free Steam Game Server Login Token, set the map and player count, and open the ports. Plus the one-click hosted route if you'd rather skip the setup.
Team Fortress 2 runs on Valve's Source engine, so its dedicated server is an SRCDS process that stays online after you close the game. You can self-host it free on a spare PC, or use a managed host for a 24/7 server with a panel and DDoS protection.
This guide covers the self-hosted SteamCMD route step by step, and points out where a host saves you the hassle.
Want it running without a home PC? Team Fortress 2 server hosting is ready for SourceMod plugins and custom maps, behind our Anti-DDoS network.
What you'll need
- A machine to run the server — a spare PC for testing, or a host for 24/7 uptime.
- SteamCMD, to download the free dedicated server (app 232250).
- A free GSLT token for a public server.
- Open ports: UDP 27015 and TCP 27015 (27015-27020 range).
- A high-clock CPU for smooth ticks on a full server.
Set up a Team Fortress 2 dedicated server, step by step
Step 1: Choose self-host or a managed host
The TF2 dedicated server is free, but self-hosting needs a PC on 24/7, port-forwarding and a fast CPU. A managed host gives you an always-online server and a panel in minutes. Want zero hassle? Pick a host and skip to step 5.
Step 2: Install SteamCMD and the server
The TF2 dedicated server is Steam app 232250 — a free, anonymous download; you don't need to own the game on the server machine. Install it with SteamCMD.
steamcmd +login anonymous +force_install_dir ./tf2server +app_update 232250 validate +quitStep 3: Get a free GSLT token
A public server needs a Game Server Login Token to list in the browser. Generate one for app ID 232250 at the Steam Game Server Account Management page, then pass it on launch.
# get a token at: https://steamcommunity.com/dev/managegameservers # then launch with: +sv_setsteamaccount YOUR_GSLTStep 4: Launch with a map and player count
Start srcds with a starting map and your settings. cp_dustbowl and pl_upward are classic defaults.
./srcds_run -game tf +map cp_dustbowl +maxplayers 24 +sv_setsteamaccount YOUR_GSLT +hostname "My ESAGAMES Server"Step 5: Open the ports
Forward UDP 27015 (game) and TCP 27015 (RCON / management); the range 27015-27020 also covers SourceTV. On a managed host this is opened for you.
27015/udp game 27015/tcp RCON / query 27020/udp SourceTV (optional)Step 6: Tune the server & add plugins (optional)
Edit server.cfg for the hostname, rcon password and rates. For admin tools and custom modes, install SourceMod + MetaMod:Source, then restart.
Keep your TF2 server smooth
High CPU clock matters most
Source's tick is single-threaded — a fast per-core CPU keeps a full 24/32-player server responsive far more than extra cores or RAM.
Set a map rotation
Configure a mapcycle so the server rotates through popular maps instead of sitting on one — it keeps players around longer.
Add SourceMod for admin
SourceMod (on MetaMod:Source) gives you admin commands, votes and plugins — essential for a public community server.
Protect the IP
A busy public TF2 server is a DDoS target. Self-hosting exposes your home IP; a managed host puts a clean, filtered IP in front.
Common problems & fixes
The server doesn't list in the browser
Usually a missing/invalid GSLT or a blocked port. Generate a valid token for app 232250 and open UDP 27015.
Players lag on a full server
Source is single-threaded — the CPU clock is the bottleneck, not RAM. Move to a faster-clocked CPU or cap maxplayers.
Plugins don't load
MetaMod:Source or SourceMod is missing or the wrong version. Install both, matched to the current TF2 build, and check the console on startup.
"Connection failed after 4 retries"
The game port (UDP 27015) isn't reachable. Forward it on the router and confirm the host firewall allows it.
Team Fortress 2 is a trademark of Valve Corporation, built on the Source engine. SourceMod and MetaMod:Source are projects of their respective authors. ESAGAMES is an independent hosting provider, not affiliated with or endorsed by Valve. The dedicated server is free; standard Steam terms apply.