Left 4 Dead 2 server.cfg generator

Left 4 Dead 2 has an unusual problem: the game's own Director resets many of the settings people try to change here.

Visual Settings

source Format
Identity

Server name in the browser.

Gameplay

Comma-separated game modes the server offers.

Campaign difficulty. Impossible is Expert.

Both teams hear each other on voice.

Cheat commands. Many pacing and difficulty values are re-applied by the Director once a campaign starts, so they will not stick from this file alone.

Players & Access

Join password.

Network

Game server login token for public listing.

On, players can only arrive through a Steam lobby and direct connections are refused — the usual reason a reachable server rejects friends joining by address.

RCON & Query

Remote console password.

server.cfg

rcon_passwordThis is still the example RCON password. Change it, and keep the RCON port off the public internet.
sv_setsteamaccountWithout a game server login token the server will not appear in the public browser, however your ports are configured.
hostname "Spawnly L4D2"
sv_password ""
rcon_password "changeme"
sv_setsteamaccount 
sv_allow_lobby_connect_only 0
sv_gametypes coop,versus,survival
z_difficulty Normal
sv_alltalk 0
sv_cheats 0

How server.cfg syntax works

Standard Source command syntax. The complication is layering — the server reads server.cfg, then gamemode-specific configs, and the Director applies its own values on top for anything affecting pacing and difficulty.

The mistake that costs people hours

Difficulty and spawn-related settings written into server.cfg are frequently overridden once a campaign starts. If a value refuses to stick, it needs to go in the gamemode-specific config rather than the general one, and some of it cannot be changed without a plugin.

Support & Help