Hosting your own Project Zomboid Server on Linux

In this tutorial, we will show you how to self-host a Project Zomboid dedicated server on a Linux-based system such as Ubuntu.

Project Zomboid Dedicated Server Linux

Project Zomboid is a hardcore isometric, open-world, Zombie survival game. In this game, you must navigate and survive in a world ravaged by zombies. Being a hardcore game, even the slightest mistake can set you back.

One of Project Zomboid’s key features is its ability to host your own server and play with your friends. Self-hosting allows you to have up to 100 players in one world, but of course, you will need a machine that can actually handle that.

Another advantage of hosting your own dedicated server for this game is that it is typically significantly cheaper than the many rental servers around.

Even if you are relatively new to Linux, getting a server up and running for Project Zomboid should be a fairly simple process.

If you haven’t yet chosen an operating system, we highly recommend Ubuntu Server. It is the operating system we use when testing this tutorial. These steps, however, should work for any Debian-based operating system.

Installing a Project Zomboid Server on Linux

In the following sections, we will walk you through the entire process of setting up a dedicated server for Project Zomboid on Linux.

Prior to setting up a server, you should ensure that you have a static IP address and also at least have a firewall enabled. A firewall is a basic yet effective way to help keep intruders out of your system.

Preparing Linux for the Project Zomboid Server

1. We need to prepare your Linux system before we can get the Project Zomboid Server up and running.

If you are running a Debian system like Ubuntu, the following two commands can ensure you have an updated base to work from.

sudo apt update
sudo apt upgrade -y

2. Your next step is to install the “screen” package. The screen package allows us to keep the Project Zomboid server running within it’s own virtual screen.

Install this required package by running the following command.

sudo apt install screen

Installing the SteamCMD Command Line Tool

3. To install the dedicated server for Project Zomboid, we will use the SteamCMD tool. This tool allows you to download games and servers directly from Steam.

To install this tool, be sure to follow our guide on installing SteamCMD on Linux.

https://pimylifeup.com/linux-steamcmd/

Preparing a User to Run a Project Zomboid Server on Linux

4. We will create a user to separate your Project Zomboid server from your Linux system.

Use the following command to create a user named “zomboid“. The “-m” option will also create a home directory for this user.

sudo useradd -m zomboid

5. Once the user has been created, we will want to use the sudo command to swap to that user. Using sudo allows us to swap to a user even if it doesn’t have a password set.

Run the command below to change over to the “zomboid” user we created in the previous step.

sudo -u zomboid -s

6. After swapping to the user you will want to change to its home directory using the following command. We will use this directory to store the Project Zomboid Server on your Linux system.

cd ~

Downloading the Project Zomboid Dedicated Server on Linux

7. We are finally at the point where we can use the SteamCMD tool to download the latest version of the Project Zomboid server to our Linux system.

To download this server, use the following command within the terminal. The key part here is where we specify the app ID of “380870“. This ID is the one belonging to the Zomboid dedicated server.

/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/zomboid/zomboidserver +login anonymous +app_update 380870 +quit

Testing your Server

8. Before we can write a service to run the Project Zomboid dedicated server on Linux, we must run it at least once. The first time you start this server, you will be prompted to give it a password.

Change to the directory where the server is stored using the command below.

cd /home/zomboid/zomboidserver

9. All you need to do to start up the Project Zomboid server is use the command below.

./start-server.sh

10. The following messages will appear within the terminal after a minute or two.

These indicate that an admin user doesn’t exist, and we have not passed a password into the command line.

User 'admin' not found, creating it
Command line admin password: null

You will be prompted to enter a new password for the Zomboid server admin user. Type in something secure, as someone could use it to control your server.

Enter new administrator password:
Confirm the password:

11. Once the server has finished setting up, you can safely shut it down by typing in the following command.

Avoid pressing CTRL + C as that will shut it down without giving the server a chance to properly terminate.

quit

Downloading an RCON Client

12. Next, you will want to change to the “zomboid” users home directory using the following command.

We will store the “rcon” client within this folder.

cd /home/zomboid/

13. One downside of the Zomboid Dedicated Server on Linux is that it doesn’t cleanly handle termination signals. We must send a save and quit command before stopping the server.

To achieve this, we must download an Rcon client that supports Project Zomboid.

wget https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz -O rcon.tar.gz

14. Once the archive has been downloaded, we will use the tar command to extract its contents.

tar -xvf rcon.tar.gz

15. Your next step is to copy the “rcon” tool out of the archive that we extracted. We will extract this binary to the Zomboid user’s home directory.

mv ./rcon-0.10.3-amd64_linux/rcon ./

16. Since we no longer need the directory that was extracted from the archive file, we can delete the directory using the rm command.

rm -r -f ./rcon-0.10.3-amd64_linux/

17. Now ensure that we have execute privileges on the “rcon” binary by using the chmod command.

chmod +x ./rcon

Enabling RCON for the Project Zomboid Linux Server

18. To be able to use RCON to control the Project Zomboid server on Linux, we will need to edit the “servertest.ini” configuration file.

You can edit this file by running the following command within the terminal.

nano /home/zomboid/zomboidserver/servertest.ini

19. Within this file, you will find an option labeled “RCONPassword“. To make it easier to find this line, you can use the search functionality of nano by pressing CTRL + W.

RCONPassword=

Next to this option, specify a secure password that you will use to interact with your Zomboid server.

RCONPassword=<SECUREPASSWORDHERE>

20. After making changes to this file, save and quit by pressing CTRL + X, Y, and then ENTER.

Creating a Systemd Service to Run Your Zomboid Server

21. Now that we know the Project Zomboid dedicated server is working on our Linux system, we can move on to creating a service.

A service will allow your server to automatically start whenever your system restarts or if something causes the server to crash.

To write this service, you will want to return to your previous user using the exit command.

exit

22. Once you are running as your normal user, you can begin writing the Zomboid Server service using the command below.

We use the nano text editor as it is quite easy to use, especially compared to others such as vi.

sudo nano /etc/systemd/system/zomboidserver.service

23. Within this file, type in the following lines.

There are a couple of extra things we do here. First, we have the service set to update the server automatically every time the service starts. Finally, when the serve is stopped, we use the rcon tool we installed earlier to send save and quit commands.

While filling out this file, you will be required to replace “[PASSWORD]” with the RCON password you set earlier within this guide.

Please note that if you want to be able to play on your Project Zomboid with players who don’t use the Steam version, you must add the “-nosteam” option after “/home/zomboid/zomboidserver/start-server.sh“.

[Unit]
Description=Project Zomboid Dedicated Server
Wants=network-online.target
After=network-online.target

[Service]
Environment=SteamAppId=380870
Environment=LD_LIBRARY_PATH=/home/zomboid/zomboidserver/linux64:$LD_LIBRARY_PATH
Type=simple
Restart=on-failure
RestartSec=10
KillSignal=SIGINT
User=zomboid
Group=zomboid
WorkingDirectory=/home/zomboid/zomboidserver
ExecStartPre=/usr/games/steamcmd +login anonymous +force_install_dir /home/zomboid/zomboidserver +app_update 380870 +exit

ExecStart=/bin/sh -c "/usr/bin/screen -DmS zomboidserver /home/zomboid/zomboidserver/start-server.sh"
ExecStop=/home/zomboid/rcon -a 127.0.0.1:27015 -p [PASSWORD] save
ExecStop=/home/zomboid/rcon -a 127.0.0.1:27015 -p [PASSWORD] quit
ExecStop=/bin/sh -c "/usr/bin/screen -S zomboidserver -X quit"

[Install]
WantedBy=multi-user.target

24. After filling out this file, save and quit by pressing CTRL + X, Y, and then ENTER.

Starting the Project Zomboid Dedicated Server on Linux

25. With the service written, we can get Linux to automatically start our Project Zomboid dedicated server by typing in the command below.

When your system restarts or crashes, it will automatically start up your game server when it comes back online

sudo systemctl enable zomboidserver

26. Of course, if you want to play on your server immediately, you can use the following command to start the service immediately.

sudo systemctl start zomboidserver

27. At this point, you should now be able to connect to your Project Zomboid server using the IP address of your machine.

Make sure that you have allowed ports 16261 and 16261 through your firewall. If you are using Ubuntu, you can do this using the following command.

sudo ufw allow 16261/udp
sudo ufw allow 16262/udp

Additionally, if you are hosting this from your home network, you must forward these two ports to your machine. Alternatively, you can use a service like Tailscale to work around this.

You can customize your server by connecting through the game client and using “admin” followed by the password you set as your connection details.

Conclusion

Hopefully, at this stage, you will have successfully set up and run a Project Zomboid dedicated server on your Linux device.

Due to the way the Zomboid server operates on Linux, it requires some work to function properly.

Please leave a comment below if you have any issues with running this server on your device.

If you found this tutorial to be helpful, we highly recommend checking out our many other game server tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *

2 Comments

  1. Avatar for frownie
    frownie on

    I have followed the steps (slightly altered due to a mounted drive), but I cannot seem to find the “servertest.ini” where all the other documents have installed. I also note step 8 and 18 are not consist with each other. Unless they are different on purpose?

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Frownie,

      Steps 7 and 18 definitely shouldn’t have differed like that. I have updated the tutorial to use the correct path so hopefully that will fix the issue you have been running into.

      If you continue to run into issues, please drop a comment and I’ll look into it further.

      Kind regards,
      Emmet