After you have downloaded SteamCMD, extract the steamcmd.exe to a folder on your server drive.
Note: This guide will use the default directory of the root of Hard Drive: E:\
This makes it easier to send the directory command as it is shorter.
However, you can paste text to CMD prompts by right clicking in the CMD header:
Run the steamcmd.exe to install the tool's files, the dialog will appear installing files:
Note: Do not install server files within the SteamCMD folder.
While SteamCMD is downloading the tool, go ahead and setup your server directory.
This guide uses the root of a Hard Drive: E:\L4D2
Note: Using the root of a Hard Drive makes it easier to navigate through file structures and execute Change Directory (cd) commands in SteamCMD, however remember you can paste your server directory into the prompt should you decide to place it alongside the Left 4 Dead 2 game folder in your Steam Client Directory:
E:\Program Files (x86)\Steam\SteamApps\common\Left 4 Dead 2 Dedicated Server
You can make a folder anywhere except within the SteamCMD folder!
Once SteamCMD has completed downloading its files, the dialog box will look like:
Left 4 Dead 2 uses the APPID 222860, you can login anonymously to download the server files (see all app ID's here):
Assuming you have already created your server folder (E:\L4D2) send the following:
app_update 222860 validate
Note: Use your server directory!
Note: Here is a list of all Steam Application ID's for reference to installing other server games.
This process is the same for all game servers, they just have a different (unique) Application ID
This may take some time to download all the necessary files, when complete:
Send the quit command and hit Enter:
This concludes the process of obtaining the server files.
There are many resources out there for Port Forwarding. This guide is aimed at servers that are hosting on a provider or system other than the game client. This guide will work for Listen Servers (Listen Servers are servers hosted on the same Computer that you play the game on)
Those creating a Listen Server will encounter Port Forwarding issues which if you know how to access your router control panel, is an easy fix. For those not familiar with the process, please utilize Google and other resources such as the ones below for assistance in forwarding your ports.
If you are hosting your server on a game server provider (GameServers, VPS (Virtual Private Server such as NFOServers) or a host that you actually pay for, then you don't need to worry about this as your provider should have all ports forwarded automatically depending on what server you are hosting. By default the L4D2 port is 27015 however it may have a range from 27015-27020 or more.
The cfg file is what contains the settings (in the form of cvars) for your server.
By default the server.cfg does not exist after installing and creating your server. You will need to create one: Here[www.dropbox.com] is a very detailed server.cfg Here[www.dropbox.com] is a standard L4D2 server.cfg
Note: Be sure to rename these files to "server.cfg" should you decide to download and install to your server!
To create a new server.cfg, create the cfg within a text editor such as notepad, or Sublime Text[www.sublimetext.com] or notepad++[notepad-plus-plus.org] and save the file as server.cfg
The server.cfg file should be located at:
Create this file using notepad, simply right-click in the folder and select New⇒Text Document. Don’t name it anything yet; just creat a blank text file.
// means the server will ignore everything behind // on that line, so if you want to stop using a variable, put // in front of it - this is commonly referred to as "commenting out" which tells the server to ignore that command/cvar.
Every variable has to be put on its own line, or else it will not be read/executed and the server console may report an error about it so you can narrow down the issue.
If you have spaces somewhere (the name of the server for example), be sure to write it between quotes.
hostname "Use quotes with spaces"
Here are some explanations on the most important variables:
sv_maxupdaterate 100: This variable sets the maximum amount of updates the server will send to each client per second. If you set this to 100, your server will run optimally because the tickrate automatically adjusts this value. Having a tickrate of 33 will make this variable 33 as well. Thus, a setting of 100 for this variable is more or less a “one size fits all.”
sv_minupdaterate 20: This variable is the opposite of maxupdaterate. During the years I’ve been hosting servers, I’ve found out that when the updates drop below 20 per second, clients start to experience lag. That’s why we set this to 20; just like maxupdaterate, this value fits all servers.
sv_maxrate: This variable probably has the most impact on the quality of the server performance. It’s the maximum amount of data sent to one client per second. If you don’t have a great connection, you can set this variable to make your server run perfectly. As I explained above, this has something to do with the maxplayers of the server. To calculate this variable we use a formula; it’s simple and 90% accurate.
Here[www.dropbox.com] is an example server.cfg file you can download and edit. Just be sure to name it server.cfg
hostname "Your Server Name Here"
// This states how players should contact you
// # of rounds to play (versus)
// Use a search key to find the server in the lobby
// STEAM GROUP
//FRIENDLY FIRE 1=ON 0=OFF
sm_cvar survivor_friendly_fire_factor_easy 1
sm_cvar survivor_friendly_fire_factor_expert 1
sm_cvar survivor_friendly_fire_factor_hard 1
sm_cvar survivor_friendly_fire_factor_normal 1
sv_gametypes "coop, versus, mutation"
sm_cvar mp_gamemode coop
//sm_cvar l4d_maxplayers "8"
//sm_cvar l4d_survivor_limit "8"
//sm_cvar sv_removehumanlimit "1"
mp_disable_autokick 1 //(command)prevents a userid from being auto-kicked (Usage mp_diable_autokick )
sv_allow_wait_command 0 //default 1; Allow or disalow the wait command on clients connected to this server.
sv_alternateticks 0 //defulat 0; (singleplayer)If set, server only simulates entities on even numbered ticks.
sv_clearhinthistory 0 //(command)Clear memory of server side hint displayed to the player.
sv_consistency 0 //default 1; Whether the server enforces file consistency for critical files
sv_pausable 0 //default 0; is the server pausable
sv_forcepreload 1 //default 0; Force server side preloading
sv_pure_kick_clients 0 //default 1; If set to 1, the server will kick clients with mismatchng files. Otherwise, it will issue a warning to the client.
sv_pure 0 //If set to 1, server will force all client files execpt whitelisted ones (in pure_server_whitelist.txt) to match server's files.
//If set to 2, the server will force all clietn files to come from steam and not load pure_server_whilelist.txt. Set to 0 for disabled.
sv_voiceenable 1 //default 1; enable/disable voice comm
sv_alltalk 1 //default 0; Players can hear all other players' voice communication, no team restrictions
log on //Creates a logfile (on | off)
sv_logecho 0 //default 0; Echo log information to the console.
sv_logfile 1 //default 1; Log server information in the log file.
sv_log_onefile 0 //default 0; Log server information to only one file.
sv_logbans 1 //default 0;Log server bans in the server logs.
sv_logflush 0 //default 0; Flush the log files to disk on each write (slow).
sv_logsdir logs //Folder in the game directory where server logs will be stored.
// execute banned.cfgs at server start. Optimally at launch commandline.
exec banned_user.cfg //loads banned users' ids
exec banned_ip.cfg //loads banned users' ips
writeip // Save the ban list to banned_ip.cfg.
writeid // Wrties a list of permanently-banned user IDs to banned_user.cfg.
//Network Tweaks - Increase network performance
rate 10000 //default 10000; Max bytes/sec the host can recieve data
sv_minrate 15000 //default "5000"; Min bandwidth rate allowed on server, 0 = unlimited
sv_maxrate 30000 //default "0"; Max bandwidth rate allowed on server, 0 = unlimited
sv_mincmdrate 20 //default 0; This sets the minimum value for cl_cmdrate. 0 = unlimited [cevo=67]
sv_maxcmdrate 33 //default 40; (If sv_mincmdrate is > 0), this sets the maximum value for cl_cmdrate. [cevo=101]
Now after you have successfully created your server.cfg file, upon executing the command
in the server console or when you start up and launch your server you shouldn't get the
Every time a player enters a Left 4 Dead server online, a message of the day screen welcomes them. There’s a default MOTD, but if you’re paying for your own server, you probably want to customize it. This guide will show you how.
First, we’ll look at the actual MOTD screen:
There’s two sections that you are able to customize: the host banner on top and the message of the day which takes up the majority of the screen on the bottom. These two sections are actually just web pages (html files), which can be entered into the files on the server or hosted on your own web server/web host. The two files to control these sections are “host.txt” for the host banner, and “motd.txt” for the MOTD. You can find these in your server’s L4D directory at l4d/left4dead/. Note that this is NOT the same directory as the server.cfg file that you use to change server settings. The server.cfg file is located in l4d/left4dead/cfg/.
The default host banner and MOTD run off of Valve’s web servers. The default host.txt and motd.txt files contain only one line which is a URL to the website you wish to have displayed. You can either use this method if you have your own hosting or you can just fill the .txt file with HTML code. If you have multiple servers with the same banner, it’s best to use web hosting so you only have to change the banner in one place.
One very important thing to realize about the MOTD and host banner is that they change sizes depending on the resolution the player is running at. The following values are in pixels, you can click on the screen resolutions to see what the MOTD looks like on that resolution:
The ratio of width to height for the host banner is 5:1, and the ratio of width to height is 2:1. You have two choices with the host banner: either make it one large size and have it be cropped for people on lower resolutions (which is what I believe Valve does), or you can use some CSS in your HTML code to automatically resize the banner no matter what resolution a player is using. This is the method we use, and it’s a simple little trick.
That’s all it is! The title doesn’t show up anywhere, so it’s not important. The body styling is to make sure the image appears in the very top left, with one pixel of padding, and a background color for when the image is loading. The image tag has a style of 100% width and height. If you go to that page in your browser, it’ll look really messed up. But since you know for a fact that every resolution has a 5:1 ratio for the host banner, it will always look fine and be in the same proportions. One little bug: on 1920×1080, when you first get into the game sometimes the banner is sized strangely (pic). Hopefully this gets fixed.
The MOTD section is the same as the host banner – it can be either a hosted HTML file (place the URL on a single line in the top of the .txt file) or you can just put the HTML code directly into the text file. All we have is a simple background image with some centered text, you can see it/view the source here if you need an example.
If your MOTD is not showing up, you might have to set motd_enable 1 in your server.cfg.
That’s all there is to it! Head to our forums if you need any help.
SourceMod & MetaMod
Download the latest SourceMod and MetaMod Releases:
These files are copied to the same location as the existing addons folder![/u]
NOT >IN< the addons folder!
For the love of all things...read the plugin author's release post. It will detail the config cvars and other necessary files you may need to include!
See the L4D2 Plugins[www.sourcemod.net] that you can install on your server.
Adding Admins Edit the admins_simple.ini file, which is located in: \addons\sourcemod\configs\admins_simple.ini
You can use your Steam Name, however keep in mind that anyone can change their name to yours and connect to your server with admin flags.
I suggest using your SteamID[steamidfinder.com]. You can type status in the console which will return all connected players SteamID's
// Examples: (do not put // in front of real lines, as // means 'comment')
// "STEAM_0:1:16" "bce" //generic, kick, unban for this steam ID, no immunity
// "!127.0.0.1" "99:z" //all permissions for this ip, immunity value is 99
// "BAILOPAN" "abc" "Gab3n" //name BAILOPAN, password "Gab3n": gets reservation, generic, kick
That is MY SteamID for example purposes, just replace it with your ID.
After you edit that, just upload the addons & cfg folders to your server where the existing addons & cfg folders are. Failure to copy these files to te right location will result in SourceMod failing to load.
After you have uploaded the files, restart the server and send this command:
sm plugins list
If Unknown Command sm is returned, then the files were not installed properly:
You've just installed sourcemod and made sure that it's working. For that you did the instructions in the Checking the Install chapter and issued some first commands in the server console.
Get more familiar with the console, either directly or preferably via rcon (e.g. by using HLSW).
Try at least these commands:
sm plugins list
sm plugins reload 1
sm plugins refresh
sm plugins unload funvotes
sm plugins load funvotes
sm exts list
/gamedata If an extension or a plugin is using functionality provided by the game engine, e.g. Respawn a player or equipping a player with a weapon, sourcemod needs to know a few "facts" (to be precise: offsets and signatures) about the function. These can change after valve releases an update. At this point you don't need to know more about this, because sourcemod has an integrated updater, which automatically fetches the new gamedata files for you.
/logs The holy grail of debugging your actions. Everything will be logged here. If someone asks you what the logfiles are saying or whether you get any errors: reproduce your problem, then take a look at the logfiles and just copy&paste the messages. Don't try to be smart here and post what you think the given errors are saying, just post the lines. Or fix the problem yourself if you understand the error.
/plugins All plugins (.smx files) in this directory will be loaded automatically when sourcemod starts. Plugins will also be reloaded on mapchange if their file has changed.
/plugins/disabled Plugins in this sub-folder won't be loaded. Move plugins from the parent directory to this one to disable a plugin and vice-a-versa. You will find some official alliedmods plugins in this directory you might want to install (e.g. rockthevote) and some others you want to disable by moving them here (e.g. funvotes).
/scripting You can find the sourcecode to plugins in this directory, at least the original alliedmods ones. You don't need to place any files here to install a plugin, but it is highly recommended to not only install the smx files, but also their corresponding sp file.
/translations Not much to say about this folder, it contains translations for many languages. Plugins are encouraged to provide translation files, so you might need to copy some files in here when installing a plugin.
You will find it very convenient to bind sm_admin to a keyboard shortcut rather than type the command in console every time you wish to bring up the sm_admin menu
Binding commands in the console is the same for all cvar/console commands:
bind <KEY> <COMMAND>
bind i sm_admin
For commands/names with spaces and variables:
bind - "sm_givepoints Knappy 999"
Chat commands such as !buy, !repeatbuy, !machine, !mapvote, !drop etc etc are used in the following manner:
!BUY = SM_BUY
The ! replaces SM_ in the console so players can enter the command in chat rather than console. This however will quickly fill your chat box with !commands. Simply replace the ! with sm_ in the console.
IP should be your internal ip (ip of the computer you are hosting the server on). Port is obviously the port (or one of the ports) that you've opened with port forwarding.
The console parameter will let your server run in a cmd/command line style text interface. This is what most people do. I used to use the GUI interface in the past (the good ol' CSS days) but I haven't tried since then. Not even sure if it works anymore actually.
Important: If you move your bat files outside of the serverroot folder you need to supply the full path of the srcds.exe. As standard it will look for the exe file in the folder where the bat file is run from.
The game parameter tells the executable what game it should be hosting. It accepts either a path to a gameinfo.txt (can be found under the Left 4 Dead 2 subfolder) or a preset value (see this spread).
sv_lan will define whether your game is only available on your own local network or via the internet. It should be set to 0 unless you are only planning on running a local server. Normally this parameter defaults to 0 but I have been told that you can run into trouble seeing the server online if you don't specify it.
Note: Replace the srcds directory and IP's with yours![/b]
Some basic console commands. You will more than likely use sm_admin (SourceMod) for your admin controls:
addip <minutes> <IP> Bans a player by IP address for a specified number of minutes. Entering 0 for minutes is a permanent ban.
banid <minutes> <SteamID> Bans a player by SteamID for a specified number of minutes. Entering 0 for minutes is a permanent ban.
banid <minutes> <SteamID> kick Bans a player by SteamID for a specified number of minutes and kicks them from the server. Entering 0 for minutes is a permanent ban.
changelevel <map> Changes the server to the specified map. For a full list of maps, type: maps * in the console.
dropclient <UserID> Kicks a client by their UserID. To find a full list of UserID’s on the server, type: users in the console.
heartbeat Manually sends a heartbeat to the master server.
info <SteamID> Displays user information about the requested client based on SteamID.
kick <Player> or <UserID> Kicks a user by Player name, or UserID. To find a full list of UserID’s on the server, type: users in the console.
listid Lists all SteamIDs in your server ban list.
listip Lists all IP addresses in your server ban list.
maps <partial name> Lists all maps containing a partial name, for example: maps de_ would list all maps with de_ in their name.
More than 4 Players in Co-Op?
This section is all over the place but dumbs it down so one can understand better!
More than four (4) players in Online Cooperative Campaign (Co-Op for short) is possible...however you will have to compromise!
It is possible to have more than four players in Co-Op but NOT while in a lobby reservation.
What is a Lobby Reservation?
Sorry, it's not your reservation for the ballroom at the Hilton. Basically what this means regarding SRCDS is players can join a reserved server and disconnect at will and the matchmaking magic thingy will find new people to replace the player that just disconnected.
How do I tell if my server is reserved?
The status command will return either unreserved (as above) or a reservation code:
How do I make my server reserved?
Generally what I will do is send this command before connecting (via lobby) to my server:
What does this have to do with more than 4 players in Co-Op?
You will have to sm_unreserve the server once you have 4 people. This means your server will no longer have a lobby reservation and in order to get new people on the server, they must either connect directly through either the server browser or console.
So how I does has moar than 4 people?
You read up on these plugins before you go throwing them onto your server!