Overview
This guide explains to server operators how to install and configure a Zombie Panic! Source dedicated server version 3.1 and higher on Linux.
Disclamers
Before explaining how to do this, here are a few disclaimers you should be aware of when following this guide.
This guide has been tested on a clean 64 bits installation of Ubuntu Server 20.04.1 LTS in a virtual machine.
If you test this guide under a different architecture (32 bits) and/or a different distribution like ArchLinux, CentOS, Debian, Red Hat, feel free to share with everyone in the guide’s comments if it works or not and if you had to do stuff differently or not. Keep in mind that you may need to adapt commands.
It is assumed your Linux distribution is already installed and most importantly: up to date. This guide will not teach you those.
If you are renting a VPS (Virtual Private Server) or VDS (Virtual Dedicated Server), the installation part should already be covered by the hosting service for you. If not, you usually have some kind of control panel to (re)install/change the operating system.
It is assumed that you have already handled the forwarding of ports in your router. If not, do it now, this table is a reminder of ports used by most of Source dedicated server engines/executables:
You might see the outgoing UDP ports 27005 and 51840 being used as well but it is not necessary to open them.
If you have a firewall (you should have one if that is not the case and you are not making a LAN server), it is up to you to make the necessary changes so that it allows the ingoing and outgoing connections to the ports above.
This guide will not teach you how to change directory in an Unix terminal, neither how to create directories, remove them, change permissions and user/group ownership. If you have trouble using Linux in the first place, you should probably stop reading this guide and get familiar with it first.
Installing SteamCMD
SteamCMD is a command-line utility to download, update and validate applications from Steam’s catalogue.
For security reasons, you are encouraged to use a dedicated user for SteamCMD. You are also encouraged to avoid operating it as “root”. The command to create a “steamcmd” user is:
This is the recommended way to do this part.
Ubuntu / Debian
If you are on 32 bits, you can install the “steamcmd” package directly:
If you are on 64 bits, you need to add the “multiverse” repository first, then add the “i386” architecture. Don’t forget to “apt update” when this is done, and then you can grab the “steamcmd” package with the required “lib32gcc1” package. To accomplish all of this, issue these commands:
CentOS / Red Hat
Just install the “steamcmd” package:
ArchLinux
AUR has a “steamcmd” package, feel free to use an AUR helper to do the dirty work for you. If not, it is up to you download and build the package yourself. Assuming the latter (requires git), you would need to:
Note for all distributions
Some distributions will automatically link the “steamcmd” executable, this is handy because you could just type “steamcmd” in the terminal to run SteamCMD. That is the case for Ubuntu and likely Debian.
If your distribution did not make that link, you will have to make it yourself or refer to the full path for SteamCMD which is something like “/usr/games/steamcmd”.
If for some reason you do not trust your distribution package manager/repositories and/or you have an issue with them. You can use the following command to download SteamCMD directly using cURL and extract it right away:
Keep in mind that installing manually doesn’t exempt you from installing the required dependencies as stated in the previous section.
If you followed the security advice above, switch to the “steamcmd” user then run SteamCMD. If you have an issue, go to the troubleshooting section below and go back here. Otherwise, proceed to the next chapter.
I’m using a 64 bits Linux distribution and it complains about missing “libstdc++.so.6” binary
On Debian based distributions (Ubuntu, Linux Mint included), grab the “lib32stdc++6” package:
On Red Hat / CentOS:
On ArchLinux (requires the “multilib” repository to be enabled):
I have an error about “ulimit”
This will not block SteamCMD but may cause instabilities when following the rest of this guide, raise the “ulimit” value to 2048 in order to let SteamCMD operate as intended. You may need “root” privileges to increase the limits first:
Managing the ZPS dedicated server build
When you start SteamCMD, it is going to self-update itself automatically if needed. At some point, you will be able to issue commands.
By default, SteamCMD will install the dedicated server in “$HOME/.steam/SteamApps”. “$HOME” being the home directory of the user running SteamCMD (“/home/steamcmd” for example).
If you want to change the path, you can issue the “force_install_dir” command with an absolute path argument like this:
For example, if you want the dedicated server to be in “/home/steamcmd/zpsserver”, the command would be:
Zombie Panic! Source being a free game, you won’t need to log in using your Steam account and you can use the “anonymous” one. The command is:
If the log in process fails, you might have a firewall that is too aggressive, fix it. Otherwise keep reading.
Once you are logged in, you can download the dedicated server build of ZPS by using the “app_update” command, its syntax is:
“<appid>” is the concerned Steam application ID (AppID) to use, for the dedicated server part of Zombie Panic! Source, this is “17505”.
“[validate]” is an optional argument that does the same job as validating the game files on the Steam client. This is very useful to check if the download and installation processes went fine.
You should be using “validate” when making a “first time installation” or if your suspect your files got corrupted and need to repair them. When updating your dedicated server in case of a game update, you won’t need to use “validate”. Keep in mind that “validate” will override any existing file changed such as AngelScript plugins configuration, built-in admin. system configuration and server configuration. You might want to back up those first.
“[-beta <branch name>]” is an optional argument that is useful only if you want to download a different branch of the dedicated server build where “<branch name>” is the name of said branch that is different of the default/public one.
For example: to download the unsupported legacy v2.4 dedicated server build, you would add “-beta legacy2.4” to the command.
“[-betapassword <branch password>]” is an optional argument that is useful only if you are using the optional “-beta <branch name>” argument to download a seperate branch and if said branch is protected by a password. In the case of ZPS, you will rarely or never use this unless you are a playtester or developer.
Examples of “app_update” commands and their explanation:
Simply download or update the default public branch of the dedicated server build.
Download or update the default public branch of the dedicated server build and verify that the installation is not corrupted.
Simply download or update the “unstable” branch of the dedicated server build.
Download or update the unsupported legacy v2.4 branch of the dedicated server build and verify that the installation is not corrupted.
If you are making some script and/or you want to do all of this in a single one line command, it is possible to do somethi g like this:
The command above will start SteamCMD, log in as “anonymous”, set the installation path to “/home/zpsuser/zpssserver” and download or update the default public branch of the ZPS dedicated server build before closing itself.
Installing the Steam Runtime
There are two ways of running the ZPS dedicated server build: “natively” and using the “Steam Runtime”.
“Natively” means using the system’s libraries directly to run the dedicated server. The major problem with this approach is that Linux distributions doesn’t agree when it comes to libraries versions, deprecation policies, locations and such. This means that you may need to risk changing your system and/or mess around with your dedicated server installation to get it running this way.
The “Steam Runtime” is a “sandboxed modified Ubuntu installation” made by Valve to fix the problems mentioned above in the “native” way. It is used by default by the Steam client on Linux and video games are likely built to target that “Steam Runtime” which is the case of the Source engine and ZPS.
If you are still using the “steamcmd” user, you can leave it and use your standard user account.
The latest stable default branch of the Steam Runtime can be downloaded using this command:
If you want to use the “beta” branch instead (same thing as running the Steam client in “beta”), it is the same command but you need to replace “general-availability” in the link by “public-beta”.
Extract the downloaded “steam-runtime.tar.xz” file:
A “steam-runtime” folder should appear, run the “setup.sh” script inside it and let it update the pins:
Running the dedicated server
To run the dedicated server build using the Steam Runtime, simply adapt and use this command:
Explanations about this command:
“$STEAM_RUNTIME_PATH” is the path where you installed the Steam Runtime in the previous chapter (“/home/zpsuser/steam-runtime” for example).
“run.sh” is the script in the Steam Runtime to launch an application inside it (in our case: the ZPS dedicated server build).
“$ZPS_SERVER_PATH” is the path where you installed your ZPS dedicated server (“/home/zpsuser/zpsserver” for example)
“srcds_run” is the ZPS dedicated server shell script that act as a launcher for the real executable (“srcds_linux”)
“-maxplayers 24” defines how many slots the server has (24 clients without the SourceTV which is the maximum supported by ZPS)
“-secure” turns on VAC (Valve Anti-Cheat), servers that are not VAC protected are not shown in the servers browser but they still appear in Steam’s.
“-steam” tells the server to register itself with Steam.
“+servercfgfile my_server.cfg” tells the server that its configuration file is “zps/cfg/my_server.cfg” rather than the default “zps/cfg/server.cfg” (useful if you need to “validate” your dedicated server installation and don’t want to lose your changes because you changed the original file).
“+map zpo_biotec” tells the server to start on Biotec.
You can change this command and add extra parameters such as SourceTV, different ports if needed.
Aren’t you supposed to add “-console” as well?
Not needed on Linux since there is no GUI like Windows.
Aren’t you supposed to add “-game zps” as well?
Already covered by the “srcds_run” shell script, no need to duplicate it.
If you have done everything correctly, the dedicated server should start away and you should be able to issue the “status” command to print the server’s information in the console.
Post-installation steps
Now that you know that the dedicated server is running, you can stop it using the “quit” command and do the following post-installation steps. Those won’t be covered in this guide because it applies to Windows as well and thus outside of its scope.
- Making your own server configuration in “zps/cfg” like name of the server, region, LAN or Internet, password or not password protected…
- Update the “zps/data/adminsystem.json” file if you want to use the built-in administration system and add administrators/moderators to your server.
- Update the “zps/data/collection.txt” file if you want to use collections and/or items from the Steam Workshop such as community made maps.
- Setup AngelScript plugins in “zps/default_plugins.json”
- Update the “zps/mapcycle.txt” and “zps/maplist.txt” files if you installed Workshop/custom maps.
- Install and configure Metamod: Source and SourceMod and setup plugins if you want to make a custom server.
Once you have finished all of these steps: your ZPS v3.1+ Linux dedicated server is ready!
Fix the Steam Workshop issue
October 25th 2020 update: since ZPS v3.1.1, the Steam Workshop fix is already included within the base files. Keep reading if and only if you still have issues with the Steam Workshop or you are hosting a server for v3.1 or lower.
If you are using the Steam Workshop to host community made maps, you might have an issue where the download is stuck and the console gets spammed of “[Workshop] Downloading item: 123456789”.
This is not a ZPS specific issue and it also has been reported on other games like Killing Floor 2. The problem is that the Steam client binary included in base Source SDK 2013 Dedicated Server build becomes obsolete and thus no longer work.
To fix this, stop the server if it is running, backup or delete the “steamclient.so” file located in the “bin” folder of your ZPS dedicated server installation. Then either copy or make a symbolic link to the one shipped within SteamCMD (make sure you grab the 32 bits binary and not the 64 bits one).
Assuming you are on Ubuntu Server and in your ZPS dedicated server folder, the commands to issue would be something like this:
Start the server again and the problem should be fixed. Keep in mind that you might need to redo these steps if you “validate” your dedicated server installation.
When I start the server, there is an error about a missing “steamclient.so” in “.steam/sdk32” folder. What do I do?
Ignore it, if you are using the proper “steamclient.so” as mentioned above, you won’t need to put it in the mentioned folder.