Left 4 Dead 2

Left 4 Dead 2

69 ratings
Left 4 Dead 2 Dedicated Server (SteamCMD) [English/Englisch] [Windows]
By Zeromix
This guide will show you how to set up a server with the SteamCMD.

The following ports must be open:
UDP/TCP 27015-27050

Also you will need 8GB of hard drive disk space.

German Version:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=754702686

I also created a tool, that automates the installation process. You can find this tool here:
https://steamhost.cn/steamcommunity_com/groups/ServerTool
   
Award
Favorite
Favorited
Unfavorite
SteamCMD Download
First of all you need the SteamCMD. You can download it here:
https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
SteamCMD Login
Extract the file in a folder.
Now you need to execute this file.

Dirst we need to setup the download folder:
force_install_dir ./l4d2_ds/


After that, we can login:
login anonymous
Server Files Download
Now you can start the download with:
app_update 222860 validate

If the download was sucessful, you have to type
exit
in the console close the SteamCMD.
Run the Server
The best option is to create a .bat file in your "l4d2_ds" folder (e.g. Run.bat)
You need to create the bat file in this folder:
C:\Steam-Server\l4d2_ds

Edit the .bat file with following code:
start srcds.exe -console -game left4dead2 -secure +maxplayers 4 +map c1m1_hotel

You can also change the port with "-port 27015"
With this, you just created your Server!

Important:
If you host your server on the same machine, you should start L4D2 first and then your server.
Server Configuration
You can create the "server.cfg" in your "l4d2_ds\left4dead2\cfg" folder.
//Base hostname "TEST" sv_search_key "yourkey" sv_password "" // Password protects server rcon_password "ROOT" sv_allow_lobby_connect_only "0" hostfile "my_host.txt" //create custom hostfile else the //file will be overwritten after every update mp_disable_autokick "1" sv_alltalk "0" sv_consistency "1" // 1=Allow custom skins //sv_contact "address@email.com" sv_voiceenable "1" sv_region "255" //sets region to all areas sv_allow_lobby_connect_only "0" //Logs etc sv_log_onefile "0" sv_logbans "1" sv_lan "0" sv_pure "1" sv_cheats "0" //sv_gametypes "coop,versus,survival,scavenge" //sets gametypes //sv_unlag "1" //sv_maxunlag "5" sv_steamgroup "000" //this is your group's steam group id. This option works with or without the quotes. //sv_steamgroup_exclusive "1" //to make it exclusive and private

Sourcemod Plugin, which will fix the steamgroup id bug:
https://forums.alliedmods.net/showthread.php?p=2544331

These code can also be found here:
https://pastebin.com/1i8xK3L4
Backup Link:
https://hastebin.com/axavayoson.cpp

Another config can be found here:
https://www.dropbox.com/s/1241gdmzk32dlmd/L4D2%20Server%20Config.txt?dl=0
MOTD/Serverbanner
You can locate this files in your
C:\Steam-Server\l4d2_ds\left4dead2
folder.

To edit the "Message of the day" just open the "motd.txt" file.

You can change the serverbanner in your "host.txt" file.
Configurate Sourcemod/Add Admins
At first you will need "Metamod Source" you can get it from here.[www.metamodsource.net]
You have to unzip the files in the following folder:
C:\Steam-Server\l4d2_ds\left4dead2

By now there should be an "addons" folder.
Now you need Sourcemod, you can get this here.[www.sourcemod.net]
You can also get the Plugins from there later.

Also extract that in this folder:
C:\Steam-Server\l4d2_ds\left4dead2

For the following you will need your SteamID, you can find yours out here:
http://steamidfinder.com

To configurate an admin, go to:
C:\Steam-Server\l4d2_ds\left4dead2\addons\sourcemod\configs
and open the
admins.cfg


As you can see, you just have to add something like this:
"Zeromix" //A name for yourself { "auth" "steam" "identity" "STEAM_0:1:31843021" "flags" "z" //Access Commands }

You can see the flags in the
admin_levels.cfg
file.

If you have configurate it, write in the chat "!admin" or in the console "sm_admin" to open the menu.

And that´s it! Have fun! ^_^
Frequently Asked Questions
I can not see my server / No one can connect to my server
Please make sure, that you have opened all the required ports in your router. If the everything is set correctly, but the problem still occurs, please contact your internet provider.
Or look for your router model here:
https://portforward.com/router.htm

Is there another way instead of opening the ports?
Yes, you can also host your server through a VPN network like "Hamachi". Of course only the people in the VPN network will be able to join the server then.
If forwarding your ports doesn´t work, please contact your ISP, i won´t be able to help you.

How can i change my server port?
Just edit the bat file with "-port 27015"

The SteamCMD download failed! What should I do now?
Mostly you just need to retry the download, then the problem should be fixed.

How do I update my server?
Just open the SteamCMD and login again, then retry the Step "Downloading the files" it will be checked which files need to be updated.
Server Creation Tool
To automate these steps to setup/upgrade a server, i created a tool, the group can be founde here:
https://steamhost.cn/steamcommunity_com/groups/ServerTool

The tool itself is hosted on Github, which can be found here:
https://github.com/Zeromix9/ServerTool

I hope, that will help you in the future!

If you like, you are also welcome to leave a small donation.
https://paypal.me/Zeromix
167 Comments
Zeromix  [author] 26 Aug, 2024 @ 10:10am 
@Lancer Yes, then the default values should be selected.
And you´re right with your assumptions. :)
Lancer 26 Aug, 2024 @ 6:23am 
Broski. If I don't type -secure and -maxplayers 4 in bat file will those commands have default values? I guess by default game is secure and maxplayera value is not fix, it varies depending on special infected number on map
Zeromix  [author] 13 Jan, 2024 @ 6:23am 
@K IL L ER 20014 U´re welcome, have fun!
qwer2000 13 Jan, 2024 @ 4:16am 
Thank you very much. With this guide I started creating a server.
And created a completely successful project.
Zeromix  [author] 11 Jan, 2023 @ 8:01am 
@Red Well, then is must be something else, that blocks your connectiont.
It could be your AntiVirus/Firewall etc...
Red 10 Jan, 2023 @ 9:34am 
I double checked, my local ip is correct
Zeromix  [author] 10 Jan, 2023 @ 8:43am 
@Red That might be, but maybe you opened it for the wrong internal IP.
Red 10 Jan, 2023 @ 8:00am 
the canyouseeme website tells me that it can see the port
Zeromix  [author] 10 Jan, 2023 @ 7:27am 
@Red If you can only connect through your local IP, something didn´t worked on the forwarding side.
Red 9 Jan, 2023 @ 12:02pm 
Local