ImperialHost.cc · Guides · Roleplay and shooters
Left 4 Dead 2 server: joining and setup
Most of a Left 4 Dead 2 server is set in the server.cfg file. For players to join from the console, first allow direct connections outside the lobby there.
Before you start
- A Left 4 Dead 2 server with us and access to the game panel.
- Left 4 Dead 2 on Steam.
1. Allow joining from the console
- In the game panel open the Files tab and the
left4dead2/cfgfolder. If there is noserver.cfgfile in it, click New File, otherwise open the file. - Add the line
sv_allow_lobby_connect_only 0. Without it the server lets in only players from a lobby, andconnectdoes not work. - Set the server's name with the line
hostname "My server"and a password withsv_password "secret". For no password leave the password line out. - For a new file click Create File, type the name
server.cfgand confirm. Save a changed file with Save Content. Then click Restart on the Console tab (the circular arrow at the top near the server's name).
2. Join from the game
- The server's address is in the client area on the service's page under IP address, for example
node1.imperialhost.cc:30005. In the game panel it is at the top under the server's name, and the Copy button copies it. - In L4D2 open the options, the keyboard and mouse tab, and allow the developer console.
- Open the console with the key below Esc and type
connect node1.imperialhost.cc:30005with your address and port. For a server with a password typepassword secretfirst.
3. Versus mode and maps
- For versus add the line
mp_gamemode versustoserver.cfgand restart the server. - Set the default map on the Startup tab in DEFAULT MAP, for example
c1m1_hotel. To switch it while the server runs, typechangelevel c2m1_highwayin the panel's console. - Upload community maps and campaigns (
.vpkfiles) to theleft4dead2/addonsfolder on the Files tab with Upload and restart the server. Upload a file over 100 MB over SFTP: Connect to your server with SFTP (FileZilla, WinSCP).
Players need the same maps as the server, easiest from the Steam Workshop.
4. Admins with SourceMod
- Download Metamod:Source from metamodsource.net and SourceMod from sourcemod.net, both for Linux.
- Unpack both archives on your computer and upload what is inside them over SFTP to the
left4dead2folder on the server: Connect to your server with SFTP (FileZilla, WinSCP). - Restart the server and type
sm versionin the panel's console. If it prints the SourceMod version, it runs. - Join, type
statusin the panel's console and copy your Steam ID. In the fileleft4dead2/addons/sourcemod/configs/admins_simple.iniadd a line with your Steam ID, for example"STEAM_0:1:12345678" "99:z". Save and typesm_reloadadminsin the console.
99:z gives every right. In the game, the sm_admin console command opens the admin menu.
Troubleshooting
connect does not work
The line sv_allow_lobby_connect_only 0 is missing in left4dead2/cfg/server.cfg, or the server has not restarted since the change. Add it and restart the server.
The console won't open in the game
Allow it in the options on the keyboard and mouse tab. It opens with the key below Esc, left of 1. The -console launch option in the game's properties in Steam helps too.
A community map can't be played
Players need the same map as the server, and the server must restart after you upload the .vpk file.
I want more than 4 survivors
The base game has 4 survivors, and versus is 4 against 4. More players need a community add-on, for example L4DToolZ for Metamod:Source, which you install yourself.
Still stuck?
Message us on Discord. The AI assistant Aurel answers first, and you can call an admin. Or open a ticket in the client area.