This guide covers how to configure and connect to your Left 4 Dead 2 dedicated server hosted with Legion Hosting, including server.cfg settings, GSLT token setup, game modes, custom campaigns, and Workshop add-ons.
Step 1 — Locate and Edit server.cfg
Left 4 Dead 2 reads its core server configuration from left4dead2/cfg/server.cfg. This file is created automatically the first time the server starts. If it does not exist, you can create it manually using the GPanel file manager.
- Log in to GPanel and select your Left 4 Dead 2 server.
- Stop the server if it is running.
- Click the Files tab and navigate to
left4dead2/cfg/. - Open or create
server.cfgand add the settings below.
Core server.cfg Settings
// ── Server Identity ─────────────────────────────────────────────
hostname "My Legion L4D2 Server"
sv_password "" // Leave empty for a public server
maxplayers 8 // L4D2 max is 32; standard co-op uses 4-8
// ── Game Mode ────────────────────────────────────────────────────
mp_gamemode "coop" // coop | versus | survival | scavenge
sv_gametypes "coop,versus,survival,scavenge"
// ── Network ──────────────────────────────────────────────────────
sv_region 255 // 255 = worldwide
sv_lan 0 // 0 = internet server
sv_alltalk 0
// ── GSLT (Steam Game Server Login Token) ─────────────────────────
sv_setsteamaccount "YOUR_GSLT_TOKEN_HERE"
// ── Cheats / Consistency ─────────────────────────────────────────
sv_cheats 0
sv_consistency 0 // Set to 0 to allow custom content; see notes
// ── Logging ──────────────────────────────────────────────────────
log on
sv_logbans 1
sv_logecho 1
sv_logfile 1
| ConVar | Values | Description |
|---|---|---|
hostname |
Any string | The name shown in the Steam server browser and lobby browser. |
sv_password |
String or empty | Password required to join. Leave empty for a public server. |
maxplayers |
1–32 |
Maximum simultaneous player slots. Standard co-op uses 4, versus uses 8, but modded servers often set this higher. |
mp_gamemode |
coop versus survival scavenge |
Active game mode. Must match a value listed in sv_gametypes. |
sv_gametypes |
Comma-separated list | Game modes the server is allowed to host. The lobby browser filters by this list. |
sv_consistency |
0 or 1 |
When set to 1, all clients must have identical files to the server. Set to 0 to allow custom content such as custom campaigns or sound packs without kicking players. |
sv_lan |
0 or 1 |
Set to 0 for an internet-accessible server. Setting to 1 makes the server LAN-only and prevents it from appearing in the public browser. |
mp_gamemode to realism or realism_versus and add those values to sv_gametypes.
Step 2 — Set Up a GSLT Token
A Game Server Login Token (GSLT) is required for your server to be listed on the Steam master server and visible in the public server browser. Without a valid token, the server will still run but may not appear in listings and can be delisted by Valve.
- Log in to your Steam account and go to the Steam Game Server Account Management page.
- Enter App ID 550 (Left 4 Dead 2) and a memo to identify the token.
- Click Create and copy the generated token.
- Paste it into
server.cfgas the value forsv_setsteamaccount. - Save the file and restart the server. The console will confirm the token was accepted with a message like
SteamGameServer connected to Steam successfully.
Step 3 — Install Custom Campaigns
Custom campaigns for Left 4 Dead 2 are distributed as .vpk (Valve Pak) files. Installing them on your dedicated server makes them available for server-side play and ensures all connected clients can access the map data.
- Download the campaign's
.vpkfile(s). Campaigns often come as a pair — for examplecampaign_dir.vpkandcampaign_000.vpk— upload all provided files. - Upload the
.vpkfiles toleft4dead2/addons/on your server via SFTP. See the SFTP upload guide if you need help connecting. - Restart the server. The Source engine automatically indexes
.vpkfiles in the addons directory on startup. - To load the campaign, change the map using the server console:
changelevel c1m1_hotel // Change to official map changelevel custom_map_name // Change to your custom campaign's first map
.vpk installed in their own Left 4 Dead 2 addons/ folder, or subscribed via the Steam Workshop, to join a server running a custom campaign. The server console will display an addon consistency error for clients who are missing files if sv_consistency 1 is set.
Addon Consistency Setting
If you want to allow players to join even if they do not have the custom campaign locally, set sv_consistency 0 in server.cfg. This disables file hash checking. Note that this also means clients can run arbitrary local modifications without being kicked.
sv_consistency 0 // Allow joins without matching addon files
Step 4 — Steam Workshop Add-Ons
Left 4 Dead 2 dedicated servers can subscribe to Steam Workshop content, but the recommended method for servers is to download Workshop items and deploy them as .vpk files rather than relying on Workshop auto-download, which is not fully supported in dedicated server mode.
Recommended Workflow
- Subscribe to the Workshop item on your personal Steam account and allow it to download to your local Left 4 Dead 2 installation.
- Find the downloaded content in your local Steam Workshop cache — typically at
Steam/steamapps/workshop/content/550/on your local machine. - Copy the
.vpkfile(s) from the Workshop cache folder. - Upload those
.vpkfiles toleft4dead2/addons/on your Legion Hosting server via SFTP. - Restart the server. The add-on will be active on next startup.
sv_consistency 0 is set. However, clients who do not have the item will see default assets instead of the custom content.
Step 5 — Connecting to Your Server
There are three ways to connect to a Left 4 Dead 2 dedicated server. Your server's IP address and port can be found on the Network tab in GPanel. See the how to find your server IP and port guide for details.
Method 1 — In-Game Console (Direct Connect)
Open the developer console with the tilde key (~) and type:
connect YOUR.SERVER.IP:PORT
connect YOUR.SERVER.IP:PORT; password yourpassword // If password protected
Method 2 — Steam Server Browser
- In Steam, open View > Game Servers.
- Click the Favourites tab, then Add Server.
- Enter your server's IP and port as shown in GPanel (e.g.
1.2.3.4:12345) and click Find Games at this Address. - Double-click the server entry to join.
Method 3 — Lobby System
If your server is publicly listed with a valid GSLT token, players can find it through the in-game lobby browser under Play > Find a Server. Filter by game mode and region. The server must have the correct mp_gamemode and sv_gametypes set to appear in the appropriate lobby filter.
| Connection Method | Best For | Requirements |
|---|---|---|
| Console direct connect | Quick access, password-protected servers, custom ports | Developer console enabled in game options |
| Steam server browser | Adding to favourites, checking server status before joining | Correct IP and port from GPanel Network tab |
| In-game lobby browser | Public servers with standard game modes | Valid GSLT token, sv_lan 0, correct sv_gametypes |
Related Articles
- L4D2 Admin Setup and Plugin Management — Installing SourceMod, MetaMod, adding admins, and managing plugins
- L4D2 Server Troubleshooting — Common issues with connections, addons, plugins, and server browser listing
- How to Upload Files via SFTP
- How to Find Your Server IP and Port