Project Zomboid

Project Zomboid

89 ratings
[B41MP] Configure and start a dedicated server
By Outpox
How to host a dedicated server on the newly released b41multiplayer beta to play with your friend. Basic server configuration knowledge preferred.
4
   
Award
Favorite
Favorited
Unfavorite
Introduction

On December 9th 2021 the PZ Team shared what we've been waiting for so long, the build 41 including multiplayer. This is great news and I would like to thanks and congratulate the team for their hard work. I bought PZ back in 2013 on Desura and it has been supported and updated since then!

This guide will be concise, I just want everyone to be able to host a game quickly and I will most likely not dive into too much details as I haven't even tried the multiplayer beta yet. I'm just sharing my current findings and will try to update the guide later on.

Before reading further please read the announcement : B41 MP Test 41.60 Branch Released![projectzomboid.com]
Getting started
For those who want to host a dedicated server using steamcmd, the appid is
380870
according to steamdb[steamdb.info].
Don't forget to specify the beta channel by adding "-beta b41multiplayer" at the end of your command.

For everyone else your steam account must own the game. In your library display your "Tools" (just below "Home"), look for "Project Zomboid Dedicated Server" and install it.




If you are wondering why and how I have [b41multiplayer] in my listing please refer to the announcement link shared in the introduction section, it is explained there. You should do the procedure for both the game and the server.

Once the server is installed:
  • Right click the server in your list on the left -> Properties
  • In local files -> Browse

This will open the folder where the server is installed. This should look like this:


Double click "StartServer64.bat", this will open a windows terminal which will ask you to set an admin password:


It will then ask you to confirm it. After that the server will load. Once it's done you can exit the window which will stop the server. This is required a first time to initialize the multiplayer map and other files. We will start it again once configured.
Server configuration
The configs and saves are in
%UserProfile%/Zomboid

Windows + r to execute it will open the folder:




If you don't want to edit files manually you can now start your game and click on "Host" which should now be displayed as you started your server at least once.

The server is named by default "servertest", its config is in the "Server" folder inside "servertest.ini". This is where you can set the server name as well as a password and much more.

If you want to rename your server it can be done by adding "-servername change_this" at the end of "StartServer64.bat" (thanks PuriPops!)

Retrieve your public ip via https://www.myip.com/ for example.
In servertest.ini update the following fields, use a text editor (such as VS Code[code.visualstudio.com]) and ctrl+f to look for them.

Open=true Public=true PublicName=Your servers name displayed in the server browser PublicDescription=Your servers description Password=your server password SteamVAC=true UPnP=false server_browser_announced_ip=your public ip retrieved earlier

Feel free to edit other fields, their name is self explanatory most of the time and the one I've listed are the minimum that should be edited for an online and private server.

I've also edited these fields on mine:
PauseEmpty=true ; I want my server to be paused when no one is online HoursForLootRespawn=48 ; Allow for item respawning MaxItemsForLootRespawn=6 AnnounceDeath=true ; I want to know when someone dies

Forward these ports on your router:
  • 27015 (for Steam)
  • 8766 (for Steam)
  • 8767 (for Steam)
  • 16261 (for PZ)
If you don't know how to do that have a look: https://www.noip.com/support/knowledgebase/general-port-forwarding-guide/

Once satisfied launch the server as the first time by double clicking "StartServer64.bat" (and NOT "StartServer64_nosteam.bat").

Server db is in the "db" folder and SQLite browser[sqlitebrowser.org] is able to open it.

Some more stuff in "Saves\Multiplayer\servertest".
Troubleshooting
  • If you have issues and want to start anew WHICH WILL DELETE YOUR SERVER SAVE!!!
Delete:
  • %UserProfile%\Zomboid\db\servertest.db
  • %UserProfile%\Zomboid\Saves\Multiplayer\servertest (the folder)
  • %UserProfile%\Zomboid\Server (the folder's content whose name is servertest)

If you have a message:
  • Failed to commit memory

This might be because your computer doesn't have enough RAM. By default the server tries to allocate 16Go.
If you edit the file "StartServer64MP.bat" (right click -> Edit) you will see "-Xms16g -Xmx16g" (underlined in the code below) which is what sets 16Go of RAM. If you don't see it you can add it.
@setlocal enableextensions @cd /d "%~dp0" SET PZ_CLASSPATH=java/istack-commons-runtime.jar;java/jassimp.jar;java/javacord-2.0.17-shaded.jar;java/javax.activation-api.jar;java/jaxb-api.jar;java/jaxb-runtime.jar;java/lwjgl.jar;java/lwjgl-natives-windows.jar;java/lwjgl-glfw.jar;java/lwjgl-glfw-natives-windows.jar;java/lwjgl-jemalloc.jar;java/lwjgl-jemalloc-natives-windows.jar;java/lwjgl-opengl.jar;java/lwjgl-opengl-natives-windows.jar;java/lwjgl_util.jar;java/sqlite-jdbc-3.27.2.1.jar;java/trove-3.0.3.jar;java/uncommons-maths-1.2.3.jar;java/ ".\jre64\bin\java.exe" -Djava.awt.headless=true -Dzomboid.steam=1 -Dzomboid.znetlog=1 -XX:+UseZGC -XX:-CreateCoredumpOnCrash -XX:-OmitStackTraceInFastThrow -Xms16g -Xmx16g -Djava.library.path=natives/;natives/win64/;. -cp %PZ_CLASSPATH% zombie.network.GameServer -statistic 10 -debuglog=Multiplayer,Death,Damage,Fall PAUSE

  • If you don't see "StartServer64MP.bat"
Make sure you are on the proper beta channel and read this guide's introduction where it is explained.
Closing notes
Other resources:

If this guide helped you please rate it!

If you have questions leave a comment and I'll try to help you.
Happy survival.
48 Comments
gunslinger_lucky tankijunky Jul 28, 2023 @ 3:29am 
"StartServer64MP.bat" hangs and does not proceed after:

LOG : Network , 1690539913090> 378,790,795> [28-07-23 06:25:13.090] > ZNet: Zomboid Server is VAC Secure
Duryy Jun 30, 2022 @ 5:04pm 
Hi, im facing this error: cannot establish a P2P connection to the server.
Aren Jan 27, 2022 @ 8:53am 
i need help i am having an issue where after several hours the server just will stop showing online
Burnz Jan 18, 2022 @ 8:28am 
I am using files already generated by the game by hosting a server first by the way.
Burnz Jan 18, 2022 @ 8:27am 
I might be a complete noob, but when you state "If you want to rename your server it can be done by adding "-servername change_this" at the end of "StartServer64.bat" (thanks PuriPops!)" What exactly do you mean? I tried editing the bat file with and without the ", same with making a shortcut and adding it in the target field. It only starts the "ServerTest" I am at a loss.
chrls Dec 23, 2021 @ 9:07pm 
i have an error which is this

Internal Error (./src/hotspot/os/windows/gc/z/zMapper_windows.cpp:240), pid=15060, tid=13304
fatal error: Failed to map memory: 0x000004009ae00000 2M (1455)
Zadrakos Dec 21, 2021 @ 6:21am 
Does anyone know how to transfer the players map data (what's revealed on the map, any map markings, etc) from the Host option through the GUI to the dedicated server? Despite both using the same profile, it reset the player map.
Yoyochillout Dec 20, 2021 @ 8:05am 
@Outpox I solved the problem. I used grant admin username on the server cmd. Ty for replying though!
Ben_Evans1 Dec 20, 2021 @ 2:24am 
@setlocal enableextensions
@cd /d "%~dp0"
SET PZ_CLASSPATH=java/istack-commons-runtime.jar;java/jassimp.jar;java/javacord-2.0.17-shaded.jar;java/javax.activation-api.jar;java/jaxb-api.jar;java/jaxb-runtime.jar;java/lwjgl.jar;java/lwjgl-natives-windows.jar;java/lwjgl-glfw.jar;java/lwjgl-glfw-natives-windows.jar;java/lwjgl-jemalloc.jar;java/lwjgl-jemalloc-natives-windows.jar;java/lwjgl-opengl.jar;java/lwjgl-opengl-natives-windows.jar;java/lwjgl_util.jar;java/sqlite-jdbc-3.27.2.1.jar;java/trove-3.0.3.jar;java/uncommons-maths-1.2.3.jar;java/
".\jre64\bin\java.exe" -Djava.awt.headless=true -Dzomboid.steam=1 -Dzomboid.znetlog=1 -XX:+UseZGC -XX:-CreateCoredumpOnCrash -XX:-OmitStackTraceInFastThrow -Xms10g -Xmx10g -Djava.library.path=natives/;natives/win64/;. -cp %PZ_CLASSPATH% zombie.network.GameServer -statistic 0
PAUSE
Ben_Evans1 Dec 20, 2021 @ 2:24am 
i turned off my firewall, set ports 16261 udp, 16262:16292 TCP, 8766 UDP, 27015 both udp and tcp, 8767 also both. UPNP = off, NAT on, WAN on,



Open=true
LogLocalChat=false
AutoCreateUserInWhiteList=false
DisplayUserName=true

DefaultPort=16261
ResetID=402973894
Mods=
Map=Muldraugh, KY
DoLuaChecksum=true
DenyLoginOnOverloadedServer=true
Public=true


ServerPlayerID=
RCONPort=27015
RCONPassword=
Password=
MaxAccountsPerUser=0
SteamPort1=8766
SteamPort2=8767
SteamScoreboard=true
SteamVAC=true
UPnP=true
UPnPLeaseTime=86400
UPnPZeroLeaseTimeFallback=true
UPnPForce=true
CoopServerLaunchTimeout=20
server_browser_announced_ip=178.173.119.143