Left 4 Dead 2 is a cooperative first-person shooter developed by Valve. Set in the aftermath of a zombie apocalypse, teams of four survivors fight through hordes of infected across various campaigns. The game features intense co-op action, versus mode, and extensive modding support through the Source engine.
27015 (UDP)27015 (TCP, same as game port)27020 (UDP, optional)Note: Source engine games use the same port for both UDP (game traffic) and TCP (RCON). If you run multiple L4D2 servers on one machine, use different ports (27016, 27017, etc.) and adjust your startup parameters accordingly.
sudo ufw allow 27015/udp comment 'L4D2 game port'
sudo ufw allow 27015/tcp comment 'L4D2 RCON'
sudo ufw allow 27020/udp comment 'L4D2 SourceTV'
sudo ufw reload
sudo firewall-cmd --permanent --add-port=27015/udp
sudo firewall-cmd --permanent --add-port=27015/tcp
sudo firewall-cmd --permanent --add-port=27020/udp
sudo firewall-cmd --reload
# Run in PowerShell as Administrator
New-NetFirewallRule -DisplayName "L4D2 Game/RCON" -Direction Inbound -Protocol UDP -LocalPort 27015 -Action Allow
New-NetFirewallRule -DisplayName "L4D2 RCON TCP" -Direction Inbound -Protocol TCP -LocalPort 27015 -Action Allow
New-NetFirewallRule -DisplayName "L4D2 SourceTV" -Direction Inbound -Protocol UDP -LocalPort 27020 -Action Allow
sudo iptables -A INPUT -p udp --dport 27015 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 27015 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 27020 -j ACCEPT
sudo service iptables save
# Install SteamCMD
sudo apt update
sudo apt install steamcmd
# Create server directory
mkdir -p ~/l4d2-server
cd ~/l4d2-server
# Download server files
steamcmd +login anonymous +force_install_dir ~/l4d2-server +app_update 222860 validate +exit
# Download SteamCMD from https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
# Extract to C:\steamcmd\
# Run CMD as Administrator
cd C:\steamcmd
steamcmd.exe +login anonymous +force_install_dir "C:\L4D2Server" +app_update 222860 validate +exit
Create left4dead2/cfg/server.cfg with your settings:
// Server Name and Info
hostname "My Left 4 Dead 2 Server"
sv_steamgroup "" // Steam group ID (optional)
sv_steamgroup_exclusive 0
// Server Settings
sv_lan 0
sv_region 1 // 0=US East, 1=US West, 2=South America, 3=Europe, etc.
sv_allow_lobby_connect_only 0
sv_gametypes "coop,versus,survival,scavenge"
// RCON
rcon_password "your_secure_password"
// Communication
sv_voiceenable 1
sv_alltalk 0 // 0=team only, 1=all players
// Logging
log on
sv_logbans 1
sv_logecho 1
sv_logfile 1
sv_log_onefile 0
// Rates
sv_minrate 30000
sv_maxrate 100000
sv_mincmdrate 30
sv_maxcmdrate 100
sv_minupdaterate 30
sv_maxupdaterate 100
// Download Settings
sv_allowdownload 1
sv_allowupload 1
net_maxfilesize 64
// Game Rules
mp_disable_autokick 1 // Don't auto-kick idle players
sv_consistency 1
sv_pure 1 // Server purity (1=enforce consistency)
sv_pure_kick_clients 1
// Campaign Settings
mp_gamemode "coop" // coop, versus, survival, scavenge
z_difficulty "Normal" // Easy, Normal, Hard, Impossible
// Versus Settings
versus_boss_flow_max 0.9
versus_boss_flow_min 0.2
// Performance
fps_max 300
sv_maxcmdrate 100
sv_maxupdaterate 100
// Plugins (SourceMod/MetaMod if installed)
// sm_cvar mp_autoteambalance 0
# Navigate to server directory
cd C:\L4D2Server\
# Basic startup
srcds.exe -console -game left4dead2 +map c1m1_hotel +maxplayers 8
# With custom config and hostname
srcds.exe -console -game left4dead2 +exec server.cfg +map c1m1_hotel +maxplayers 8 +hostname "My Server"
# Specific game mode
srcds.exe -console -game left4dead2 +map c1m1_hotel +mp_gamemode versus +maxplayers 8
# Make start script executable
chmod +x srcds_run
# Run in screen session
screen -S l4d2 ./srcds_run -console -game left4dead2 +map c1m1_hotel +maxplayers 8
# With custom parameters
./srcds_run -console -game left4dead2 +exec server.cfg +map c1m1_hotel +maxplayers 8 +ip YOUR_SERVER_IP -port 27015
# Detach: Ctrl+A, D
# Reattach: screen -r l4d2
| Mode | Description | Players | ConVar |
|---|---|---|---|
| Co-op | 4 survivors vs AI infected | 1-4 | mp_gamemode coop |
| Versus | 4v4 PvP (survivors vs special infected) | 2-8 | mp_gamemode versus |
| Survival | Hold out against endless waves | 1-4 | mp_gamemode survival |
| Scavenge | 4v4 timed gas can collection | 2-8 | mp_gamemode scavenge |
| Realism | Hardcore co-op (no outlines, harder) | 1-4 | mp_gamemode realism |
| Mutations | Special rule variants (weekly) | Varies | mp_gamemode mutation# |
Default starting maps for campaigns:
c1m1_hotelc2m1_highwayc3m1_plankcountryc4m1_milltown_ac5m1_waterfrontc6m1_riverbankc7m1_docksc8m1_apartmentc9m1_alleysc10m1_cavesc11m1_greenhousec12m1_hilltopc13m1_alpinecreekEssential for server administration and plugins:
# Download from https://www.sourcemm.net/downloads.php?branch=stable
# Extract to left4dead2/ directory
# Verify installation - should see "addons/metamod/" folder
# Download from https://www.sourcemod.net/downloads.php?branch=stable
# Extract to left4dead2/ directory
# Add yourself as admin in addons/sourcemod/configs/admins_simple.ini:
"STEAM_0:1:12345678" "99:z" // Replace with your SteamID
# Restart server
L4D2 supports Steam Workshop. To auto-download workshop items:
# In server.cfg or startup command
+workshop_download_dir "addons/workshop"
+host_workshop_collection "COLLECTION_ID_HERE"
# Find collection IDs on Steam Workshop
# Server will auto-download subscribed content
# Check sv_lan setting
sv_lan 0 // Must be 0 for internet servers
# Verify region
sv_region 1 // Must be set appropriately
# Check ports
netstat -an | grep 27015
# Test RCON connection
# Use tool like SourceRCON or in-game console
rcon_password "your_password"
rcon status
# Optimize rates in server.cfg
sv_minrate 30000
sv_maxrate 100000
sv_mincmdrate 30
sv_maxcmdrate 100
# Adjust tickrate (default 30)
-tickrate 30 // Add to startup command
# Check server FPS
fps_max 300 // In server.cfg
sv_lan 0 is set correctlysv_allow_lobby_connect_only 0 to allow direct connects# Check MetaMod loaded
meta version // In server console
# Check SourceMod loaded
sm version
# Verify file structure
addons/
metamod/
sourcemod/
plugins/
configs/
# Review error logs
left4dead2/addons/sourcemod/logs/
Popular server modifications compatible with Left 4 Dead 2: