Author: Eiko

Time: 2025-12-14 15:18:53 - 2025-12-14 23:42:55 (UTC)

I made a script for doing so on arch linux, it is very easy.

Easy Setup Script

#!/bin/bash
# This script installs the Project Zomboid dedicated server on an Arch Linux system.
echo "This script will install the Project Zomboid dedicated server on an Arch Linux system."

# detect if 'steamcmd' is installed
if ! command -v steamcmd &> /dev/null; then
    echo "steamcmd could not be found. Please install it first."
    if ! command -v yay &> /dev/null; then
        echo "Using makepkg to install steamcmd."
        git clone https://aur.archlinux.org/steamcmd.git
        cd steamcmd
        makepkg -si --noconfirm
        cd ..
    else
	echo "Using yay to install steamcmd."
   	yay -S steamcmd --noconfirm
    fi
fi

sudo useradd -m -d /home/pzserver -s /bin/bash pzserver

sudo mkdir /opt/pzserver
sudo chown pzserver:pzserver /opt/pzserver

string="
// update_zomboid.txt
//
@ShutdownOnFailedCommand 1 // set 0 if updating multiple servers at once
@NoPromptForPassword 1
force_install_dir /opt/pzserver/
// for servers which don't need a login
login anonymous
app_update 380870 validate
quit
"

install_string="
export PATH=$PATH:/usr/games
steamcmd +runscript /home/pzserver/update_zomboid.txt
"

echo "$string" | sudo tee /home/pzserver/update_zomboid.txt
echo "$install_string" | sudo tee /home/pzserver/install_zomboid.sh
sudo chmod +x /home/pzserver/install_zomboid.sh

# Required Ports for Steam
# The following are ports you need to have open on your router or firewall for Steam to operate normally.
# 
# 
# To log into Steam and download content:
# 
#     HTTP (TCP remote port 80) and HTTPS (443)
#     UDP remote port 27015-27050
#     TCP remote port 27015-27050
# 
# 
# Steam Client
# 
#     UDP remote port 27000-27100: Game traffic
#     UDP local port 27031-27036: Remote Play
#     TCP local port 27036: Remote Play
#     UDP remote port 4380
# 
# Dedicated or Listen Servers
# 
#     TCP local port 27015 (default): SRCDS Rcon port
#     UDP local port 27015 (default): gameplay traffic
# 
# Steamworks P2P Networking and Steam Voice Chat
# 
#     UDP remote port 3478
#     UDP remote port 4379
#     UDP remote port 4380
#     UDP remote ports: 27014-27030

if command -v ufw &> /dev/null; then
    echo "The following UFW rules will be added:"
    echo "sudo ufw allow 16261/udp # zomboid server"
    echo "sudo ufw allow 16262/udp # zomboid server"
    echo "sudo ufw allow 27015 # steam server"
    sudo ufw allow 16261/udp # zomboid server
    sudo ufw allow 16262/udp # zomboid server
    sudo ufw allow 27015 # steam server
fi

echo "Now please switch to the pzserver user and run the install script:
---
# Switch to pzserver user
sudo su pzserver
---
# Install Zomboid Server
cd
bash install_zomboid.sh
---
# Start Zomboid Server
cd /opt/pzserver
bash start-server.sh
"

Unstable Version

For 42.13 unstable version, modify the /home/pzserver/update_zomboid.txt to be

app_update 380870 -beta unstable validate

and re-run install.

(Or if you havn’t started installation, modify the script directly)

Note on Rolling Back

If you have installed the unstable version and want to install stable back, besides deleting the old server files, you may also want to run

rm ~/.steam/steamcmd ~/.local/share/Steam/steamcmd ~/Steam/steamcmd -rf

if you can’t actually roll-back to B41 (i.e. reinstalling with old setup still gives B42.13).