Skip to content

Latest commit

 

History

History
180 lines (113 loc) · 5.39 KB

README.md

File metadata and controls

180 lines (113 loc) · 5.39 KB

kz

Run a KZ server in a Docker container!

The base of this image is a SteamCMD image maintained by Tim Cheung. I am rebasing my project on his image and entrypoint script, as his implementation is significantly better for production usage. I will do my best to keep this up to date with his changes.

How to Use This Image

$ docker run \
  -v=csgo:/home/csgo/server \
  --net=host \
  gelmo/kz
  • The server will be installed on a volume named csgo to ensure persistence of server files.
  • The server will be running on the default port 27015 on the host network for optimal network performance
  • The server will be running in LAN mode since a Game Server Login Token (GSLT) is required to run the server on the internet.
  • The server will be running GOKZ

Game Server Login Token (GSLT)

Environment Variables

CSGO_GSLT

Your Game Server Login Token if you want to run the server on the internet.

CSGO_WS_API_KEY

Your Steam Web API Key to download workshop maps.

TIMER

GOKZ will always be installed, unless TIMER is set to kztimer

MAPCHOOSER

Default: not set

If MAPCHOOSER is set to yes, the default Sourcemod mapchooser will be enabled.

CSGO_IP

Default: 0.0.0.0

The IP the server is assigned to. In most cases the default value is sufficient, but if you want to run a GOTV server or have issues connecting to the server, the actual IP of the server should be set.

CSGO_PORT

Default: 27015

The port the server is listening to.

CSGO_MAX_PLAYERS

Default: 16

The maximum players allowed to join the server.

CSGO_HOSTNAME

The server name.

CSGO_RCON_PW

Default: none

The RCON password to administrate the server.

CSGO_PW

Default: none

The password to join the server.

CSGO_TICKRATE

Default: 128

The server game tick interval.

CSGO_CUSTOM_CONFIGS_DIR

Default: /var/csgo

Absolute path to a directory in the container containing custom config files and maps. Changing this is not recommended in order to follow the documentation.

CSGO_DEBUG

Print commands in the log.

CSGO_PARAMS

Additional parameters to pass to srcds_run.

KZ_API_KEY

Set this variable to your API key for GlobalAPI, and the globalrecords.cfg file will be created for you. More information on that is available as a guide on the GOKZ forums. The KZ Server Advisor Plugin is already included in this image.

Populate with Own Configs and Maps

The server can be populated with your own config files and maps by copying the files from the custom configs directory located at CSGO_CUSTOM_CONFIGS_DIR to the csgo folder at each start of the container. CSGO_CUSTOM_CONFIGS_DIR is a mounted directory from the host system. The custom configs and maps directory must have the same folder structure as the csgo folder in order to add or overwrite the files at the paths.

Example

Host

Add configs to /home/user/csgo:

.
├── addons
│   └── sourcemod
│       └── configs
│           └── admins_simple.ini # Will be overwritten
└── cfg
    └── server.cfg # Will be added
Container

Mount /home/user/custom-configs to CSGO_CUSTOM_CONFIGS_DIR in the container:

$ docker run \
  -v=csgo:/home/csgo/server \
  -v=/home/user/csgo:/var/csgo \ # Mount the custom configs directory
  --net=host \
  gelmo/kz

Updating the Server

Once the server has been installed, the container will check for an update at every start.

Manually

Restart the container with docker restart.

Example

Container named csgo:

$ docker restart csgo

Private Server Example w/ custom configs, and the Sourcemod mapchooser

$ docker run \
  -v=csgo:/home/csgo/server \
  -v=/home/user/csgo:/var/csgo \
  --net=host \
  --env CSGO_GSLT=ABC123 \
  --env CSGO_WS_API_KEY=123ABC \
  --env CSGO_HOSTNAME="ServerName" \
  --env CSGO_PW=ServerPass \
  --env MAPCHOOSER=yes \
  --env KZ_API_KEY=12345678-abcd-1234-abcd-1234567890ab
  --name=csgo \
  gelmo/kz

This readme will be updated in the future. Todo list:

  • Automatically download workshop maps
  • Add documentation for using a separate sql instance instead of sqlite
  • Add documentation for running multiple instances in a stack via compose w/ discreet sql container and shared csgo volume