project zomboid server with docker

The Last Judgment, Hieronymus Bosch, circa 1482–1516

⚠️ Make sure to have docker engine installed.

I will use Renegade-Master's zomboid-dedicated-server. Clone the repo and edit docker-compose. Change the environment variables to your desire.

$ git clone https://github.com/Renegade-Master/zomboid-dedicated-server && cd zomboid-dedicated-server
$ vi docker-compose.yaml

docker-compose.yaml

version: "3.8"

services:
  zomboid-dedicated-server:
    build:
      context: .
      dockerfile: docker/zomboid-dedicated-server.Dockerfile
    image: "docker.io/renegademaster/zomboid-dedicated-server:latest"
    container_name: zomboid-dedicated-server
    restart: "no"
    environment:
      - "ADMIN_PASSWORD=changeme"
      - "ADMIN_USERNAME=superuser"
      - "AUTOSAVE_INTERVAL=15"
      - "BIND_IP=0.0.0.0"
      - "DEFAULT_PORT=16261"
      - "GAME_VERSION=public"
      - "GC_CONFIG=ZGC"
      - "MAP_NAMES=Muldraugh, KY"
      - "MAX_PLAYERS=16"
      - "MAX_RAM=4096m"
      - "MOD_NAMES="
      - "MOD_WORKSHOP_IDS="
      - "PAUSE_ON_EMPTY=true"
      - "PUBLIC_SERVER=true"
      - "RCON_PASSWORD=changeme_rcon"
      - "RCON_PORT=27015"
      - "SERVER_NAME=ZomboidServer"
      - "SERVER_PASSWORD="
      - "STEAM_VAC=true"
      - "UDP_PORT=16262"
      - "USE_STEAM=true"
      - "TZ=UTC"
    ports:
      - target: 16261
        published: 16261
        protocol: udp
      - target: 16262
        published: 16262
        protocol: udp
      - target: 27015
        published: 27015
        protocol: tcp
    volumes:
      - ./ZomboidDedicatedServer:/home/steam/ZomboidDedicatedServer
      - ./ZomboidConfig:/home/steam/Zomboid/

Next build and run the service

$ docker compose build .
$ docker compose up -d zomboid-dedicated-server

The server should begin shortly. It will take several minutes to start for the first time. Check the status with

$ docker container ls

and logs with

$ docker container logs {hash_from_previous_command}

Adding an admin user with RCON

You can further change settings using RCON or the in-game interface. To use to interface, you will have to make a player an administrators. The easiest way I found is to use gorcon’s rcon-cli.

Download the tar for your system from https://github.com/gorcon/rcon-cli/releases.

$ wget https://github.com/gorcon/rcon-cli/releases/download/{version}/rcon-{version}.tar.gz
$ tar xzf rcon-{version}.tar.gz
$ cp rcon-{version}/rcon /usr/local/bin/
$ rcon -e zomboid -a localhost:27015 -p "YOUR_RCON_PASSWORD"
> players
> setaccesslevel PLAYER admin

Issues

Can’t Connect

If you are connecting over the internet make sure you have ports 16261/udp and 16262/udp open on your router. If you plan to use RCON make sure port 27015/tcp is open.

Make sure ports are open if using UFW

$ ufw status
$ ufw allow 16261:16262/udp
$ ufw allow 27015/tcp