Skip to main content

Docker

Using docker is probably the easiest version to host a private server. Especially when running Linux. This section will show you how to host the entire infrastructure using docker and docker compose.

Prequisite

  • docker (any version that supports compose v2)

Running the Infrastructure using Docker Compose

To run the private server infrastructure using docker compose you can use the one here. This compose file includes all the services needed to host a private server.

Once copied the following should start all neccessary services as well as the private server itself:

docker compose up -d
caution

Currently the knockout-city-docker image does not include any authentication services by default.

Authentication Proxy

To include the Authenication Proxy into the Infrastructure the compose.yaml has to be extended and the services reconfigured. Firstly we need to include the Authentication Proxy as a service by adding the following under the services section:

proxy:
image: ghcr.io/kocxyz/authproxy
container_name: koc-proxy

environment:
# Change these
SERVER_NAME: <YOUR_SERVER_NAME>
PUBLIC_ADDRESS: <PUBLIC_ADDRESS>
MAX_PLAYERS: <MAX_PLAYERS>

REDIS_HOST: <REDIS_IP>
REDIS_PORT: <REDIS_PORT>
REDIS_PASSWORD: <REDIS_PASSWORD_REMOVE_IF_NOT_USED>

# Dont change these
EXTERNAL_PORT: 23600
INTERNAL_HOST: server
INTERNAL_PORT: 23500

ports:
- '23600:23600/tcp'

depends_on:
- server

Next up we need to reconfigure the server service slightly:

server:
...

environment:
...

KOC_BACKEND_PORT: 23500
KOC_SERVER_MIN_PORT: 23600
KOC_SERVER_MAX_PORT: 23699

...

ports:
- "23600-23699:23600-23699/udp"

...

Running a Private Server without Docker Compose

Detailed information about the knockout-city-docker image can be found here.