Skip to content

Team Fortress 2 server guide

A Team Fortress 2 server is a Source dedicated server with a small, fixed set of launch settings and one config file. Hostboi writes the name, the join password and the RCON password for you on every boot, so the Startup tab is the place to change those; everything else — SourceMod, maps, extra cvars — is a file you upload.

  1. Open your server in the panel and go to Startup.
  2. Change the fields you need and save.
  3. Restart from Console.
Field What it does
Server Name The name shown in the server browser.
Default Map The map loaded at start. ctf_2fort by default; cp_dustbowl, pl_badwater and koth_harvest_event are common choices.
Max Players 24 by default.
Server Password Join password. Leave blank for a public server.
Admin (RCON) Password Password for remote console. Each server is created with its own random one; clear it to turn RCON off.
Game Server Login Token (GSLT) Your Valve token, covered below.
Client Port The second port TF2 uses. It has to match an allocation on your server.
SourceTV Port The port for SourceTV spectators and demos. It also has to match an allocation.
Auto Update Updates the server files when the server starts. On by default.

Server Name, Server Password and Admin (RCON) Password are written into tf/cfg/server.cfg at every start. Editing those three lines in the file yourself does not survive a restart — change them on Startup. Your own cvars (friendly fire, respawn times, mp_ settings and so on) can go in the same file below those lines, and those are left alone.

A new server starts without a token: it logs in to Steam anonymously, with a new server ID each time it starts. A Game Server Login Token (GSLT) is free, belongs to your Steam account, and gives the server a fixed identity, so it keeps the same ID across restarts and Valve can tie it to you. Valve asks community servers to use one.

  1. Sign in at steamcommunity.com/dev/managegameservers and pick Team Fortress 2 from the app list.
  2. Create the token and copy it. It is 32 characters, letters and numbers.
  3. Paste it into Game Server Login Token (GSLT) on Startup and restart.

The general walkthrough for these tokens, including what to do if one leaks, is in Game keys and tokens. Players can always join by address with connect host:port in the developer console, token or not.

TF2 has no admin menu built in. You have two options.

RCON — no addons needed.

  1. Copy Admin (RCON) Password from Startup (each server gets its own random one). If you change it, restart.
  2. In TF2, enable the developer console, then run rcon_password <the password> and after that rcon <command>, for example rcon status or rcon changelevel cp_dustbowl.

SourceMod — the usual route for a community server. Our setup installs the game only, so you upload the plugin stack yourself:

  1. Take a backup first, then stop the server.
  2. Download MetaMod:Source and SourceMod from AlliedModders for Linux. Upload both into tf/ so that tf/addons/metamod/ and tf/addons/sourcemod/ exist.
  3. Start the server and check Console. meta version should report MetaMod, and sm version should report SourceMod. If neither answers, the files are in the wrong folder.
  4. Join the server, type status in your own console, and note your Steam ID in the STEAM_0:1:23456 form.
  5. Stop the server, open tf/addons/sourcemod/configs/admins_simple.ini in Files and add a line such as "STEAM_0:1:23456" "99:z". The z flag grants every SourceMod command; 99 is the immunity level.
  6. Start the server, run sm_reloadadmins in Console, then type sm_admin in your game console. The admin menu should appear.

Never put a Steam password anywhere in this process — SourceMod admin rights are granted by Steam ID, not by login.

Path What is in it
tf/cfg/server.cfg The main config. Read at startup.
tf/cfg/ Any other .cfg you want to exec from the console.
tf/maps/ Custom maps (.bsp, plus the .nav if the map ships one).
tf/addons/ MetaMod and SourceMod.
tf/addons/sourcemod/configs/ admins_simple.ini and the rest of the SourceMod config.

Upload custom maps into tf/maps over SFTP and restart. Players download the map from your server when they join, so a very large map means a slow first connection for everyone.

  • Now, for everyone: changelevel cp_dustbowl in Console, or rcon changelevel cp_dustbowl from your game console.
  • With SourceMod: sm_map cp_dustbowl, which also works from the admin menu.
  • Permanently: set Default Map on Startup and restart.

Setting a map that is not in tf/maps fails, and the server keeps the current one.

From the panel’s Console (or your game console with rcon in front):

  • status — players, Steam IDs and connection state.
  • changelevel <map> — change map now.
  • kick <name or userid> — disconnect a player.
  • say <text> — print a message in chat as the console.
  • sv_password <password> — set a join password for this session only.
  • meta list — show whether MetaMod plugins loaded.
  • The token does not seem to work. TF2 does not print an error for a bad token; it quietly logs in anonymously instead. After a restart, look in Console for the gameserver Steam ID line: [A:...] means anonymous (no token, or Steam did not accept it), [G:...] means your token is in use. Check that the token was made for Team Fortress 2 (App ID 440) and pasted without spaces.
  • SourceMod commands do nothing. MetaMod is missing or was uploaded one folder too deep. meta version in Console is the quickest check.
  • Players cannot connect but the server looks fine. Client Port and SourceTV Port must match ports allocated to your server; if you changed one to a number you do not own, the server starts and then fails to bind.
  • Everyone is dropped after a TF2 update. Clients are on the new build and the server is not. Restart with Auto Update on and watch Console for the update finishing.
  • Password set but nobody is asked for it. The value was edited into server.cfg while the server was running. Set it on Startup and restart instead.