Down to the Last Save make that save roll!

27Oct/0934

Left 4 Dead 2 Dedicated Server Setup

So the Left 4 Dead 2 early access demo for the PC and 360 goes live Tuesday and I figured I should grab it and setup a Left 4 Dead 2 dedicated server. Getting the files was easy, but setting up and getting the Left 4 Dead 2 dedicated server up wasn't.

The setup process for running your own Left 4 Dead 2 dedicated should be the same as my previous guide on a Left 4 Dead dedicated server but with a few tweaks. Sharing my steps for setting up a Windows Left 4 Dead 2 dedicated server will save everybody else some time and effort.


I am using a Windows host, so if you are using linux you will have to follow DOA's write up setting up a Left 4 Dead dedicated server on Ubuntu.

The main tool needed is the hldsupdatetool from Steam. You can go and grab the Windows version is located on the bottom right of the page. Open up the command prompt (Go to Start Menu-->Run type cmd and hit enter). Now go to the directory where you installed the hldsupatetool.

For me it looks like this:

C:\HLServerhldsupdatetool -command update -game left4dead2 -dir C:\HLServer

Easier way is to make a batch file and put that command into it; you can use that batch file to keep your Left 4 Dead 2 dedicated server updated. Just put the command into a text file and change the file extension to .bat

That command will hit Valve's server and grab all the files you need for your Left 4 Dead 2 Dedicated server; this is also how you keep your dedicated server up to date. Pretty easy to do (sofar).

Now what you should do is head to \HLServer\l4d\left4dead2 and make two text files named mapcycle.txt and maplist.txt.
Next head to HLServer\l4d\left4dead2\cfg and make a text file named server.cfg and put this in as a minimum:

hostname Server Name Here
// Rcon Cvars
rcon_password "your recon password" //Set's remote control password
// Server Cvars
mp_disable_autokick 1 //Prevents a userid from being auto-kicked
sv_allow_wait_command 0 //Allow or disallow the wait command on clients connected to this server.
sv_alltalk 0 //Players can hear all other players, no team restrictions
sv_alternateticks 0 //If set, server only simulates entities on even numbered ticks.
sv_clearhinthistory 0 //Clear memory of server side hints displayed to the player.
sv_consistency 1 //Whether the server enforces file consistency for critical files
sv_contact "your_admin@whatever.com" //Contact email for server sysop
sv_downloadurl "" //Location from which clients can download missing files

// Lan or internet play, Server region cvars
//sv_lan 0 //If set to 1,Server is a lan server ( no heartbeat, no authentication, no non-class C addresses )
sv_region 255 // Region Codes: 0 - US East coast, 1 - US West coast, 2 - South America, 3 - Europe, 4 - Asia, 5 - Australia, 6 - Middle East, 7 - Africa, 255 - world

// Server Logging
sv_log_onefile 0 //Log server information to only one file.
sv_logbans 1 //Log server bans in the server logs.
sv_logecho 0 //Echo log information to the console.
sv_logfile 1 //Log server information in the log file.
//sv_logflush 0 //Flush the log file to disk on each write (slow).
sv_logsdir "logs" //Folder in the game directory where server logs will be stored.

//Server Rates
sv_maxcmdrate 100 //(If sv_mincmdrate is > 0), this sets the maximum value for cl_cmdrate.
sv_unlag 1
sv_maxunlag .5

You could probably put more cvars and whatnot in there, but for now this will give you a basic setup that will get you going. From what I have seen, you could use a Team Fortress 2 config generator, but I am not sure what will work and what wont.

The final step for getting your Left 4 Dead 2 Dedicated server up is to start it. This is done by either the command line, a batch file or making a shortcut to the srcds.exe in your left4dead 2 directory. I did it the last way and added this command to the end of the Target parameter (after making a shortcut on my desktop):

-console -game left4dead2 +ip "your ip address" +hostport 27015 +"map" c5m1_waterfront.bsp

All you have to change is the ip address and put in the mapname (take out the "" characters) and your Left 4 Dead 2 dedicated server will be up and running in no time. By having the -console in there, it will bring up a console of the server when you double click on the shortcut, making for easy administration. The +map will start your server with the specified map. If you don't have it, your server won't work properly.

If you have any questions, leave a comment or follow me on twitter and I will help you with setting up your Left 4 Dead 2 dedicated server as best as I can.

If you need to contact me for help, you can follow me on Twitter

Edit: I was unable to get it to work with the shortcut to SRCDS.exe, but after you configure your server.cfg, just launch the SRCDS.exe manually and it will pick up on your server config file. That was quick, thanks to the comments I changed the article to reflect how to get it server started.

edit: If you want to connect to your own L4D 2 Dedicated server, use this command BEFORE starting the lobby: mm_dedicated_force_servers ServerIP . You also have to be the lobby leader. Replace the ServerIP with the IP of your server and it will connect to yours. Make sure that it isn't full though.

Here are some related posts

Comments (34) Trackbacks (3)
  1. It should be about the same, you just need to grab the HLDS program and run it with the arguments to get L4D2. (Should be the same as the windows one, just change the Directory arguments)

  2. what’s the difference between +hostport and just +port
    ?

  3. hostport is what the CLI uses to set the port the L4D2 server is going to bind to. If you dont set it, it defaults to 27015. I don’t believe +port will do anything for you

  4. Can anyone suggest a reliable Dedicated Server hosting that is not very expensive?’*~

  5. I have set several “Cvars” in my server.cfg, but I get this for every line:

    Unknown command “sm_cvar” any ideas?

  6. need sourcemod for that.

  7. Dedicated servers are the best when you want a stable webhost. ‘,-

  8. how to set versus game mode and max players for dedicated server ?

  9. when possible, i always use a dedicated server for my webhosting needs eventhough it is expensive.”"


Leave a comment