Zombie Panic! Source

Zombie Panic! Source

Not enough ratings
[ZPS v3.1+ - Linux] How to setup a dedicated server
By Shepard and 1 collaborators
This guide explains to server operators how to install and configure a Zombie Panic! Source dedicated server version 3.1 and higher on Linux.
   
Award
Favorite
Favorited
Unfavorite
Disclamers
Before explaining how to do this, here are a few disclaimers you should be aware of when following this guide.

Linux distribution

This guide has been tested on a clean 64 bits installation of Ubuntu Server 24.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, Debian, 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.

Operating system installation and updates

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.

Port forwarding

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:

Description
Protocol
Port
Direction
Required?
Additional information
Game transmission, pings and RCON (Remote CONtrol)
TCP and UDP
27015
Ingoing and outgoing
Yes
Port can be changed using the "-port <port>" command-line argument when starting the later (see later).
SourceTV
UDP
27020
Ingoing and outgoing
Only if you want a SourceTV client
Port can be changed using the "+tv_port <port>" command-line argument when starting the later (see later).
Client
UDP
27005
Ingoing and outgoing
Yes
Port can be changed using the "-clientport <port>" command-line argument when starting the later (see later).
Steam
UDP
26900
Outgoing
Only if you want the server to be visible by Steam and in the servers browser
Port can be changed using the "-sport <port>" command-line argument when starting the later (see later).

You might see the outgoing UDP ports 27005 and 51840 being used as well but it is not necessary to open them.

Firewall

If you have a firewall (you should have one if that's not the case and your server will be exposed to Internet), it is up to you to make the necessary changes so that it allows the ingoing and outgoing connections to the ports above.

Basic Linux knowledge expected

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. You will be required to use it to download, update and validate if needed your Zombie Panic! Source dedicated server installation.

For security reasons, you are encouraged to avoid using user accounts with privileges like "root" to download, install and use SteamCMD. Create an user account that is specifically dedicated to SteamCMD operations (this guide will assume you did and will call that user "steamcmd") from now on.

Please refer to Valve Developer Community (VDC) wiki article about SteamCMD on how to download and install it.
Managing the ZPS dedicated server build
Same warning as SteamCMD above: for security reasons, you are encouraged to create an user account specifically tailored to run your Zombie Panic! Source dedicated server and not use any privileged user account like "root". It's also a good idea not to re-use the "steamcmd" account mentioned previously to run the server. Be mindful of permissions between this new account and "steamcmd". This guide will assume that the new account is named "zpsuser" and the server will be installed inside that new account's home folder ("/home/zpsuser")

When you start SteamCMD, it is going to self-update itself automatically if needed. At some point, you will be able to issue commands.

Dedicated server installation path

By default, SteamCMD will install the dedicated server in "$STEAMCMD/steamapps/common/Zombie Panic Source Dedicated Server". "$STEAMCMD" being where SteamCMD is installed ("/home/steamcmd/Steam" if you installed it manually using the same path as mentioned in the wiki for example).

It is recommended to use a simplier path (especially if SteamCMD was installed through a package manager like APT, Pacman...), you can issue the "force_install_dir" command with an absolute path argument like this:

force_install_dir <absolute path>

For example, if you want the dedicated server to be in "/home/zpsuser/ZPS_Server", the command would be:

force_install_dir /home/zpsuser/ZPS_Server

Logging in

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:

login anonymous

If the log in process fails, you might have a firewall that is too aggressive, fix it. Otherwise keep reading.

Downloading, updating and verifying the dedicated server installation

Once you are logged in, you can download the dedicated server build of ZPS by using the "app_update" command, its syntax is:

app_update <appid> [validate] [-beta <branch name>] [-betapassword <branch password>]

"<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 you 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:

app_update 17505

Simply download or update the default public branch of the dedicated server build.

app_update 17505 validate

Download or update the default public branch of the dedicated server build and verify that the installation is not corrupted.

app_update 17505 -beta unstable

Simply download or update the "unstable" branch of the dedicated server build.

app_update 17505 validate -beta legacy2.4

Download or update the unsupported legacy v2.4 branch of the dedicated server build and verify that the installation is not corrupted.

One line command to be faster (or for scripts)

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:

steamcmd +login anonymous +force_install_dir /home/zpsuser/ZPS_Server +app_update 17505 +quit

The command above will start SteamCMD, log in as "anonymous", set the installation path to "/home/zpsuser/ZPS_Server" 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.

Downloading and installing the Steam Runtime

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:

tar -xvf steam-runtime.tar.xz

A "steam-runtime" folder should appear, run the "setup.sh" script inside it and let it update the pins:

./setup.sh
Running the dedicated server
Starting the dedicated server

To run the dedicated server build using the Steam Runtime, simply adapt and use this command:

$STEAM_RUNTIME_PATH/run.sh $ZPS_SERVER_PATH/srcds_run -maxplayers 24 -secure -steam +servercfgfile my_server.cfg +map zpo_biotec

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.

Testing the dedicated server

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.

December 2022 update: if you have an error about "GCC_7.0.0", remove the "bin/libgcc_s.so.1" file and try again.
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:

cd bin mv steamclient.so steamclient.so.bak ln -s /home/steamcmd/.steam/steamcmd/linux32/steamclient.so steamclient.so

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.
1 Comments
NaNaChi Mar 4, 2024 @ 10:07pm 
i have this bug.., can you help me ?
[[[[[[[[[[[[[[[[[[[[[[
./srcds_run: 1: ./srcds_run: gdb: not found
WARNING: Please install gdb first.
goto http://www.gnu.org/software/gdb/
]]]]]]]]]]]]]]]]]]]]]]