Left 4 Dead 2 Server Configuration (server.cfg)
Configure your L4D2 server using server.cfg: set hostname, RCON password, game mode, difficulty, rate limits, and other key Source engine cvars.
L4D2 Server Configuration
The primary config file is left4dead2/cfg/server.cfg. Create it if it doesn't exist — the server will load it automatically on startup (when launched with +exec server.cfg).
File Location
/home/steam/l4d2-server/left4dead2/cfg/server.cfg
Complete server.cfg Template
// ── Server Identity ─────────────────────────────────────
hostname "My L4D2 Server"
sv_password "" // Leave blank for public; set to require join password
// ── Admin / RCON ────────────────────────────────────────
rcon_password "YourStrongRconPassword"
// ── Game Mode ───────────────────────────────────────────
mp_gamemode "coop" // coop, versus, survival, scavenge, realism
// ── Difficulty ──────────────────────────────────────────
z_difficulty "Normal" // Easy, Normal, Advanced, Expert
// ── Player Slots ────────────────────────────────────────
// Set via launch flag: +maxplayers 8
// ── Rate / Network ──────────────────────────────────────
sv_minrate "20000"
sv_maxrate "0" // 0 = unlimited
sv_maxupdaterate "60"
sv_mincmdrate "10"
sv_maxcmdrate "60"
// ── Behaviour ───────────────────────────────────────────
sv_cheats "0"
sv_consistency "1" // Enforce file consistency; set 0 for custom content servers
sv_allow_wait_command "0" // Prevent wait command abuse
mp_disable_autokick "0" // Enable AFK auto-kick
Key CVars Explained
hostname
The server name displayed in the Steam server browser and in-game lobby.
sv_password
Join password. Leave blank ("") for a public server. Set to restrict access:
sv_password "MyPrivatePassword"
rcon_password
Password for the RCON remote console. Required to use RCON. Use a strong, unique password.
mp_gamemode
Sets the active game mode. See the L4D2 Game Modes article for all available values.
z_difficulty
Controls AI infected difficulty:
| Value | Difficulty |
|---|---|
"Easy" |
Low damage, slow special infected |
"Normal" |
Default balanced experience |
"Advanced" |
Higher damage, more aggressive SI |
"Expert" |
Maximum difficulty — one hit incapacitation |
sv_consistency
When 1, the server checks that client files match server files. Set to 0 on servers with custom add-ons if players encounter consistency errors.
Applying Changes
Changes to server.cfg take effect after a server restart or by running in the RCON console:
exec server.cfg
Some cvars (like hostname) take effect immediately; others (like mp_gamemode) require a map reload.