Video coming soon…

🧟 Setup Left 4 Dead 2 Server — Co-op Zombie Shooter

Dedicated L4D2 server for four-player co-op zombie survival campaigns and versus mode

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — Left 4 Dead 2 server running in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/gaming/left4dead2/left4dead2-ubuntu.sh
chmod +x left4dead2-ubuntu.sh
sudo bash left4dead2-ubuntu.sh

Tutorial Steps

1 Download & Run the Installer

The script installs Docker, pulls the L4D2 dedicated server image via SteamCMD, and starts the container. The server downloads ~15 GB of game files and runs on port 27015 UDP.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/gaming/left4dead2/left4dead2-ubuntu.sh
chmod +x left4dead2-ubuntu.sh
sudo bash left4dead2-ubuntu.sh

2 Configure the Server

Edit server.cfg to set hostname, password, difficulty level, and RCON password. Configure the map rotation in mapcycle.txt and choose your starting gamemode.

# Edit server configuration
nano /opt/left4dead2/data/left4dead2/cfg/server.cfg

# Key settings:
# hostname "My L4D2 Server"
# sv_password ""                          # empty for public
# rcon_password "yourrconpass"
# z_difficulty "Normal"                  # Easy/Normal/Hard/Impossible
# sv_allow_lobby_connect_only 0

3 Connect with the Game Client

Open L4D2, go to Play Online, then Find Games to search for your server, or use the developer console to connect directly using the connect command.

# In-game console (press ~):
connect <your-server-ip>:27015

4 Admin Management

Use RCON to manage players, change maps, and adjust difficulty. Install SourceMod for advanced admin tools including kick/ban management and plugin support.

# Connect via RCON
docker exec -it l4d2-server rcon-cli --port 27015 --password yourrconpass

# Common RCON commands:
# status                      - list players
# kickid <userid>             - kick a player
# banid 0 <steamid>           - permanent ban
# changelevel c2m1_highway    - change map
# z_difficulty Hard           - change difficulty

# View live logs
docker logs -f l4d2-server

Ports Used

PortPurpose
27015 UDPGame traffic and Steam query

Overview

Left 4 Dead 2 is Valve's cooperative zombie shooter where 4 survivors battle through hordes to reach safe rooms. A dedicated server allows private co-op campaigns, versus matches, and custom maps — all with full control over difficulty, mutations, and Sourcemod plugins.

Why Use It

A self-hosted L4D2 server removes the dependency on Valve's matchmaking, allows private matches with friends, enables custom mutations and campaign configs, and supports Workshop custom maps without the limitations of official servers.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              L4D2 uses UDP port 27015 for game connections. Open UDP port 27015. RCON uses TCP port 27015 — keep this firewalled. For Steam server browser listing, the query port must also be accessible.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    Alternatives include Valve matchmaking (official, but public), custom lobbies via Steam friends, and community server hosting services. Self-hosting gives private access and plugin support.

                    When Not to Use It

                    Avoid self-hosting L4D2 if you just want to play with friends occasionally — the built-in lobby system and Steam friends invite work well. Self-hosting is best for custom maps, competitive practice, and plugin-extended game modes.

                    PrismaTechWork Professional Help

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      How do I load custom Workshop campaigns?

                      Download the custom campaign addon files from the Steam Workshop. Extract the VPK or BSP files to the L4D2 server's left4dead2/addons directory. Custom campaigns then appear in the map list. Note that all connecting clients must also have the custom campaign downloaded and subscribed on Steam.

                      Can I run L4D2 versus mode on a dedicated server?

                      Yes. Set the game mode to versus in server.cfg with mp_gamemode versus. Versus mode supports 4 survivors and up to 4 infected players. Configure sv_vs_team_size for team size. The server handles both Survivor and Infected roles with full dedicated server performance.

                      What Sourcemod plugins are popular for L4D2?

                      Popular L4D2 Sourcemod plugins include: l4d2_tank_rock_lag (fixes lag compensation), l4d_witch_bride (witch spawn control), l4d2_scoremod (competitive scoring), SI_Limit (special infected limits), and readyup (ready-check system for versus). Check AlliedModders wiki for the full plugin catalog.

                      How do I set up mutations on my L4D2 server?

                      Load mutation configs via the mp_gamemode console variable. L4D2 includes mutations like realism, survival, and scavenge. Load specific mutation configs in your server.cfg: mp_gamemode mutation1 for Realism Versus. Community Sourcemod plugins can also create custom mutations with modified game rules.

                      How many players can a L4D2 server support?

                      Standard L4D2 supports 4 survivors plus infected in versus. The maximum is 8 players total. With Sourcemod, you can expand to more players in co-op (up to 32 with various caveats and performance impacts). The standard 4-player co-op or 4v4 versus needs only 1 to 2 GB RAM.

                      Can I configure survivor health and difficulty?

                      Yes. Server console variables control many aspects: z_difficulty (Easy, Normal, Advanced, Expert), survivor_health_start_bonus for starting health, z_common_limit for zombie count, and many more. These can be set in server.cfg or changed at runtime via RCON.

                      Does L4D2 require content from the original Left 4 Dead?

                      No — L4D2 is a standalone game and the dedicated server runs independently. The original L4D1 campaigns are included in L4D2 as a free DLC that all players can access without owning L4D1. The dedicated server only requires the L4D2 server files via SteamCMD.

                      How do I prevent public players from joining my private server?

                      Set sv_password in server.cfg to a private password. Only share it with your group. Additionally, set sv_allow_lobby_connect_only 0 to disable lobby-based joining and require direct connection. For fully private servers, only share the IP and password with trusted players.