Skip to content

Dedicated Server Configuration in L4D2 (or how isotoma play zombies)

Here at isotoma, we’re partial to a few evenings spent giggling like maniacs and coming up with inventive ways to kill as many zombies as possible.
Nothing quite like arguing with a coworker whether an aerial kill with a frying pan is better than a survivor steered into a convenient pool of spit.

Naturally, our game of choice is the rather good Left 4 Dead 2.

However, our experience of the L4D2 lobby system has been variable, with some servers being slow, or configured weirdly. The usual answer for this is to run a dedicated server, as has been done since time untold (Quake).

In L4D2, the tools to do this aren’t immediately obvious, and have a nasty habit of changing from patch to patch.
This is a quick note to show the current method that we have found works.
I won’t cover how to install and set up the server, there’s plenty of guides out there to do that, this is how to configure it, and how to start a game on that server.

Server Configuration

In server.cfg, do this (replace things in [] with a value, including the brackets themselves):

hostname “[SERVERNAME]”
sv_region 3
sv_search_key “[AUNIQUEKEY]”
rcon_password "rcon"
sv_lan 0
sv_allow_lobby_connect_only 0

The important part of this is the sv_search_key setting. This should be a unique key (a steam account name is a reasonable bet), and something that you can type into the game console. Do not attempt to set the Steam group settings that you can find documented elsewhere. This will break the search key, and mean you then cannot reliably connect to this exact server.

Run the server with a line similar to:

./srcds_run l4d2 -autoupdate +ip [SERVERIP] +hostport [PORT] +exec server.cfg

SERVERIP should be the public ip of the server machine
PORT should be the port to run the server on (27203 is our favourite)

Once this is done, you should see some nice console lines scrolling by and your server is now up. The search_key setting means that only people with that key will be able to find and connect to the server using the lobby system. You will be able to connect directly using the server ip and port if necessary.


In the game, go to Settings > Keyboard Settings and enable the ‘Developer Console’

To start a lobby game:
From main game screen
Bring down console (~ key, usually next to 1 on a keyboard)
Type: sv_search_key [AUNIQUEKEY]
(This should be the sv_search_key you set above)
Create a game with friends
Do not change the server choice (dedicated, best available etc), leave it as it appears.
You can change game settings, maps etc.

To connect directly:
Bring down console (~ key, usually next to 1 on a keyboard)
Type: connect [server ip]:[port]
This will drop you straight into the server, from where you can invite people to join you.

This is all a bit fiddly, but it works for us. I hope it helps someone who was as equally as lost as me to get this going.