Running a Project Zomboid server on a Linux system can be an enriching experience, offering a stable and customizable environment for hosting multiplayer sessions. This guide will walk you through the steps of downloading, installing, configuring, and managing your Project Zomboid server on a Linux system. Whether you’re a seasoned server administrator or new to Linux, this comprehensive guide aims to make the process straightforward and efficient.
Key Takeaways
- Learn how to download and install the Project Zomboid server on a Linux system using SteamCMD.
- Understand the steps to configure and run your server, including editing configuration files and setting up admin commands.
- Gain insights into managing network settings and ports to ensure smooth server operation and the ability to run multiple server instances.
Downloading and Installing Project Zomboid Server on Linux
Using SteamCMD
To get started with hosting a Project Zomboid server on Linux, you’ll need to use SteamCMD, the command-line version of Steam. First, install SteamCMD on your system. For Debian and Ubuntu, you can do this by running:
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd
Once SteamCMD is installed, create a new user to run the server. This is important for security reasons. You can add a user named pzuser
with the following command:
sudo adduser pzuser
Switch to the new user and create a directory for the server files:
sudo -u pzuser -i
mkdir -p /opt/pzserver
Setting Up the Installation Directory
Next, you’ll need to set up the installation directory for the server files. Create a configuration file to manage the SteamCMD commands:
cat >$HOME/update_zomboid.txt <<EOL
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
force_install_dir /opt/pzserver/
login anonymous
app_update 380870 validate
quit
EOL
Installing the Server Files
Now, you can install the Project Zomboid server files. Run the following command to execute the script you just created:
export PATH=$PATH:/usr/games
steamcmd +runscript $HOME/update_zomboid.txt
Once the installation is complete, you should see a message saying "Success! App ‘380870’ fully installed". This means your server files are now ready to use.
Note: You will use the same command to update the server files whenever a new version is released.
Configuring and Running the Server
Editing Server Configuration Files
To get started, you’ll need to edit the server configuration files. If the server has been run at least once, follow these steps:
- Select
servertest
from the list of saved server settings. - Click
Edit Settings
. - Modify the desired settings and save.
If the server hasn’t been run yet:
- Click
Create New Settings
. - Name these settings
servertest
. - Edit the desired settings and save.
Starting the Server with Tmux
Using tmux
is a great way to keep your server running even if your terminal session is interrupted. First, install tmux
if you haven’t already:
sudo apt-get install tmux
Start a new tmux
session:
tmux
Run the server within this session:
bash start-server.sh -servername SERVERNAME
If you need to detach from the session, press Ctrl + B
followed by D
. To reattach, use:
tmux a
Setting Up Admin Commands
Project Zomboid offers several admin commands to manage your server effectively. Here are some essential commands:
- /additem: Give an item to a player. Usage:
/additem "username" "module.item" count
. - /adduser: Add a new user to a whitelisted server. Usage:
/adduser "username" "password"
. - /banuser: Ban a user. Usage:
/banuser "username" -ip -r "reason"
. - /godmode: Make a player invincible. Usage:
/godmode "username" -value
.
Pro Tip: Use the /help command to display a full list of available admin commands or /help *command* for details on a specific command.
Managing Network and Ports
To ensure your Project Zomboid server runs smoothly, you need to manage your network settings and ports effectively. This involves forwarding the required ports, configuring your firewall, and potentially running multiple server instances on a single machine.
Conclusion
Setting up and managing a Project Zomboid server on a Linux system can seem daunting at first, but with the right guidance, it becomes a manageable task. By following the steps outlined in this article, you can successfully download, configure, and run your server, ensuring a stable and enjoyable multiplayer experience for you and your friends. Remember to regularly update your server and monitor its performance to maintain optimal gameplay. Whether you are a seasoned Linux user or a beginner, hosting your own server can be a rewarding experience that enhances your Project Zomboid adventures.