Skip to content
Team Fortress 2

Install a Team Fortress 2 server

The TF2 dedicated server (SteamCMD app 232250) installs with an anonymous login, without owning the game on the machine, and starts with srcds_run -game tf. Plan about 8 GB of disk, half an hour and a GSLT token to appear in the server list. Main source: wiki.teamfortress.com (Linux dedicated server).

Last updated: 10/9/2026

The TF2 dedicated server (SteamCMD app 232250) installs with an anonymous login, without owning the game on the machine, and starts with srcds_run -game tf. Plan about 8 GB of disk, half an hour and a GSLT token to appear in the server list. Main source: wiki.teamfortress.com (Linux dedicated server).

Step-by-step installation

  1. Prepare a Linux machine (Ubuntu/Debian) with at least 8 GB of free disk, or a Windows PC.

  2. Create a non-root user (steam) and install the 32-bit libraries.

  3. Download SteamCMD and install the server with app_update 232250.

  4. Create a GSLT token at steamcommunity.com/dev/managegameservers (needed to be listed).

  5. Generate the launch line with the “TF2 launch command” tool and start srcds_run.

  6. Edit tf/cfg/server.cfg (“TF2 server.cfg generator” tool) and tf/mapcycle.txt.

  7. Open 27015 UDP/TCP and 27020 UDP (and 27005 UDP) in ufw, at the provider and on the router.

  8. Test with connect 127.0.0.1 locally, then from another connection with connect IP:27015.

  9. Create a systemd service and schedule updates and backups.

Prerequisites

  • OS: Linux with glibc 2.3.6 or newer and about 8 GB of free disk (TF wiki); Windows also possible.
  • CPU/RAM: not specified by the wiki consulted; the official example uses 24 slots. Watch the load before increasing.
  • Accounts: installation is anonymous (owning TF2 is not required on the server). A Steam account is used to create the GSLT token.

Local installation on Windows

Unzip SteamCMD in C:\steamcmd, install the server then run srcds.exe with the same parameters as on Linux. Test with connect 127.0.0.1 in the TF2 console.

cd C:\steamcmd
steamcmd +force_install_dir C:\tf2ds +login anonymous +app_update 232250 validate +quit

cd C:\tf2ds
srcds.exe -console -game tf +map ctf_2fort +sv_pure 1 +maxplayers 24 +sv_setsteamaccount YOUR_GSLT_TOKEN

Linux VPS: user and dependencies

Packages cited by the TF wiki for 64-bit Debian/Ubuntu. On recent releases, libtinfo5 and libncurses5 may no longer be provided: the wiki then points to manual downloads.

sudo adduser steam
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32z1 libncurses5:i386 libbz2-1.0:i386 lib32gcc-s1 lib32stdc++6 libtinfo5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386
su - steam

Linux VPS: install and first start

Commands from the TF wiki. Replace YOUR_GSLT_TOKEN (a valid token is required to appear in the server browser). For the prerelease branch, add -beta prerelease before +app_update.

mkdir -p ~/steamcmd && cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar zxf steamcmd_linux.tar.gz
./steamcmd.sh +force_install_dir ~/hlserver/tf2 +login anonymous +app_update 232250 +quit

cd ~/hlserver/tf2
./srcds_run -console -game tf +map ctf_2fort +sv_pure 1 +maxplayers 24 +sv_setsteamaccount YOUR_GSLT_TOKEN

Configuration files to know

  • tf/cfg/server.cfg: name, RCON password, time and round limits (wiki example: hostname, sv_contact, rcon_password, mp_timelimit, mp_maxrounds).
  • tf/mapcycle.txt: map rotation list (the wiki does not detail the format: one map per line, as in other Source games).
  • motd.txt and pure_server_whitelist.txt: optional (welcome message and sv_pure whitelist).

Ports to open and Linux firewall (ufw)

To change the game port, add -port N to the launch line (one port per instance) and open it instead of 27015.

Open only what you need, then test from another connection (not from the server itself).

  • 27015/udp: game traffic (TF wiki)
  • 27015/tcp: RCON (TF wiki)
  • 27020/udp: SourceTV (TF wiki)
  • 27005/udp: client communication (standard Source value, not cited by the TF wiki consulted)
sudo ufw allow OpenSSH
sudo ufw allow 27015/udp
sudo ufw allow 27015/tcp
sudo ufw allow 27005/udp
sudo ufw allow 27020/udp
sudo ufw enable
sudo ufw status

Windows firewall (netsh)

In an administrator command prompt, create one inbound rule per port (or open “Windows Defender Firewall with Advanced Security”).

netsh advfirewall firewall add rule name="Team Fortress 2 27015 UDP" dir=in action=allow protocol=UDP localport=27015
netsh advfirewall firewall add rule name="Team Fortress 2 27015 TCP" dir=in action=allow protocol=TCP localport=27015
netsh advfirewall firewall add rule name="Team Fortress 2 27005 UDP" dir=in action=allow protocol=UDP localport=27005
netsh advfirewall firewall add rule name="Team Fortress 2 27020 UDP" dir=in action=allow protocol=UDP localport=27020

Provider firewall and port forwarding (home router)

At a host (OVH, Hetzner, Scaleway…), also open the same ports in the provider's firewall or “security group”: ufw is not enough if an upstream firewall exists. For a home server, create a port forward (NAT) in your router for each port to the machine's local IP address (make it static or reserve it via DHCP).

Test: from another connection, add the server as “IP:port” in Team Fortress 2's server browser or in the console. If it fails, check in order: service running, local firewall, provider firewall, NAT forward.

Automatic start: systemd service

Create /etc/systemd/system/tf2.service (as root), then enable it. Adapt the user and paths; read logs with journalctl -u tf2 -f.

[Unit]
Description=Team Fortress 2 dedicated server
After=network-online.target
Wants=network-online.target

[Service]
User=steam
WorkingDirectory=/home/steam/hlserver/tf2
ExecStart=/home/steam/hlserver/tf2/srcds_run -console -game tf -norestart +map ctf_2fort +sv_pure 1 +maxplayers 24 +sv_setsteamaccount YOUR_GSLT_TOKEN
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

# then:
# sudo systemctl daemon-reload
# sudo systemctl enable --now tf2

Windows: scheduled task at startup

On Windows, a scheduled task runs your .bat script at system startup (run the command in an administrator prompt).

schtasks /Create /TN "Team Fortress 2 server" /TR "C:\tf2ds\start-tf2.bat" /SC ONSTART /RU SYSTEM /RL HIGHEST

Updates, backups and scheduled restarts

Stop the service before updating (same SteamCMD command as for installation), back up configuration and data files regularly, and schedule a daily restart if the server degrades over time.

sudo systemctl stop tf2
steamcmd +force_install_dir /home/steam/hlserver/tf2 +login anonymous +app_update 232250 validate +quit
sudo systemctl start tf2

# backup
tar czf ~/tf2-$(date +%F).tar.gz -C /home/steam/hlserver/tf2 tf/cfg tf/addons tf/mapcycle.txt

# daily restart at 05:00 (root crontab: sudo crontab -e)
0 5 * * * systemctl restart tf2

List and find your server

Add your server at https://game-rank.com/jeux/team-fortress-2 to make it visible to the community. To find it in game, use the server browser or connect directly with its IP:port.

Troubleshooting: common errors

  • The server runs but is not listed: GSLT token missing or invalid. Fix: the TF wiki requires a valid token; pass it with +sv_setsteamaccount (or SRCDS_TOKEN with Docker) and restart.
  • Error: libtinfo.so.5 / libncurses.so.5 not found on a recent distribution. Fix: install the matching i386 packages if they exist, otherwise follow the manual downloads pointed to by the TF wiki.
  • Server invisible from outside: the service runs but nobody can connect. Cause: closed port (ufw, provider firewall or missing NAT forward). Fix: open the ports listed above at all three levels and test from another connection.
  • Port already in use at startup: another instance holds the port. Fix: list processes with ss -lunp | grep 27015, stop the old instance, or give each server a different port with -port.
  • SteamCMD “Failed to install app” or stalled download: frequent cause, full disk or insufficient folder permissions. Fix: check df -h and the folder owner, then rerun the command with validate (several times if needed).
  • srcds_run: “No such file or directory” or missing 32-bit library: the Source server is a 32-bit program. Fix: enable the i386 architecture (dpkg --add-architecture i386) and install lib32gcc-s1 and lib32stdc++6.

Frequently asked questions

How many players can a TF2 server host?
The official example uses +maxplayers 24; the wiki consulted gives no ceiling. Set +maxplayers according to your CPU and plugins.
How do I update the server?
According to the TF wiki, simply rerun the SteamCMD install command (+app_update 232250). Automatic update with -autoupdate needs extra parameters (-steam_dir, -steamcmd_script) that are not detailed: prefer a scheduled update as in the dedicated section.
Can I run the server as root?
Not recommended: create a dedicated user (for example steam) without admin rights, and install and run the server with it. A flaw in the server or a plugin then does not compromise the whole machine.
My Team Fortress 2 server does not appear in the list: what should I check?
First check that the ports are open at every level, that the server is not in LAN mode (sv_lan 0) and, if the game requires it, that a valid server token (GSLT) is provided. The Steam list can take a few minutes to refresh; meanwhile, connect by IP:port.

Tools for your Team Fortress 2 server

Team Fortress 2
Team Fortress 2Open access
Build your Team Fortress 2 server.cfg: time and round limits, balancing, crits, weapon spread and FastDL.
ConfigurationSourceOpen
Documentation
Team Fortress 2
Team Fortress 2Open access
Generate the Team Fortress 2 srcds_run line: map, slots, sv_pure, port, mapcycle and GSLT token.
LaunchConfigurationOpen
Documentation