How to Set Up a Left 4 Dead 2 Dedicated Server
Install a Left 4 Dead 2 dedicated server on Linux using SteamCMD (AppID 222860). Covers anonymous login, srcds_run binary, GSLT token requirement, and your first launch command.
Left 4 Dead 2 Dedicated Server Setup
L4D2 dedicated servers run on Linux via Valve's SRCDS (Source Dedicated Server) system. Installation is handled by SteamCMD with anonymous login.
Step 1 — Install SteamCMD
sudo apt-get install lib32gcc-s1 -y
mkdir ~/steamcmd && cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
Step 2 — Download Server Files
L4D2's dedicated server AppID is 222860. Anonymous login is used — no Steam account required.
~/steamcmd/steamcmd.sh \
+force_install_dir /home/steam/l4d2-server \
+login anonymous \
+app_update 222860 validate \
+quit
This downloads approximately 13 GB. The validate flag verifies all files after download — always use it on first install.
Step 3 — Get a GSLT Token (Required for Public Visibility)
L4D2 servers must have a Game Server Login Token (GSLT) to appear in the server browser. Without it, your server will run but be invisible to public players.
- Go to steamcommunity.com/dev/managegameservers
- Log in with your Steam account
- Enter App ID 222840 (this is the game's AppID, not the server AppID)
- Click Create and copy the generated token
Keep this token private — it's tied to your Steam account.
Step 4 — First Launch
The server binary is at /home/steam/l4d2-server/srcds_run.
cd /home/steam/l4d2-server
./srcds_run -console \
-game left4dead2 \
-secure \
-port 27015 \
+maxplayers 8 \
+sv_setsteamaccount YOUR_GSLT_TOKEN \
+exec server.cfg \
+map c1m1_hotel
Key launch flags:
| Flag | Description |
|---|---|
-console |
Enable console output |
-game left4dead2 |
Specify the game |
-secure |
Enable VAC anti-cheat |
-port 27015 |
Game port (UDP and TCP) |
+maxplayers 8 |
Max concurrent players |
+sv_setsteamaccount TOKEN |
GSLT token for public listing |
+exec server.cfg |
Load your config file |
+map c1m1_hotel |
Starting map |
Step 5 — Create server.cfg
The config file lives at left4dead2/cfg/server.cfg. Create it if it doesn't exist:
mkdir -p /home/steam/l4d2-server/left4dead2/cfg
nano /home/steam/l4d2-server/left4dead2/cfg/server.cfg
Minimal contents:
hostname "My L4D2 Server"
rcon_password "YourSecureRconPassword"
sv_password ""
mp_gamemode "coop"
See the L4D2 Server Configuration article for a full reference.
Keeping the Server Updated
~/steamcmd/steamcmd.sh \
+force_install_dir /home/steam/l4d2-server \
+login anonymous \
+app_update 222860 \
+quit
Stop the server before updating to avoid file conflicts.
Directory Structure
l4d2-server/
├── srcds_run ← launch script
├── srcds_linux ← actual binary
└── left4dead2/
├── cfg/
│ └── server.cfg ← server configuration
├── addons/ ← mods, SourceMod, MetaMod, custom maps (VPK)
└── maps/ ← custom BSP map files