This is my attempt to get the slightly cantankerous Project Zomboid dedicated server working with docker compose.
Clone this repo somewhere in your web server:
git clone https://github.com/qualiaa/project-zomboid-dedicated-server
Now enter the repository root:
cd project-zomboid-dedicated-server
You may wish to change the listening ports in the (hidden) .env
file.
Note: you do not need to change the ports in the
compose.yml
file.
Set the server admin password by modifying the file secrets/admin-password
.
Now install the server software with the command:
utils/install
NOTE: After installation, you probably want to tweak the
-Xmx8g
maximum allocated RAM inconfig/jvm-config.yml
; replace8g
with some other value inm
egabytes org
igabytes.
To start a new world, change the SERVER_NAME
value in the (hidden) file
.env
.
NOTE: If you want to set up mods for the server, modify the template config file at
scripts/default.ini
appropriately. Changes you make here will be copied into the world-specific config files generated later.
Now start the server with:
docker-compose up
This will automatically exit after completing initial world setup. You can then
find server config files in config/Zomboid/Server
; edit them to suit your
needs.
On subsequent runs the server should be run with:
docker-compose up --detach
You can bring the server down safely at any time with:
docker-compose down
When an update is released, you should bring the server down with:
docker-compose down
then issue the command:
utils/update
then bring the server up again with:
docker-compose up --detach
In order to run multiple servers, duplicate the .env
file, for example to
server-1.env
and server-2.env
. Make sure you set the ports and SERVER_NAME
differently for each server. Then launch each one with
docker-compose --env-file "server-1.env" up --detach
docker-compose --env-file "server-2.env" up --detach
NOTE: All servers will share the same config folder and game data. If you want to separate them completely, for example to run servers at different game versions, you need to copy the whole compose project folder and manage each one independently.
RCON is currently broken and I don't have time to work out how to fix it.
As a stop-gap measure, there is a script utils/send-cmd
which passes its
arguments as input to the server:
send-cmd help
send-cmd players
send-cmd quit