Skip to content

Tor-del/zomboid-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Zomboid Server Setup

This document provides an overview of setting up the Project Zomboid server using Docker.

Running in docker compose

You can use the provided compose.example.yml file to run the server in a docker-compose environment. To do so, follow these steps:

  1. Ensure you have Docker and Docker Compose installed on your machine.

  2. Navigate to the directory containing the compose.example.yml file.

  3. Run the following command to start the server:

    docker compose -f compose.example.yml up -d
  4. To stop the server, use:

    docker compose -f compose.example.yml down

Note: The compose.example.yml file contains the default configuration for the server. You can modify the file to customize the server setup according to your requirements.

Running in docker

You can also run the server using the docker command. To do so, follow these steps:

  1. Ensure you have Docker installed on your machine.

  2. Navigate to the directory containing the compose.example.yml file.

  3. Run the following command to start the server:

    docker run -d --name zomboid -v zomboid_cache:/app -v zomboid_data:/data tordel/zomboid:latest

    Or with ENV variables:

     docker run -d --name zomboid -v zomboid_cache:/app -v zomboid_data:/data -e VERIFY=false -e AUTO_UPDATE=true -e MEM_LIMIT=8g -e PORT=16261 -e UDP_PORT=16262 -e SERVERNAME=servertest -e ADMIN_USERNAME=admin -e ADMIN_PASSWORD=admin -e GID=1000 -e UID=1000 tordel/zomboid:latest
  4. To stop the server, use:

    docker stop zomboid

Data Persistence

This section describes how to ensure that data generated by the server persists across restarts.

  1. Ensure that you correctly configure the volumes in the compose.example.yml file to keep data safe.
  2. The zomboid_cache and zomboid_data volumes are used to store persistent data.
  3. The zomboid_cache volume is used to store the server files, while the zomboid_data volume is used to store the world save data.

Note: If Docker is installed as root and the container runs as an unprivileged user, the volumes should have permissions that specifically grant access to that user. For instance, you may set permissions to 700 for the corresponding $UID:$GID, provided that this configuration meets your application's security and functional requirements.

Environment Variables

The following environment variables can be configured to customize your server setup:

  • VERIFY: Set to true to verify the server files on startup. Default is true.
  • AUTO_UPDATE: Set to true to automatically update the server files on startup. Default is true.
  • MEM_LIMIT: Set the memory limit for the server. Default is 8g.
  • PORT: Specify the port for the server to listen on. Default is 16261.
  • UDP_PORT: Specify the UDP port for the server. Default is 16262.
  • SERVERNAME: Set the name of the server. Default is servertest.
  • ADMIN_USERNAME: Set the username for the admin. Default is admin.
  • ADMIN_PASSWORD: Set the password for the admin. Default is admin.
  • GID: Set the group ID for the server. Default is 1000.
  • UID: Set the user ID for the server. Default is 1000.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published