Open your hosting company

Enzonic for Resellers

Open your hosting company

How to host a Team Fortress 2 server for your community

Install a TF2 dedicated server, configure server.cfg and the map cycle, add SourceMod admins and plugins, record SourceTV, and keep it updated.

Enzonic teamUpdated 6 minute read

A Team Fortress 2 community server is a simple thing at its core: a map rotation, a few rules, and admins who keep the game fun. Getting there means installing the dedicated server, writing a clean server.cfg, setting up MetaMod:Source and SourceMod for admin tools, and keeping everything working through game updates. This guide walks through each step, plus SourceTV, competitive setups, Mann vs. Machine, backups and performance.

If you want to sell TF2 servers rather than run one, read starting a TF2 hosting business.

Installing the dedicated server

The TF2 dedicated server is free through SteamCMD, app ID 232250:

steamcmd +force_install_dir /srv/tf2 +login anonymous +app_update 232250 validate +quit

Run it again to update. Your game files live under /srv/tf2/tf/. The folders you will use:

  • tf/cfg/: server.cfg, map cycle, MOTD, plus config files for plugins.
  • tf/maps/: custom maps (.bsp files).
  • tf/addons/: MetaMod:Source and SourceMod once installed.
  • tf/custom/: custom content folders.

Launching the server

TF2 uses srcds, Valve's Source dedicated server program:

./srcds_run -game tf -console -port 27015 \
  +maxplayers 24 \
  +map ctf_2fort
  • -game tf is required.
  • -port sets the game port. 27015 is the Source default.
  • +maxplayers sets the slot count. Set it on the command line, not in server.cfg.
  • +map is the first map. It must be a stock map or a .bsp in tf/maps/.

If you use a Game Server Login Token from Steam, pass it with +sv_setsteamaccount. It gives the server a stable identity; check Valve's current guidance for TF2.

server.cfg

tf/cfg/server.cfg runs on each map load. A reasonable community starting point:

hostname "Our Community | 2fort and friends"
sv_password ""
rcon_password "use-a-long-random-password"
sv_pure 1
mp_timelimit 30
mapcyclefile "mapcycle.txt"
motdfile "motd.txt"
sv_allowupload 0
sv_allowdownload 1
  • hostname is the name in the server browser.
  • sv_password makes it private.
  • rcon_password enables remote console. Use a long random value, or none if you only use a panel console.
  • sv_pure controls whether players may use custom files that change the game's look or sounds. Higher values are stricter.
  • mp_timelimit sets map length in minutes.
  • mapcyclefile and motdfile point at your map rotation and message of the day.
  • sv_allowdownload lets players download custom maps from the server. For many custom maps, a FastDL web server set with sv_downloadurl is much faster.

The map cycle

Create tf/cfg/mapcycle.txt with one map per line:

ctf_2fort
pl_badwater
cp_dustbowl
koth_harvest_final
pl_upward

Stock maps are always available. For a custom map, put its .bsp in tf/maps/ and add it to the cycle.

MetaMod:Source and SourceMod

Nearly every community server runs MetaMod:Source and SourceMod. SourceMod gives you admin commands, menus, a plugin system and logs.

Install by downloading the Linux builds for your server from their official sites and extracting both archives into tf/, so their files land in tf/addons/ and tf/cfg/sourcemod/. Restart the server, then check:

meta version
sm version

Admins

The quickest way to add admins is tf/addons/sourcemod/configs/admins_simple.ini:

"STEAM_0:1:12345678" "99:z"
"STEAM_0:0:87654321" "50:bcdefgj"

The first value is the player's SteamID. The second is an immunity level and a set of flags. Some useful flags:

  • z: root, everything.
  • b: generic admin, needed for most admin commands.
  • c: kick. d: ban. e: unban.
  • f: slay. g: change map. j: chat commands.

Give moderators only what they need, and keep z for the owner. After editing the file, run sm_reloadadmins from the console. Admins open the menu in game with sm_admin.

Plugins

SourceMod plugins are .smx files in tf/addons/sourcemod/plugins/. Copy a plugin in, then load it or change maps:

sm plugins load mapchooser
sm plugins list

SourceMod ships useful plugins such as map voting (mapchooser, nominations, rockthevote), basic votes and anti-flood. Move a plugin to the disabled folder to stop it loading. Plugin configs usually appear in tf/cfg/sourcemod/ after the first load.

When something goes wrong, check tf/addons/sourcemod/logs/ for error logs before anything else.

Moderation that holds up

Tools are the easy part. What keeps a TF2 pub healthy is consistent moderation:

  • Write short rules. No cheating, no harassment, no mic spam, and whatever is specific to your server (for example, no spawn camping on certain maps). Put them in motd.txt so every player sees them on join.
  • Use the lightest tool first. A warning, then a mute or gag, then a kick, then a timed ban. SourceMod has commands for each. Permanent bans are for cheaters and repeat offenders.
  • Log decisions. SourceMod logs admin actions. Point your staff to those logs when a ban is appealed, so decisions do not depend on memory.
  • Keep votekick in check. Player votes can be abused by groups. Many communities raise vote thresholds or limit who can start votes.
  • Review new admins. Give new staff limited flags for a few weeks before adding ban rights.

Common problems

  • "Server is not responding" in the browser. Check that the game port is open for UDP and the server finished loading the map. Players can connect directly by address with the console connect command while you debug.
  • Custom map downloads time out. Large maps over the game server are slow. Set up FastDL with sv_downloadurl.
  • Admin menu missing. SourceMod is not loading. Run meta list and sm version, and read the newest error log.
  • Players lag on a full server. Check CPU in your panel during a busy round, remove heavy plugins, and reduce bots.

SourceTV and demos

SourceTV lets spectators watch and records demos of matches, which competitive players rely on:

tv_enable 1
tv_autorecord 1
tv_name "Our Community TV"

SourceTV uses its own port (27020 by default) and takes a player slot. Demo files are written to the tf/ folder and add up quickly, so clean them out regularly or move them somewhere else.

Competitive and pug servers

Competitive TF2 (6v6 and Highlander) uses league configs: sets of cvars that the league publishes. Put them in tf/cfg/ and execute the right one before each match:

exec your_league_6v6_koth

Use a password, enable SourceTV recording, and set mp_tournament 1 so teams ready up. Keep the plugin list short on scrim servers. Fewer moving parts means fewer surprises mid-match.

Mann vs. Machine and custom modes

Mann vs. Machine maps start with mvm_. Because the robots are bots, MvM servers usually run with the full slot count while only six humans play. Custom missions are files you add to the server; follow each mission's instructions.

Custom modes such as Versus Saxton Hale, dodgeball or prop hunt are SourceMod plugins plus maps built for them. Install the plugin, add the maps, and give the mode its own map cycle.

Backups

The things to back up:

  • tf/cfg/ (your configs, map cycles, league configs)
  • tf/addons/sourcemod/configs/ (admins, plugin settings) and your plugins folder
  • tf/maps/ custom maps and anything in tf/custom/
  • any plugin databases (some plugins use SQLite files under addons/sourcemod/data/)

Back up before installing plugins, before updating SourceMod, and on a schedule. Game files themselves can always be downloaded again.

Updates

Players cannot join a server running an older TF2 version. When Valve ships an update, update the server through SteamCMD or your panel. After updates, check whether MetaMod or SourceMod need a newer build, because game updates can break their gamedata. The SourceMod error logs tell you quickly if something failed.

Performance

TF2 is mostly limited by CPU, especially a single fast core:

  • Bots. Each bot costs CPU. MvM and bot-filled servers need more headroom.
  • Plugins. Plugins with frequent timers or heavy hooks add up. Remove anything you do not use.
  • Full servers. Test at your real slot count, during a busy round, not on an empty map.

A reasonable starting point is to watch CPU during a full, active round with your plugin set, and fix plugins before you look at hardware. A daily restart at a quiet hour keeps long-running servers tidy.

Running it through a branded panel

If you want admins to manage the server from a web panel, you can run it through a panel with your community's name and colors with Enzonic for Resellers. Panel-only mode serves just sign-in and the panel, for communities that do not sell anything.

With Enzonic for Resellers, Team Fortress 2 runs on Enzonic nodes in Europe, North America and Asia and on your own Pterodactyl or Pelican Wings nodes, so you can sell it without running any hardware.

You can also connect your own machine running Pterodactyl Wings or Pelican Wings, as described in bringing your own Wings nodes. Admins get a live console, a file manager and SFTP for configs, maps and plugins, scheduled backups, scheduled tasks, network ports for SourceTV, and their own subuser logins with two-factor sign-in.

Running several Source games? See hosting Garry's Mod and hosting Insurgency.

Frequently asked questions

How do I make myself admin on a TF2 server?

Install MetaMod:Source and SourceMod, add your SteamID with the z flag to addons/sourcemod/configs/admins_simple.ini, then run sm_reloadadmins. Open the admin menu in game with sm_admin.

Why can nobody join after a TF2 update?

The server is still on the old version. Update it through SteamCMD or your panel, then check that MetaMod and SourceMod still load.

Where do custom maps go?

Put the .bsp file in tf/maps/ and add the map name to mapcycle.txt. For faster downloads for players, set up FastDL with sv_downloadurl.

Does SourceTV use a player slot?

Yes, SourceTV takes one slot and its own port. Account for it when you set +maxplayers.

#tf2#srcds#sourcemod#dedicated-server