Running a Server

KF2 Dedicated Server in Docker: SteamCMD and compose.yml Setup

This is a translated version of a short Chinese guide that sets up a Killing Floor 2 dedicated server on Linux with Docker. It complements the more general dedicated server guide and the Docker and VPS guide with custom workshop maps.

1. Install Docker

If Docker is missing, install it from the official docs (docs.docker.com/engine/install).

2. Prepare the directory and SteamCMD

Go to the folder where the server will live, for example:

cd /data
mkdir kf2
cd kf2

Initialize SteamCMD from the cm2network/steamcmd image:

docker create --name steamcmd cm2network/steamcmd
mkdir steamcmd
docker cp steamcmd:/home/steam/steamcmd/. ./steamcmd
docker rm steamcmd
chown -R 1000:1000 steamcmd/

3. Download the server

docker run --rm -it -v ./steamcmd:/home/steam/steamcmd cm2network/steamcmd ./steamcmd.sh +force_install_dir ./KF2Server +login anonymous +app_update 232130 validate +exit

4. Create compose.yml

services:
  kf2-server:
    image: cm2network/steamcmd:latest
    restart: unless-stopped
    network_mode: bridge
    ports:
      - 7777:7777/udp
      - 27015:27015/udp
      - 8080:8080/tcp
    volumes:
      - ./steamcmd:/home/steam/steamcmd
    extra_hosts:
      - time.google.com:169.254.0.79
    logging:
      driver: json-file
      options:
        max-size: 3m
    command: >-
      /home/steam/steamcmd/KF2Server/Binaries/Win64/KFGameSteamServer.bin.x86_64 kf-bioticslab

The last line starts the server on the Biotics Lab map. The extra time.google.com host entry is part of the original setup.

5. Extra configuration

Enable the web interface. Edit KFGame/Config/KFWeb.ini and set bEnabled=true under [IpDrv.WebServer].

Workshop subscriptions. Edit KFGame/Config/LinuxServer-KFEngine.ini and, under [OnlineSubsystemSteamworks.KFWorkshopSteamworks], add ServerSubscribedWorkshopItems=<id> (the guide uses 675314991 as a multiplayer mod example). Multiplayer mods must be moved by hand into the BrewedPC folder.

Server settings. Edit KFGame/Config/LinuxServer-KFGame.ini:

  • [Engine.AccessControl]: AdminPassword and GamePassword.
  • [KFGame.KFGameInfo]: BannerLink, ServerMOTD, WebsiteLink, ClanMotto.
  • [Engine.GameReplicationInfo]: ServerName and ShortName.

Non-English names must be saved in UTF-16 LE with BOM to avoid garbled text. The game resets the file to defaults when the server closes, so mark it read-only.

Disable takeover. Otherwise even a passworded server can be taken over by matchmaking. In LinuxServer-KFEngine.ini under [Engine.GameEngine] set bUsedForTakeover=FALSE.

For more parameters see the official wiki page for the Killing Floor 2 dedicated server.

6. Run

docker compose up -d

FAQ

Which Steam app ID is the KF2 dedicated server?
232130, downloaded anonymously with SteamCMD.
Which ports does the compose file publish?
7777/udp (game), 27015/udp (query) and 8080/tcp (WebAdmin).
How do I stop random players from taking over my passworded server?
In LinuxServer-KFEngine.ini set bUsedForTakeover=FALSE under [Engine.GameEngine].