# How to Configure Your Team Fortress 2 Server (server.cfg) (/docs/team-fortress-2/server-config)



import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { File, Folder, Files } from 'fumadocs-ui/components/files';

TF2 is the most complex Source engine server to configure — with class limits, MvM mode, holiday events, and a deep plugin ecosystem.

File Structure [#file-structure]

<Files>
  <Folder name="tf" defaultOpen>
    <Folder name="cfg" defaultOpen>
      <File name="server.cfg" />

      <File name="autoexec.cfg" />

      <File name="mapcycle.txt" />

      <File name="pure_server_whitelist.txt" />
    </Folder>

    <Folder name="addons">
      <Folder name="metamod" />

      <Folder name="sourcemod" />
    </Folder>

    <Folder name="scripts">
      <Folder name="population" />
    </Folder>
  </Folder>
</Files>

Editing server.cfg [#editing-servercfg]

<Steps>
  <Step>
    Open the File Manager [#open-the-file-manager]

    In the [XGamingServer Panel](https://panel.xgamingserver.com), click **Files** in the sidebar.
  </Step>

  <Step>
    Navigate to the config [#navigate-to-the-config]

    Click `tf` → `cfg` → open `server.cfg`.

    {/* Screenshot needed: File Manager showing tf/cfg/ */}
  </Step>

  <Step>
    Save and restart [#save-and-restart]

    Edit, click **Save**, restart from **Console**.
  </Step>
</Steps>

***

server.cfg — Essential Settings [#servercfg--essential-settings]

Server Identity [#server-identity]

```
hostname "My TF2 Server"
sv_password ""
rcon_password "YourRconPassword"
sv_contact "admin@example.com"
sv_tags "increased_maxplayers,alltalk"
sv_lan 0
```

Gameplay [#gameplay]

```
mp_autoteambalance 1
mp_teams_unbalance_limit 1
mp_timelimit 30
mp_respawnwavetime 10
tf_weapon_criticals 1             // Random crits (0 = disable for competitive)
tf_damage_disablespread 0         // 1 = fixed damage (competitive)
mp_friendlyfire 0
mp_disable_respawn_times 0        // 1 = instant respawn
```

Class Limits [#class-limits]

`0` = unlimited, `-1` = class disabled:

```
tf_classlimit_scout 0
tf_classlimit_soldier 0
tf_classlimit_pyro 0
tf_classlimit_demoman 0
tf_classlimit_heavy 0
tf_classlimit_engineer 0
tf_classlimit_medic 0
tf_classlimit_sniper 0
tf_classlimit_spy 0
```

**Highlander** (one of each): set all to `1`.

sv_pure (File Consistency) [#sv_pure-file-consistency]

| Mode | Effect                                      |
| :--: | ------------------------------------------- |
|  `0` | Allow all custom files (HUDs, skins)        |
|  `1` | Whitelist-based (blocks model replacements) |
|  `2` | Strict — only official content + sprays     |

Holiday Events [#holiday-events]

```
tf_forced_holiday 0   // 0=calendar, 1=birthday, 2=Halloween, 3=Christmas
```

Permanent Halloween: `tf_forced_holiday 2`

***

GSLT (Required) [#gslt-required]

TF2 **strictly requires** a GSLT — without it, the server won't appear in the browser at all.

Create at [Steam Game Server Management](https://steamcommunity.com/dev/managegameservers) with App ID **440**. Add in the **Startup** tab.

***

MvM (Mann vs Machine) [#mvm-mann-vs-machine]

Co-op PvE mode. Set map to `mvm_*`, configure:

```
tf_mvm_min_players_to_start 1
tf_mvm_respec_enabled 1
```

Wave definitions (popfiles) are in `tf/scripts/population/`. Start a mission: `tf_mvm_popfile mvm_rottenburg_advanced1`

MvM maps: `mvm_coaltown`, `mvm_decoy`, `mvm_mannworks`, `mvm_mannhattan`, `mvm_rottenburg`, `mvm_bigrock`

***

Map Rotation [#map-rotation]

Edit `tf/cfg/mapcycle.txt`:

```
cp_dustbowl
pl_upward
pl_badwater
ctf_2fort
koth_harvest_final
```

| Prefix   | Mode             |
| -------- | ---------------- |
| `cp_`    | Control Point    |
| `pl_`    | Payload          |
| `ctf_`   | Capture the Flag |
| `koth_`  | King of the Hill |
| `mvm_`   | Mann vs Machine  |
| `arena_` | Arena            |

***

Ports [#ports]

| Port      | Protocol  | Purpose     |
| --------- | --------- | ----------- |
| **27015** | UDP + TCP | Game + RCON |
| **27020** | UDP       | SourceTV    |

Related Guides [#related-guides]

* [How to Connect](/docs/team-fortress-2/join-server)
