VGKAMI
Advertise Get listed

Game Guides

How to Make a Left 4 Dead 2 Server: Step-by-Step Setup Guide

October 26, 2026 14 min read

You can host a Left 4 Dead 2 dedicated server on a Windows PC or Linux machine by installing the server files with SteamCMD (App ID 222860), setting sv_lan 0, forwarding the server port, and launching srcds with a map and game mode. The common starting port is UDP 27015, although your host, router, and firewall may require additional rules. This guide covers home hosting and VPS deployment, gives working launch commands, explains why friends may not see the server, and shows how to keep it running after a reboot. Vanilla co-op provides four survivor seats; larger groups require server-side extensions and compatible client content.

What do I need before making an L4D2 server?

Prepare the machine, network access, and game files before configuring the server. A dedicated server does not need the full graphical game client running, but it does need a stable internet connection, enough CPU and memory for the number of players you expect, and permission to open the required ports.

  • A Windows PC or Linux host: A home computer works if you can configure its router, firewall, and uptime. A Linux VPS avoids home NAT and is easier to keep online with a service manager.
  • SteamCMD: Valve’s command-line installer downloads the dedicated-server files under App ID 222860.
  • Administrative access: You need permission to install files, create firewall rules, and bind the server port.
  • A fixed local address: Give a home-hosted machine a DHCP reservation or static private address so port forwarding does not break after a reboot.
  • External testing: A phone hotspot or another network is needed to verify that internet players can connect. A successful test from the same LAN is not proof that your router is forwarding correctly.

For capacity, Nxeon’s 2026 sizing guidance says that 2 vCPU and 2 GB of RAM comfortably runs an eight-player co-op or versus server. That is vendor guidance rather than an independent benchmark. Actual usage changes with map, tick activity, extensions, logging, and the number of connected players.

Should I host at home, use a VPS, or rent managed hosting?

Choose the host that matches the amount of control and maintenance you want. Home hosting costs no separate server fee but exposes your router and depends on your home connection. A VPS gives you a public address and restart automation, while managed hosting trades file-level control for simpler setup and support.

Option Setup effort Control over files and mods Network exposure Uptime and restarts Latency
Home PC Highest: router forwarding, firewall rules, and host uptime are your responsibility. Full control. Your home router must expose the selected port; do not expose unnecessary services. Depends on the PC and home power connection unless you add a supervisor. Usually best for players near your home connection.
Linux VPS Moderate: install SteamCMD, configure a firewall, and create a service unit. Full control over the server directory and extensions. No home NAT, but the VPS firewall and provider security group must allow the port. Easy to automate with systemd and restart policies. Depends on the provider’s region and route to players.
Managed game hosting Lowest: the provider supplies the machine and usually a control panel. Varies by provider; confirm whether custom extensions and file access are supported. The provider handles most network exposure. Usually includes monitoring or restart tools; verify what is included. Depends on the selected location.

If you want to learn the server stack or run custom extensions, use a home machine or VPS. If router configuration, patching, and uptime are the main obstacles, managed hosting removes those tasks but may limit what you can install.

How do I install the Left 4 Dead 2 dedicated server with SteamCMD?

Install SteamCMD in its own directory, then place the game files in a separate server directory. Keeping the destination outside the SteamCMD folder makes updates and backups easier.

Windows installation

  1. Download and extract SteamCMD from Valve’s official distribution.
  2. Create a destination such as C:l4d2-server. Do not use the SteamCMD program directory as the game directory.
  3. Open steamcmd.exe and run the following commands:
force_install_dir ./l4d2_ds
login anonymous
app_update 222860 validate
quit

login anonymous is sufficient for this dedicated-server depot. The validate option checks the downloaded files and repairs missing or damaged files. Run the same update sequence whenever you want to patch the server.

Linux installation

Install SteamCMD through your distribution’s package or Valve’s installer, create a service account if appropriate, and use an absolute destination path. Nxeon’s Linux example is:

steamcmd +force_install_dir /home/l4d2/server +login anonymous +app_update 222860 validate +quit

After the command finishes, the directory should contain srcds_run and a left4dead2 folder. If SteamCMD reports a locked file or permission error, stop any running server process and make sure the account running SteamCMD owns the destination directory.

Where is server.cfg, and what should I put in it?

The configuration file belongs at <install>/left4dead2/cfg/server.cfg. Create the cfg directory or the file if SteamCMD did not create them. The server reads this file at launch when you include +exec server.cfg.

hostname "My L4D2 Server"
rcon_password "replace-with-a-long-secret"
sv_password ""
sv_lan 0
sv_cheats 0
sv_consistency 1
z_difficulty "Normal"
sv_gametypes "coop,realism,versus,survival,scavenge"
mp_gamemode "coop"

What each important setting does

  • hostname is the name players see in the server browser or connection information.
  • rcon_password protects remote console access. Replace the example with a long, unique secret and do not reuse a personal password.
  • An empty sv_password allows anyone who can reach the server to join. Put a value between the quotes for a private passworded server.
  • sv_lan 0 makes the instance an internet server. Valve Steam Support explicitly states that internet players require an internet server setting.
  • sv_cheats 0 keeps cheat commands disabled for a normal public game.
  • sv_consistency 1 enforces consistency checks that help prevent mismatched files.
  • z_difficulty accepts Easy, Normal, Hard, or Impossible.
  • sv_gametypes lists the modes the server is allowed to use.

Set the initial mode and map on the launch command even if mp_gamemode appears in the file. A 2026 2hours.gg guide notes that L4D2 ignores mp_gamemode when it is placed in server.cfg; using the launch-line value avoids conflicting behavior between builds.

Which ports do I forward for an L4D2 server?

UDP 27015 is the common default in the setup guides, but there is no universal rule for every deployment. Forward the port you actually pass to -port, allow it through the host firewall, and follow your VPS provider’s security-group requirements.

Port or rule How it is used What to do
UDP 27015 Shared default for the game server in the reviewed setup examples. Forward it from the router to the host’s fixed private IP and allow inbound UDP on the host firewall.
UDP 27005 Listed by Nxeon as an additional deployment-specific requirement. Open it only when your host or configuration documents a need for it.
TCP 27015 Some hosting instructions, including the 2hours.gg deployment, open TCP as well as UDP. Do not assume TCP is required everywhere; match the documented requirements of your host and test externally.

Home-router procedure

  1. Reserve a private address for the server, such as 192.168.1.50, in the router’s DHCP settings.
  2. Create a port-forward rule for the selected server port from the router’s public interface to that private address.
  3. Allow the same port and protocol in Windows Defender Firewall, ufw, or the firewall used by your Linux distribution.
  4. If the router has separate gaming, guest, or double-NAT modes, make sure the forwarding rule is on the device that owns the public address. A second modem or mesh gateway may require forwarding on both devices or bridge mode.
  5. Test from a phone hotspot or another external network. Testing from a computer on the same router can succeed even when internet traffic is blocked.

Never expose RCON or unrelated administrative services to the internet. Restrict firewall rules to the game ports you need, keep the host patched, and use a strong RCON secret.

How do I launch the dedicated server on Windows?

Open a command prompt in the directory containing srcds.exe and start the process with the game name, security mode, player limit, map, and port. This documented example starts Dead Center:

srcds.exe -console -game left4dead2 -secure +maxplayers 4 +map c1m1_hotel -port 27015

-console keeps the server in a text console, -game left4dead2 selects the correct game files, -secure enables the secure server mode, +map c1m1_hotel chooses the first map, and -port 27015 binds the network port. Add +exec server.cfg if your launch file does not already execute it:

srcds.exe -console -game left4dead2 -secure +exec server.cfg +maxplayers 4 +map c1m1_hotel -port 27015

Save the command as start-l4d2.bat in the server directory. A batch file prevents typing mistakes and can be started by Task Scheduler after a reboot. The Steam Community setup guide documents batch-file launching, but it does not provide a complete Windows service definition, so use a process supervisor if you need automatic recovery after a crash.

How do I launch it on Linux?

Change to the installation directory and run srcds_run. The following example uses the path from the Linux installation command, executes the configuration, starts co-op on Dead Center, and binds UDP 27015:

cd /home/l4d2/server
./srcds_run -game left4dead2 -console 
  +exec server.cfg 
  +mp_gamemode coop 
  +map c1m1_hotel 
  +maxplayers 8 
  -port 27015

The example uses +maxplayers 8 because that is the sizing example documented for an expanded server. Vanilla co-op has four survivor seats; setting a higher process limit does not by itself create additional playable survivor slots. Larger co-op groups require server-side tools and matching client content.

Useful starting maps

Campaign Starting map Launch value
Dead Center Hotel c1m1_hotel
Dark Carnival Highway c2m1_highway
The Parish Waterfront c5m1_waterfront
Dead Air / No Mercy listing Apartment c8m1_apartment

Use a map name that exists in the installed content. If the process exits immediately, check the spelling, run the command from the directory containing srcds_run, and inspect the console for a missing library or permission error.

How do I connect and verify that the server works?

First verify locally, then verify from outside your network. In the L4D2 client, enable the developer console in the keyboard settings, open it, and enter:

connect YOUR_PUBLIC_IP:27015

Replace the address with the public IP of the home router or the VPS. Players on the same home network should use the host’s internal address rather than the public address when the router does not support NAT loopback. Internet players must use the public address and the exact port supplied to -port.

  1. Watch the server console while you issue the connection command. A connection attempt that never appears usually indicates a wrong address, port, firewall, or forwarding rule.
  2. Confirm that sv_lan 0 is active. A typo, a second configuration file, or a launch script that omits +exec server.cfg can leave the server in LAN mode.
  3. Check the operating-system firewall and the router rule separately. Both must allow the same protocol and destination port.
  4. Test from a phone hotspot or a friend’s connection. Do not use only a second computer on the same router.
  5. Once connected, confirm the expected map, game mode, difficulty, and player limit in the server console.

Why can’t my friends find or join the server?

Most failures come from LAN mode, an incorrect port, or testing through the wrong network path. Work through the symptom that matches what your friends see.

The server is visible to me but not to internet players

  • Check that sv_lan 0 is in the active configuration and that the server was restarted after editing it.
  • Use the host’s public IP, not its private address such as 192.168.x.x or 10.x.x.x.
  • Confirm that the router forwards the chosen UDP port to the current private IP. A DHCP lease change commonly points the rule at the wrong computer.
  • Allow the port in the host firewall and, for a VPS, in the provider’s security group.
  • Ask the test player to use connect PUBLIC_IP:PORT directly. Browser listings can lag or omit a server even when direct connection works.

Players time out immediately

Verify the port in three places: the launch command, the router forward, and the firewall rule. If you changed from 27015 to another value, every player must include that value after the colon. Double NAT, carrier-grade NAT, or an ISP that blocks inbound traffic can prevent home hosting even when local settings are correct; a VPS or managed host avoids that particular path.

Players join and are then kicked for consistency

Keep sv_consistency 1 unless you have a specific reason to change it. Make sure the server’s campaign and extension files are complete, run app_update 222860 validate to repair the base installation, and have players remove or update incompatible add-ons.

The process starts but the wrong mode loads

Put +mp_gamemode and +map on the launch line. L4D2 can ignore mp_gamemode in server.cfg, so relying on that one line can produce a different mode after a map change or restart.

Friends can connect but cannot use RCON

Check the exact rcon_password, including capitalization, and ensure the command is being sent to the correct server. Do not publish the password in chat or a public configuration repository; replace it immediately if it has been exposed.

How do I keep an L4D2 server online after a reboot?

Linux users can run the server under systemd so it starts at boot and restarts after an unexpected exit. Create a unit such as /etc/systemd/system/l4d2.service and adjust the account and path to your installation:

[Unit]
Description=Left 4 Dead 2 dedicated server
After=network-online.target
Wants=network-online.target

[Service]
User=l4d2
WorkingDirectory=/home/l4d2/server
ExecStart=/home/l4d2/server/srcds_run -game left4dead2 -console -secure +exec server.cfg +mp_gamemode coop +map c1m1_hotel +maxplayers 4 -port 27015
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Reload units and enable the service with:

sudo systemctl daemon-reload
sudo systemctl enable --now l4d2
sudo systemctl status l4d2
journalctl -u l4d2 -f

journalctl -u l4d2 -f follows the live log, which is useful for map errors, port-binding failures, and crashes. Ensure the service account can read and write the server directory and that the firewall is configured before enabling automatic startup.

On Windows, keep the launch command in a batch file and use Task Scheduler or another process supervisor. Configure it to run at startup, use the server directory as its working folder, and restart the task if the process exits. The batch file should include +exec server.cfg and the same port that your router forwards.

How do game modes, difficulty, and player limits work?

The launch line selects the initial mode and map, while z_difficulty controls the difficulty setting in the configuration. The available difficulty names are Easy, Normal, Hard, and Impossible.

Setting Examples Practical implication
Game mode coop, realism, versus, survival, scavenge Pass the starting mode with +mp_gamemode; allow the intended modes in sv_gametypes.
Difficulty Easy, Normal, Hard, Impossible Set with z_difficulty in the configuration.
Player limit Four for vanilla co-op; higher process limits are possible with extensions. +maxplayers alone does not add survivor slots to an unmodified co-op server.

Vanilla co-op is designed for four survivors. To support larger co-op groups or unusual slot counts, administrators generally install server-side tools such as SourceMod and L4D2-specific extensions. Players may also need the same add-on campaigns and files; mismatched content can trigger consistency errors or prevent a campaign from loading.

What maintenance and security should I plan for?

  • Patch on a schedule: Stop the server, run app_update 222860 validate, review the console output, and start it again. Test custom extensions after updates because an extension can lag behind a game change.
  • Back up configuration: Keep copies of server.cfg, launch scripts, systemd units, and any custom campaign or extension files. Store RCON credentials separately from public documentation.
  • Use least privilege: Run Linux servers under a dedicated account instead of root. On Windows, grant the service only the permissions it needs to read and update its directory.
  • Watch disk and logs: Repeated crashes, full disks, or runaway logs can look like networking failures. Rotate logs if your supervisor does not do so automatically.
  • Limit exposure: Forward only the documented game ports, keep the operating system updated, and do not publish private IPs or administrative passwords.

When is managed hosting the better choice?

Use managed hosting when you cannot obtain a usable public address, do not control the home router, or need reliable restarts without maintaining Linux or Windows. A provider can also place the server closer to your players and handle the firewall and power infrastructure.

Confirm the service’s exact support before paying: whether you can upload custom campaigns, install SourceMod extensions, change the launch line, select a region, access logs, and restore files. Prices and included resources vary, and the available sources do not establish a comparable price table. If full file control and unusual mods matter more than convenience, a VPS remains the more flexible option.

Frequently Asked Questions

Can I run two L4D2 servers on the same machine?

Yes, provided each instance has its own configuration and uses a different listening port. Create separate launch scripts or service units, forward or allow each required port, and give players the matching address and port for the instance they should join.

Can I change the server port from 27015?

Yes. Replace the value after -port, then update the router, operating-system firewall, VPS security group, and connection command to use the same number. Test from outside the host’s network after making the change.

What does the Windows -secure option do?

It starts the server in secure mode rather than as an unsecured test instance. Keep it in a public Windows launch command unless you have a specific, temporary reason to run an isolated test server.

How can I stop a server without corrupting its files?

Use the server console’s normal quit command or stop the process through the supervisor that launched it, then wait for the process to exit. Avoid hard power-offs while the server is writing logs or configuration data.