How to Set Up a Project Zomboid Dedicated Server
Host a persistent Project Zomboid world for your group: SteamCMD install, the -Xmx memory setting that trips everyone up, ports 16261โ16262, and a systemd service.
A Project Zomboid dedicated server lets your group share one persistent Knox County apocalypse that keeps ticking between sessions. This guide covers a clean Linux setup with SteamCMD, the memory setting that catches everyone out, and a systemd service so it survives reboots.
What you need
- A Linux VPS: Ubuntu 22.04/24.04. Project Zomboid wants 6โ8 GB RAM for a small group and scales with player count.
- Open ports: UDP 16261 and 16262 (default and direct-connect ports).
Step 1: Create a user and install dependencies
sudo adduser --disabled-password --gecos "" pz
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32gcc-s1 steamcmd
Step 2: Install the server with SteamCMD
The Project Zomboid dedicated server is App ID 380870 with a native Linux build:
sudo su - pz
steamcmd +force_install_dir /home/pz/server +login anonymous +app_update 380870 validate +quit
{{SCREENSHOT}}
Step 3: Open the firewall
sudo ufw allow 16261:16262/udp
sudo ufw reload
Open UDP 16261โ16262 on any provider firewall too.
Step 4: First launch to create the config
Run the server once to generate the config and set an admin password when prompted:
cd /home/pz/server
./start-server.sh -servername myserver
Stop it with Ctrl+C after it finishes generating. Your config now lives at ~/Zomboid/Server/myserver.ini and ~/Zomboid/Server/myserver_SandboxVars.lua.
Step 5: Set the server RAM (the part everyone misses)
Project Zomboid's server runs on Java, and by default it may allocate too little memory for a busy world. Set the maximum heap with -Xmx in ProjectZomboid64.json (or the start script's VM args). For an 8 GB box, giving the server around 6 GB is sensible:
"vmArgs": [
"-Xmx6144m",
"-Xms6144m",
"-Dzomboid.steam=1"
]
Never set -Xmx higher than your physical RAM minus a GB or two for the OS, or the server will be killed by the OOM reaper. This one setting is the difference between a smooth server and mysterious crashes.
Step 6: Run it as a systemd service
Create /home/pz/start.sh:
#!/bin/bash
cd /home/pz/server
./start-server.sh -servername myserver
chmod +x /home/pz/start.sh
# /etc/systemd/system/pz.service
[Unit]
Description=Project Zomboid Dedicated Server
After=network-online.target
[Service]
Type=simple
User=pz
ExecStart=/home/pz/start.sh
Restart=on-failure
RestartSec=15
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now pz
Step 7: Join and admin
In Project Zomboid, choose Join โ Server and enter YOUR_IP with port 16261. Log in with the admin account you created to access admin tools in-game. When you're ready to expand the game, see how to add mods to a Project Zomboid server.
Admin, RCON, and backups
Project Zomboid exposes an RCON port (default 27015) that you set a password for in the server .ini. With RCON you can run admin commands remotely โ save the world, broadcast a message, or kick a player โ without being in-game. In-game, the admin account gets a moderation menu and the ability to grant roles to others.
Your world saves live under ~/Zomboid/Saves/. Sandbox worlds accumulate a lot of state, so back them up on a schedule:
# nightly backup, keep a week
0 4 * * * tar -czf /home/pz/backups/pz-$(date +\%F).tar.gz /home/pz/Zomboid/Saves && find /home/pz/backups -name 'pz-*' -mtime +7 -delete
Because a mis-sized JVM heap is the top cause of instability, keep an eye on memory with monitoring server resources on Linux, and read how to back up your game server automatically for a fuller routine.
FAQ
What ports does a Project Zomboid server use?
UDP 16261 and 16262 by default. Open both on the OS firewall and any provider firewall.
How do I set the RAM for a Project Zomboid server?
Set the Java maximum heap via -Xmx (e.g. -Xmx6144m) in ProjectZomboid64.json or the launch VM args. Keep it below your physical RAM so the OS isn't starved.
How much RAM does a Project Zomboid server need?
6โ8 GB is a good baseline for a small group, scaling up with more players and a larger explored map. Give the JVM most of the box's RAM but leave headroom for the OS.
Why does my Project Zomboid server crash under load?
Usually the JVM heap is too small (raise -Xmx) or set larger than available RAM (triggering the OOM killer). Size the heap to fit your box with a safety margin.
Need a memory tier that fits a full survivor group? Compare plans on our pricing page or launch on game server hosting.