📚 Navigation

Overview 🔌 Ports Installation ⚙️ Configuration Game Modes Addons & Mods 🔧 Troubleshooting

Left 4 Dead 2 Dedicated Server Hosting Guide

Overview

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.

Quick Info

🔌 Ports Required

Port Protocol Purpose Required
27015 UDP / TCP Game + RCON port (UDP for game, TCP for RCON) ✓ Yes
27020 UDP SourceTV (spectator mode, game replays) 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.

Firewall Configuration Examples

UFW (Ubuntu/Debian)

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

FirewallD (CentOS/RHEL/Fedora)

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

Windows Firewall

# 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

iptables (Legacy Linux)

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

Installation & Setup

System Requirements

Installing via SteamCMD (Linux)

# 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

Installing via SteamCMD (Windows)

# 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

Server Configuration

server.cfg

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

Starting the Server

Windows

# 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

Linux

# 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

Game Modes

Available Game Modes

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#

Campaign Maps

Default starting maps for campaigns:

Addons & Mods

SourceMod & MetaMod:Source

Essential for server administration and plugins:

Installing MetaMod:Source

# Download from https://www.sourcemm.net/downloads.php?branch=stable
# Extract to left4dead2/ directory

# Verify installation - should see "addons/metamod/" folder

Installing SourceMod

# 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

Popular SourceMod Plugins

Workshop Content

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

🔧 Troubleshooting

Server Not Showing in Browser

# 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

Connection Issues / Lag

# 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

Players Can't Join / Authentication Failed

Mods/Addons Not Loading

# 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/

Pro Tips

Popular server modifications compatible with Left 4 Dead 2:

Resources