Skip to content

Build 42 Dedicated Server — SteamCMD Setup, Port Forwarding, 254-Player Cap & RAM

Build 42 Dedicated Server — SteamCMD Setup, Port Forwarding, 254-Player Cap & RAM
Game screenshots © The Indie Stone, used for guide purposes.

Yes, you can run a dedicated Project Zomboid Build 42 server, and it is the only way to get a 24/7 world that survives with you offline. The server is a separate free program you install via SteamCMD (Steam app 380870), and Build 42 stable runs it with no beta branch needed — with the latest 42.20.4 build supporting up to 254 players and optimized chunk unloading. This guide covers the full self-hosted path on 42.20: install, first boot, config files, port forwarding, RAM sizing, admin and mods. If you just want to play with friends now, skip to the multiplayer guide instead — this page is for people running their own box.

What you are installing

Item Value
Steam app ID 380870 (Project Zomboid dedicated server)
Default join port UDP 16261
Server binary name ProjectZomboidServer64 (with -Xms/-Xmx JVM flags)
Config files servertest.ini, servertest_SandboxVars.lua
Data folders Zomboid\Server\, Zomboid\Saves\ (under the server account's home)
Latest stable version 42.20.4

Project Zomboid Build 42 official gameplay screenshot

Step 1 — Install via SteamCMD

Create a folder, download SteamCMD, then:

steamcmd +login anonymous +force_install_dir /path/to/pz-server \
  +app_update 380870 +quit

This grabs the stable Build 42.20.4 server. To pin a branch instead (e.g. legacy41 for a B41 world, or 42.19), add the flag: +app_update 380870 -beta legacy41 +quit. Every connecting player must match that branch — see stay on Build 41 for the branch table.

Step 2 — First boot and the admin password

Launch once to generate configs and set an admin password:

cd /path/to/pz-server
./start-server.sh        # or run ProjectZomboidServer64 directly

The first launch asks you to create the admin password for the server account, generates servertest.ini and SandboxVars.lua, and can take several minutes on the first chunk build. Wait for the ready message, then shut it down cleanly (Ctrl+C) before editing configs — editing before the first write gets overwritten.

The dedicated server runs headless: no graphics card needed, but it is RAM-hungry (table below). Run it under a dedicated OS user so saves and logs stay tidy.

Step 3 — Port forwarding and firewall

Clients reach you over the Steam P2P discovery first, but a direct connection needs real ports open on the host firewall and router:

  • UDP 16261 — the default game/join port (DefaultPort in the .ini).
  • UDP 16262+ — secondary Steam/UDP range used for actual traffic (some setups forward 16261–16270).
  • If you host over the internet without forwarding, friends can only join via Steam friends-join when the host is visible — unreliable for a 24/7 box.

"Port already in use" means a duplicate server process is running — stop it rather than launching a second instance. Connection failures usually come from branches or ports, not the game — the error fixes page has the full console.txt triage.

Step 4 — RAM sizing (B42 is heavier than B41)

Real production benchmarks (DoomHosting, July 2026) for B42 servers — add roughly 2 GB to every B41 figure:

Setup Players Mods RAM min RAM recommended
Vanilla small 1–4 none 4 GB 6 GB
Vanilla medium 4–8 none 6 GB 8 GB
Vanilla large 8–16 none 8 GB 12 GB
Light modded 4–8 <10 mods 8 GB 12 GB
Heavy modded 4–8 30+ (Brita's, etc.) 12 GB 16 GB

Memory spikes during the helicopter event, town chunk-streaming and mass saves — the recommended column includes that headroom. Note that the 42.20.1 and 42.20.3 updates reworked chunk unloading and memory management, significantly reducing server-side memory degradation on high-population servers. Set -Xms-Xmx and raise in steps of a few hundred MB only if the log shows real OutOfMemory errors.

Step 5 — Editing servertest.ini and SandboxVars.lua

The .ini controls server behavior; SandboxVars.lua controls the world rules. Key settings people actually touch:

Setting File What it does
DefaultPort servertest.ini Join port (16261 default)
MaxPlayers servertest.ini Player cap — 42.20.3 officially expanded server handling up to 254 players
PvP servertest.ini Allow player-vs-player damage
Safehouse / Safety system servertest.ini Co-op protection toggles
SpawnPoint / spawn regions SandboxVars.lua Where players start
Zombies/population SandboxVars.lua Horde settings (from Sandbox options)
WorkshopItems= / Mods= servertest.ini Mod list for the server

Edit the .ini/.lua while the server is stopped, then relaunch. Some panels manage these fields in their UI instead of raw files — check which one you have.

Step 6 — Admin, whitelist and commands

  • Grant admin in-game: connect, open the chat box (Y), type /grantadmin <username>, enter your admin password when prompted. Admin rights unlock the server settings panel and teleport.
  • Admin reserve slots: as of 42.20.3, server administrators have guaranteed access even when the server reaches full player capacity (MaxPlayers).
  • Whitelist: set AutoCreateUserInWhitelist=false and add players by username in servertest.ini (Whitelist=), or approve via the admin panel.
  • Useful console commands: save, quit, /teleport, /godmod, /setaccesslevel. Command availability varies by build — check the in-game admin panel for the current list on 42.20.4.

Step 7 — Installing mods on the server

Workshop mods go in two parallel lines in servertest.ini:

WorkshopItems=<workshop-id-1>;<workshop-id-2>
Mods=<ModID1>\<ModID2>

Build 42 changed the format: each Mod ID needs a trailing backslash (Mods=BRITA_ARMOR_PACK\). The numeric Workshop ID comes from the Steam Workshop page URL (id=...); the Mod ID is the identifier the mod author declares. Restart the server to download and load them — see the B42 mods guide for the full walkthrough and the 42.20.4 compatibility rules (including the removal of loadstring).

Self-host vs hosting panel

Self-host (SteamCMD) Hosting panel
Cost Your hardware/bandwidth Monthly fee
Control Total (all files) Usually full via panel
Port forwarding You do it Provider handles it
Upkeep Manual patches/backups Often automated
Best for One box, a group you trust 24/7 public/large servers

Verified on 42.20.4 · Last checked 2026-09-05

Steam app ID 380870, port 16261, SteamCMD branch flags and servertest.ini structure from SteamCMD/PZ hosting documentation; RAM table from DoomHosting's B41-vs-B42 production benchmarks; 254-player scalability and admin priority from official 42.20.3 patch notes (August 17, 2026); latest stable release verified on 42.20.4 (August 26, 2026). Exact JVM defaults vary by install — confirm your own before editing.

More Guides