SameOS ~/tools/project-zomboid-linux-dedicated-server.md

Building and Updating a Project Zomboid Build 42 Server on Linux

Published and official references checked 2026-08-29 · SameOS operator

For Project Zomboid, the per-user Zomboid data directory matters more than the replaceable application folder. First boot generates configuration and an administrator account, the server name ties together several settings and save paths, and Build 41 and 42 worlds should never be mixed casually. This setup installs SteamCMD app 380870 under a dedicated account and isolates state with an absolute cachedir.

Record the Branch and Full Build First

Across the 2026 Build 42 releases, client and server still need an exact build match. When moving among stable, unstable, and legacy41, use separate copies of the data directory. Once a new build converts a world, the older process may not be able to read it again.

The command below installs the default stable branch. Before copying any beta argument, verify the exact current branch name in an official announcement. Binaries and state are separated into /srv/zomboid/server and /srv/zomboid/data.

sudo apt update
sudo apt install -y steamcmd
sudo useradd --system --create-home --home-dir /srv/zomboid \
  --shell /bin/bash zomboid
sudo install -d -o zomboid -g zomboid /srv/zomboid/server /srv/zomboid/data

sudo -u zomboid steamcmd \
  +force_install_dir /srv/zomboid/server \
  +login anonymous +app_update 380870 validate +quit

Perform First Boot in a Terminal

First boot asks for the administrator password and generates files such as friends.ini, so do it interactively before systemd. -servername becomes a prefix for configuration and save identity; choose a short name without spaces and keep it stable. Pass an absolute path to -cachedir.

A recent Build 42 Linux startup failure was traced to a relative cachedir. An absolute path survives systemd working-directory changes and cleanly separates multiple instances.

cd /srv/zomboid/server
sudo -u zomboid ./start-server.sh \
  -servername friends \
  -cachedir=/srv/zomboid/data

# After first boot and administrator creation, stop in the console
save
quit

find /srv/zomboid/data/Server -maxdepth 1 -type f -name 'friends*' -print

Inspect friends.ini and Memory

The primary settings live at /srv/zomboid/data/Server/friends.ini, with sandbox and spawn files sharing the prefix. Begin with Public=false and review Password, MaxPlayers, PauseEmpty, and Open. Enable listing and mods only after a vanilla LAN join and save have succeeded.

Some packaged builds keep the JVM memory ceiling in ProjectZomboid64.json. Editing only start-server.sh may not change it, so inspect the actual -Xmx value and leave enough RAM for the OS and filesystem cache.

grep -E '^(Public|Open|Password|MaxPlayers|PauseEmpty)=' \
  /srv/zomboid/data/Server/friends.ini

grep -n -- '-Xm[sx]' /srv/zomboid/server/ProjectZomboid64.json

sudo chown -R zomboid:zomboid /srv/zomboid/data
ls -l /srv/zomboid/data/Server/friends*

Register systemd and Observe Ports

The service must pass exactly the first-boot servername and absolute cachedir. Prove that SIGINT produces a completed save in a disposable world before automating a backup immediately after systemctl stop.

The base game port is UDP 16261, while Steam networking, direct player transport, and RCON choices can add listeners. Do not copy a broad port range from an old Build 41 post. Read the current friends.ini, startup log, and ss output, then forward only what the chosen setup uses.

# /etc/systemd/system/project-zomboid.service
[Unit]
Description=Project Zomboid Dedicated Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=zomboid
Group=zomboid
WorkingDirectory=/srv/zomboid/server
ExecStart=/srv/zomboid/server/start-server.sh \
  -servername friends -cachedir=/srv/zomboid/data
KillSignal=SIGINT
TimeoutStopSec=180
Restart=on-failure
RestartSec=20

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl enable --now project-zomboid
sudo journalctl -u project-zomboid -f
sudo ss -lunp | grep -E ':16261|ProjectZomboid'

Workshop Mods Need Both Lists

WorkshopItems in friends.ini takes numeric Workshop IDs, while Mods takes internal mod IDs. If only one list is correct, the server can download files yet activate a set that differs from the clients. Map mods also depend on Map ordering and belong in a copied test world first.

During an update, the server application, Workshop files, and clients can briefly represent three different moments. Change small batches, start unlisted, inspect download and load errors, and perform one real client join before reopening access.

grep -E '^(WorkshopItems|Mods|Map)=' \
  /srv/zomboid/data/Server/friends.ini

grep -Ei 'version|workshop|mod|error|save' \
  /srv/zomboid/data/server-console.txt 2>/dev/null | tail -80

Back Up and Update Build 42

After a clean stop, archiving the complete cachedir retains Server settings, db, Saves, Logs, and mod-related state. It can include administrator and player data, so keep it outside the web root and copy it to another device.

Record the current build, branch, and app manifest before updating. Back up, run app_update 380870 validate, and if startup fails, boot a restored copy without mods to separate a game update failure from a Workshop failure.

sudo systemctl stop project-zomboid
sudo -u zomboid tar -C /srv/zomboid -czf \
  /srv/zomboid/zomboid-data-$(date +%F-%H%M).tar.gz data

sudo -u zomboid steamcmd \
  +force_install_dir /srv/zomboid/server \
  +login anonymous +app_update 380870 validate +quit
sudo systemctl start project-zomboid

sudo journalctl -u project-zomboid -n 150 --no-pager

When a Client Sticks at Loading Map

Verification scope and official references

The official Project Zomboid Wiki and The Indie Stone forums were cross-checked for Linux hosting, SteamCMD app 380870, Build 42 behavior, and the absolute-cachedir failure. Because Build 42 is moving, this guide avoids freezing a broad port range or performance ceiling. No production data was used.

Read the SameOS writing, translation, and review policy

Game server restore drill Valheim Linux server 7 Days to Die Linux server