Steam Users' Forums How to make your own L4D2 Demo Server
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 Thread Tools Display Modes
10-27-2009, 08:03 PM   #1
p5ychokilla

Join Date: Oct 2006
Reputation: 142
Posts: 1,282
How to make your own L4D2 Demo Windows Server

Just thought I would re-post my L4D setup guide as it's almost exactly the same for L4D2....

Left 4 Dead 2 servers are more or less the same as any other source based game server, Firstly you will need to download the HLDSUpdateTool from here. Unpack that and install the HldsUpdateTool.exe to your desired server location (i.e. C:\HL2Server - I'll use that for the guide from here on)

Open your command window (Go into the run dialog in your start menu and type cmd then enter, the command window will then open. Type the following into it :

HldsUpdateTool.exe -command update -game left4dead2_demo -dir c:\HL2Server

or

HldsUpdateTool.exe -command update -game left4dead2_demo -dir .
to install to the present directory

General info

openserverbrowser - in the console of the L4D client - all games are listed under the custom tab

Banner

File to edit - host.txt
Maximum Dimensions - 500 x 100
Make one line in the txt file :
http link to banner image
example - http://my.example.com/banner.png

MOTD

File to edit - motd.txt
standard motd, same as any other server
or you can have an image as with the host.txt file, using the same method.

The server executable

You will find an exe file in the L4D directory labelled srcds.exe, this is the server executable and the program you need to run to start the server but you need to specify some options after the exe.

i.e. :

srcds.exe -console -game left4dead2 -maxplayers 8 -autoupdate +ip 99.99.99.99:99999 -port 27500 +sv_lan 0 +map c5m1_waterfront

Here are explanations of the different commandline options :
-console : This will display a console that you can type commands into
-game left4dead2 : This specifies the type of server to run, you can use it for CSS, DODS, L4D, etc
-maxplayers 8: This will specify the max number of players the server will allow, setting it to 8 should allow you to use versus mode
-autoupdate : This will make the server check and update to the latest version when you launch it
+ip 99.99.99.99 : This will specify the IP address for the server to run on, this proves useful for running multiple servers on one computer
-port 27500 : This will specify the port for the server to run on
+sv_lan 0 : This will force the server to run on the internet instead of just on a lan
+map c5m1_waterfront : This will specify the map to start the server with, you must add this to the commandline for the server to start

Different types of servers you can run

Public Server

Public Server With Steamgroup Enabled - player is a specified steam group will be able to connect to the server

Private Server With Steamgroup and Search Key Option

Public Server
Quote:
 commandline options -console -game left4dead2 -maxplayers 4 -autoupdate +mapc5m1_waterfront +ip xx.xx.xx.xx -port 27015 -nohltv +sv_lan 0 server.cfg contents // server name hostname myserver // password for rcon rcon_password "rcon_pass" // Difficulty of the current game (easy, normal, hard, impossible) z_difficulty normal
Public Server With Steamgroup Enabled

Quote:
 commandline options -console -game left4dead2 -maxplayers 4 -autoupdate +map c5m1_waterfront +ip xx.xx.xx.xx -port 27015 -nohltv +sv_lan 0 server.cfg contents // server name hostname myserver // password for rcon rcon_password "rcon_pass" // Difficulty of the current game (easy, normal, hard, impossible) z_difficulty normal // this will allow your server to be listed in the server browser setmaster add 68.142.72.250:27011 setmaster add 72.165.61.189:27011 // steam group that has access to the server sv_steamgroup 12345
Private Server With Steamgroup and Search Key Option

Quote:
 commandline options -console -game left4dead2 -maxplayers 4 -autoupdate +mapc5m1_waterfront +ip xx.xx.xx.xx -port 27015 -nohltv +sv_lan 0 -nomaster server.cfg contents // server name hostname myserver // password for rcon rcon_password "rcon_pass" // password for server sv_password private_pass // Difficulty of the current game (easy, normal, hard, impossible) z_difficulty normal // this will allows you to find a server through matchmaking with a specific search string sv_search_key unique_key_for_server // steam group that has access to the server sv_steamgroup 12345 // only for members of certain steam group sv_steamgroup_exclusive 1
Notes

sv_search_key - lets you set up a server that can be found via matchmaking, but only by people with a matching sv_search_key. This allows you to set up a server you or your friends can play on and still use the existing matchmaking lobby to set up avatars, difficulty, map, etc.

To use the sv_search_key here is what you do.

1.) Set sv_search_key on your server.

ex. sv_search_key myserver

2.) Have the host client (the one who will be creating the lobby) set the
same sv_search_key in their console.

3.) Host client should now create the lobby.

4.) Other clients connect. Once the game is ready to be started, have the
host hit start game. Now you should join your server as long as there is a
server available with that search key.

sv_steamgroup - takes the Steam group number (which is now visible on the group's administrative page). The server will still be part of matchmaking, but users that are in that group will be able to browse directly to it from the main menu. Also, if this value is set, there will be a button near the message of the day that allows users to go directly to that group's page. This allows them to join that group if they like, and then be able to browse back to it in the future.

Running your server automatically as a system service

If you don't want to have to click an icon to launch your server or you want it to run automatically when the computer it's on is started you need to run it as a system service.

This guide will explain how to add a system service using the SRVANY package, you can download it here.

Once you have added your service (i.e. Server_L4D2) go into the registry editor, to get this you go into your run dialog as before, then type [i]regedit[/b] and then enter. When the registry editor has opened you need to browse to the following location :

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Server_L4D2 (You can of course replace the Server_L4D2 text with whatever you have called your service)

From the Edit menu, click Add Key. Type the following and click OK:

Key Name: Parameters
Class : <leave blank>

Select the Parameters key.

From the Edit menu, click Add Value. Type the following and click OK:

Value Name: Application
Data Type : REG_SZ
String : srcds.exe

From the Edit menu, click Add Value. Type the following and click OK:

Value Name: AppDirectory
Data Type : REG_SZ
String : C:\HL2Server (or whichever location you installed your server to)

From the Edit menu, click Add Value. Type the following and click OK:

Value Name: AppParameters
Data Type : REG_SZ
String : -console -game left4dead2 -maxplayers 4 -autoupdate +map c5m1_waterfront +ip xx.xx.xx.xx -port 27015 -nohltv +sv_lan 0 -nomaster

Your AppParameters may of course differ so just enter what you need to.

Once you have filled in all the details for your service, go into your run dialog in your start menu again and type services.msc. Your list of services will then display with yours in the list.

Double click on your service name and then in the Startup Type choose if you want the server to run automatically or manually. Now click on the Log On tab and if you want to be able to see the console on your desktop then tick the "Allow service to interact with desktop" box, if you want the service to run invisibly then just untick it. Then click on Apply and OK.

Now if you want to add shortcuts to start or stop your server then create the shortcut with the following target :

Start

NET START Server_L4D2
(You can of course again replace the server service name)

Stop

NET STOP Server_L4D2
(You can of course again replace the server service name)

If you want to add a shortcut to restart the server then just create a restart.bat file somewhere (preferably in the same folder as your server) with the following contents :

Quote:
 NET STOP Server_L4D2 NET START Server_L4D2
Now create a shortcut to the restart.bat file you just created, this shortcut is what you will click to restart your server.

Please let me know if you spot any errors, this is by no means a definitive guide. I am just trying to compile all the info I have found into one spot. If you have anything to add or change please feel free to suggest accordingly.

Now get to work and make those dedicated servers !

Last edited by p5ychokilla: 10-27-2009 at 08:15 PM. Reason: Title change

 10-28-2009, 11:27 AM #2 Maxboom      Join Date: Aug 2008 Reputation: 0 Posts: 67 You have miss a space here ; )
 10-28-2009, 12:56 PM #3 RosietheRiveter     Volunteer Moderator Join Date: Sep 2003 Reputation: 238 Posts: 2,085 good catch Max and gj p5ychokilla for getting the guide together
 10-29-2009, 08:16 AM #4 preset   Join Date: Oct 2009 Reputation: 0 Posts: 23 Did anyone get the sv_password to function properly? It seems that it has been disabled for l4d2 demo for the moment.
 11-06-2009, 01:28 PM #5 mrhappypants   Guest Posts: n/a sv_search_key doesn't seem to be working for me, has anyone had any luck with sv_steamgroup? Also anyone figure out an easy way to keep the server cycling the maps? It keeps crashing after the end of the 2nd level and I either have to restart the server or change the level in game, which caused Ellis to be removed one time. I have the mapcycle and maplist file repeating the same 2 maps (c5m1 and c5m2) about 20 times, but it always tries to load c5m3 and crashes.
 11-07-2009, 08:34 AM #6 Mock2zuma   Guest Posts: n/a Need a little bit of clarification on: srcds.exe -console -game left4dead2 -maxplayers 8 -autoupdate +ip 99.99.99.99:99999 -port 27500 +sv_lan 0 +map c5m1_waterfront When I try to put that behind "srcds.exe" in properties to basically change it to look like the above, it says "this may be unstable" and then I can't execute it. It's probably something simple that I'm overlooking. I tried executing it as a cmd too, but this is what I get http://img9.imageshack.us/img9/5109/srcds.jpg Just out of curiosity, you set 99.99.99.99 to your actual IP right? Thx in advance.
11-08-2009, 08:14 AM   #7
butlerForNobody

Banned
Join Date: Aug 2009
Reputation: 20
Posts: 453
this guide doesn't work with on my windows (russian)

i type in

HldsUpdateTool.exe -command update -game left4dead2_demo -dir c:\HL2Server

it tells me
Quote:
 "HldsUpdateTool.exe -command update -game left4dead2_demo -dir c:\HL2Server" is not an internal or external commands, operable program or batch file.
i tried changing location and nothing

>.>

no rep for you

 11-11-2009, 12:18 PM #8 jim2006193   Banned Join Date: Mar 2009 Reputation: 2 Posts: 169 having a bit of a problem here, not sure what the problem is. http://darkvendetta.com/images/l4d2.PNG here is my cmd line: -console -game left4dead2 -maxplayers 8 -autoupdate +mapc5m1_waterfront +ip 10.0.0.131 -port 27015 -nohltv +sv_lan 0
 11-11-2009, 03:19 PM #9 jim2006193   Banned Join Date: Mar 2009 Reputation: 2 Posts: 169 Oh, i missed the space thing, fixed that, but it still isn't working.
 11-17-2009, 06:20 AM #10 to3cutter   Join Date: Mar 2008 Reputation: 0 Posts: 21 Realism server config please.
11-17-2009, 01:29 PM   #11
mrhappypants

Guest
Posts: n/a
Quote:
 Originally Posted by butlerForNobody this guide doesn't work with on my windows (russian)
I couldn't get that to work for the life of me on windows XP, so used the shortcut method.

1. Right click the HldsUpdateTool.exe and make a shortcut.
2. Right click on the shortcut and select properties.
3. Add your commands after the part already there, ex. "xxx/xxxx/xxxx.exe -command update -game left4dead2_demo -dir c:\HL2Server"
4. Run the tool to install/update your server, you can also rename the shortcut at this point to indicate what game it's updating.

 11-17-2009, 03:57 PM #12 Aurien   Join Date: Jul 2007 Reputation: 15 Posts: 423 This guide needs to be updated badly. There is some really messed up information here.-autoupdate - Need to clarify that this only works for linux dedicated servers and not windows dedicated servers. -maxplayers 4 - Does not need to be set to 4 or 8. It will determine the max by the game type. Adding stuff that is unnecessary. z_difficulty normal - Another thing that doesn't need to be set. Difficulty is always set by the lobby. Unless you plan on never using the lobby, this is not needed. // this will allow your server to be listed in the server browser setmaster add 68.142.72.250:27011 setmaster add 72.165.61.189:27011 - Servers don't need this set. If you're having problems with your server reporting to the master server's there is a problem with your network. So another useless thing we're adding to server configs that make them long and complicated. -nomaster - Why would you ever not want your server not reporting to the master server list? Plus the fact that there is no explanation of what this command line options does. So you're going to have people copy/paste and have problems. -nohltv - HLTV never worked in L4D and I've heard nothing of it working in L4D2. Even if it did work, it's not something that's on by default. It has to be specifically setup in the server.cfg. Another useless launch option. I appreciate what you're trying to do, but putting out incorrect or wrong information does nothing but cause problems. And if you don't explain what stuff does or why you need it, then people won't ever learn.
 11-18-2009, 03:19 PM #13 ricejammer1   Guest Posts: n/a Is it possible to setup a L4D2 Dedicated Server to play all game modes depending on what mode is selected from a Lobby? If so, can someone post up the correct setting for the server and clients?
11-18-2009, 03:50 PM   #14
Aurien

Join Date: Jul 2007
Reputation: 15
Posts: 423
Quote:
 Originally Posted by ricejammer1 Is it possible to setup a L4D2 Dedicated Server to play all game modes depending on what mode is selected from a Lobby? If so, can someone post up the correct setting for the server and clients?
That's the default behavior for L4D2 servers. The sv_gametype command is used if you want to limit the type of games that lobbies can create on the server. Example server.cfg

Code:
// this is your server name as shown in the server list
hostname "Server Name"

// start rcon settings

// your rcon password to log into the dev rcon console or HLSW rcon console

// end rcon settings

// steam search key
// sv_search_key key

// The resion of the world to report this server is
sv_region 0

// Contact email for server sysop
sv_contact contact@email.com

// Players can hear all other players' voice communication, no team restrictions
sv_alltalk 0

// start execute ban files

exec banned_user.cfg
exec banned_ip.cfg
Change the orange values and the green value can be uncommented and changed if you wish to use it. If you use the search key only lobby hosts who enter that search key will be able to start a game on the server. But this is a basic server config that will get you up and running.

Side not if you're going to use the search key option. Go to \Steam\steamapps\common\left 4 dead 2\left4dead2\cfg directory. If you haven't created one yet, make a file called autoexec.cfg. Open it with Notepad and add the following line:
Code:
sv_search_key key
Of course replace key with your actual search key. Now you don't have to enter it into console again.

 11-18-2009, 03:59 PM #15 ricejammer1   Guest Posts: n/a So, if I force my client to always connect to my specific dedicated server by adding the "mm_dedicated_force_servers ip: port" in my autoexec.cfg, I can just pick the game mode based on the lobby game type I started? Thanks for your quick reply.

 Steam Users' Forums How to make your own L4D2 Demo Server

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

All times are GMT -7. The time now is 11:55 PM.