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.
$ 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 thehost
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
Your Game Server Login Token if you want to run the server on the internet.
Your Steam Web API Key to download workshop maps.
GOKZ will always be installed, unless TIMER
is set to kztimer
Default: not set
If MAPCHOOSER
is set to yes
, the default Sourcemod mapchooser will be enabled.
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.
Default: 27015
The port the server is listening to.
Default: 16
The maximum players allowed to join the server.
The server name.
Default: none
The RCON password to administrate the server.
Default: none
The password to join the server.
Default: 128
The server game tick interval.
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.
Print commands in the log.
Additional parameters to pass to srcds_run
.
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.
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.
Add configs to /home/user/csgo
:
.
├── addons
│ └── sourcemod
│ └── configs
│ └── admins_simple.ini # Will be overwritten
└── cfg
└── server.cfg # Will be added
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
Once the server has been installed, the container will check for an update at every start.
Restart the container with docker restart
.
Container named csgo
:
$ docker restart csgo
$ 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