Most Left 4 Dead 2 sessions run on somebody's listen server, which works until the host has a bad evening and takes the campaign with them. A dedicated server costs very little here - the game is undemanding, four players and the AI Director fit inside 2 GB - and it removes the single biggest cause of a run ending early. What it does not remove is L4D2's matchmaking, which was built around lobbies and official servers and will cheerfully ignore the server you just paid for unless you tell it not to. That is the part this guide spends the most time on, because it is the part that defeats people.
Listen servers, dedicated servers and the lobby#
Left 4 Dead 2 has three ways to get four people into a campaign, and they behave differently.
- A listen server is one player hosting inside their own game. It is the default when you invite friends and press play. The host's machine runs the simulation and the AI Director, their upload carries everyone, and their crash ends the campaign.
- A local dedicated server is
srcdson the same machine, started from the console. Better, still tied to one person's box. - A real dedicated server runs somewhere else, all the time, and nobody's alt-tab costs the group a finale.
The complication is that L4D2 does not have a simple "join this server" flow for co-op. A group forms a lobby, the lobby leader presses start, and the matchmaker picks a server - usually an official Valve one. Nothing about owning a server changes that by itself. Two cvars do:
sv_search_keyon the server and the same value typed into the lobby leader's console before starting. The matchmaker then only considers servers carrying that key, which in practice means yours.mm_dedicated_force_servers "203.0.113.10:27015"on the client, which points the lobby at a specific address.
The third route is the direct one: sv_allow_lobby_connect_only 0 in your server config, and then anybody can connect 203.0.113.10:27015 from the developer console without a lobby at all. The default is 1, which is why a server that looks perfectly healthy refuses every direct connection. If you take one thing from this guide, take that line.
Requirements and resource usage#
| Setup | RAM | CPU | Notes |
|---|---|---|---|
| 4-player co-op | 1-2 GB | 1 core | The Director plus three or four bots |
| 8-player versus | 2 GB | 1 core | Twice the players, barely more load |
| 10-16 players with plugins | 2-3 GB | 1-1.5 cores | Unlocked slots and SourceMod |
| Custom campaigns installed | 2 GB | 1 core | Costs disk, not memory |
L4D2 is a 2009 Source game and it shows in the best way: the memory footprint is tiny and one core is enough. Two things do matter.
The first is disk. The dedicated server install runs to well over ten gigabytes, and custom campaigns are 100-400 MB each. Size the disk, not the RAM.
The second is where the machine is. L4D2 runs at 30 ticks a second - half the rate of most Source shooters - and the game leans on client-side prediction to hide it. Add 90 ms of latency to that and the difference between a Charger hitting you and missing becomes a coin toss. Pick a location near your group rather than near the middle of the map, and if the game feels bad, measure before you buy: latency, jitter and packet loss explains which of the three you actually have, and choosing where your server lives covers the trade when a group is spread out.
Installing the server and the launch line#
The dedicated server is app id 222860 and installs anonymously:
$ steamcmd +force_install_dir /home/l4d2/server +login anonymous \ +app_update 222860 validate +quit$ cd /home/l4d2/server$ ./srcds_run -game left4dead2 -console -usercon -port 27015 \ +map c1m1_hotel +exec server.cfgThe client app id is 550, and that is the one to use when pulling Workshop items down with SteamCMD - a detail that catches people who assume the server's id works everywhere. SteamCMD explained covers app ids, validate and update scripts in general.
A few campaign start maps, since the console needs the internal name rather than the title:
| Campaign | First map |
|---|---|
| Dead Center | c1m1_hotel |
| Dark Carnival | c2m1_highway |
| The Parish | c5m1_waterfront |
| No Mercy | c8m1_apartment |
server.cfg: game mode, difficulty and the Director#
left4dead2/cfg/server.cfg is read at start-up and on map changes. A working starting point:
hostname "Thursday night survivors"rcon_password "long-random-string"sv_password ""sv_lan 0sv_region 3sv_steamgroup ""sv_consistency 1sv_gametypes "coop,realism,survival,versus,teamversus,scavenge"mp_gamemode coopz_difficulty Normalsv_allow_lobby_connect_only 0sv_search_key thursdaycrewsv_alltalk 0sv_allowupload 0sv_allowdownload 1Worth understanding rather than copying:
sv_gametypesis the list of modes the matchmaker is allowed to place on this server. Leaving a mode out means lobbies for that mode never arrive.mp_gamemodeis the mode the server runs right now. Changing it needs a map change to take effect.z_difficultytakesEasy,Normal,HardorImpossible. Expert isImpossible, which surprises everyone the first time.sv_consistency 1makes the server check that client files match its own. It is the difference between a mismatched add-on causing a clear kick and causing an unexplained disconnect in the middle of a finale.sv_steamgroupwith a group id makes the server appear under that Steam group for its members, andsv_steamgroup_exclusive 1restricts it to them. It is the least painful private-server mechanism L4D2 offers.
The AI Director has its own family of cvars - z_common_limit for how many infected exist at once, z_mob_spawn_min_size and z_mob_spawn_max_size for horde size, director_no_bosses to stop Tanks and Witches spawning. Before you put any of them in a config, type the cvar name on its own in the server console: it prints the current value, the shipped default and the flags. Several Director cvars are flagged as cheats and do nothing unless sv_cheats is on or a plugin sets them internally, which is why so many copied configs quietly have no effect.
Ports and getting your group onto the server#
| Port | Protocol | Purpose |
|---|---|---|
27015 | UDP | Game traffic and Steam queries |
27015 | TCP | RCON, with -usercon |
27005 | UDP | Outbound on the client, nothing to open |
Source puts the query on the same port as the game, so a single allocation is enough. If the server runs but nothing can see it, it is UDP 27015 or sv_lan. Game server ports explained covers the general case, and if you do enable RCON, RCON safely is five minutes well spent - the password is the entire authentication and the protocol does not hide it.
In practice, tell your group to do this once: open the developer console, type sv_search_key thursdaycrew, then make the lobby and press start. The key persists for the session. Anyone who joins late uses connect <ip>:27015 instead, which works because you set sv_allow_lobby_connect_only 0.
Add-on campaigns and sv_consistency#
Custom campaigns are .vpk files. On the server they go in left4dead2/addons/, and the server has to be restarted to pick them up. Workshop items download with SteamCMD against the client app id:
$ steamcmd +force_install_dir /home/l4d2/server +login anonymous \ +workshop_download_item 550 <workshop_id> +quitHere is the part that catches every group at least once: the server cannot give a campaign to a player who does not have it. Unlike Garry's Mod, there is no fast-download path that installs a VPK campaign on the client. Everyone subscribes to the same Workshop item, or nobody plays it. Publish the collection link in your Discord, make sure everybody has actually restarted their game after subscribing, and check the version - a campaign updated mid-week will mismatch with players who have not restarted Steam. Steam Workshop mods on dedicated servers covers how those downloads behave in general.
Load order matters less than in most games, but conflicting add-ons - two mutation scripts, two weapon reskins touching the same script file - produce silent weirdness rather than an error. When something inexplicable happens, empty the addons folder and add things back a few at a time. With sv_consistency 1 set, at least a genuine file mismatch announces itself as a kick with a reason instead of a mystery disconnect at the saferoom door.
SourceMod, L4DToolZ and more than four players#
Versus needs eight slots, which changes very little about the sizing. Co-op with more than four survivors changes rather more, and it is not a config setting - the limits are compiled in. The usual route is Metamod:Source with SourceMod on top, plus L4DToolZ, a Metamod plugin whose entire job is unlocking the player limit. It adds:
| Cvar | Purpose |
|---|---|
sv_maxplayers | Human slots on the server |
sv_visiblemaxplayers | How many slots the browser shows |
sv_removehumanlimit | Lifts the built-in human cap |
sv_force_unreserved | Stops the server reserving itself for a lobby |
Set those in left4dead2/cfg/sourcemod/sourcemod.cfg so they are applied after the plugins load. Be honest with yourself about what ten survivors does to the game: the Director was tuned for four, the campaigns were built for four, and past about eight players a co-op run becomes a walk. It is fun, and it is a different game.
SourceMod is also how you get administration at all. Admins go in addons/sourcemod/configs/admins_simple.ini as a Steam ID and a set of permission flags, sm_admin opens the in-game menu, and sm plugins list tells you what actually loaded. The one thing to remember is the same as on any Source server: a game update can break Metamod and SourceMod until both are updated, so do not install a plugin stack the afternoon before a session.
Two bot cvars are worth knowing even on a vanilla server. sb_all_bot_game 1 lets the server run a campaign with no humans at all, which is useful for testing a custom campaign. sb_stop 1 freezes the bots in place, which is how you check whether a performance problem is the bots' pathing or something else.
Troubleshooting#
The lobby starts a game on somebody else's server. No matching sv_search_key, or the leader did not set it. It has to be typed on the client before the lobby is created.
`connect` from the console does nothing. sv_allow_lobby_connect_only is still at its default of 1.
Players are kicked at map load with a file mismatch. An add-on the server has and the client does not, or the reverse. Everyone needs the same VPKs at the same version.
The campaign restarts at chapter one when the last human leaves. That is the server returning to the lobby state. A SourceMod plugin can hold the map, but the behaviour is by design.
Survivor bots stand still or walk into walls. Custom campaigns with a poor navigation mesh. Nothing on the server fixes it; it is built into the map.
The finale stutters for everyone. Tank plus a full horde is the heaviest moment in the game. Check that the server is not sharing a core with something noisy and that no plugin is doing per-frame work. At 30 ticks there is not much headroom to spare.
The server is invisible in the browser. L4D2's browser is unreliable at the best of times. Test with a direct connect first; if that works, stop debugging the server.
Where to run it#
Left 4 Dead 2 does not have a line in the RE:NODE catalogue, so there is no one-click L4D2 plan here to point you at. The two honest options are a general game panel that supports the game, or a VDS you manage yourself - a VDS is comfortably enough for L4D2 and leaves room for a voice server or a second game beside it. Running several game servers on one VDS covers ports, users and keeping the processes alive, and choosing between a VDS and a game panel is the decision itself: a panel gives you a console, backups and schedules without Linux administration, a VDS gives you everything and the responsibility for it.
Whichever you pick, the maintenance list for L4D2 is short. Update the server when the game updates, keep the add-on folder tidy, restart it weekly, and keep a copy of server.cfg somewhere that is not the server.
FAQ#
Do I need a dedicated server for four friends?
Not strictly, but it removes the failure mode that ends most sessions: the host's game crashing or their connection wobbling. It also means the campaign is not tied to one person being online, and nobody has to leave their machine running.
Why does the lobby keep putting us on an official server?
Because that is the default behaviour. Set sv_search_key on your server, have the lobby leader type the same key into their console before starting, and the matchmaker will pick yours.
Can more than four people play co-op?
Yes, with the L4DToolZ Metamod plugin, which unlocks sv_maxplayers and related cvars. The game itself was balanced for four, so expect an easier run rather than a harder one.
Do players need to install custom campaigns themselves?
Yes. The server cannot deliver a VPK campaign to a client. Everyone subscribes to the same Workshop item and restarts their game before you start the run.
How much does an L4D2 server cost to run?
Very little in memory terms - 2 GB covers almost anything - but the install is over ten gigabytes, so pick a plan by its disk rather than its RAM. Location matters more than specification at 30 ticks.
Is 30 ticks the reason it feels laggy?
Partly. L4D2 was built at 30 ticks and there is no supported way to change it, so latency between player and server is the thing you can actually control. Measure the route before assuming the server is underpowered.




Comments
Completely anonymous: no account, no email, no cookie. We store the name you type, the text and the time - nothing else. Links are limited and markup is not rendered.