Running a Server

KF2 Dedicated Server: Official Wiki Reference (Ports, Launch Options, INI, Workshop, Takeover)

This is a condensed version of the official Killing Floor 2 wiki page on dedicated servers, reorganised as a reference. For step-by-step guides see KF2 dedicated server via SteamCMD and starting a KF2 dedicated server.

Install and update with SteamCMD

You do not need an account that owns KF2: log in anonymously.

Steam> login anonymous
Steam> force_install_dir .\KF2Server\
Steam> app_update 232130 validate
Steam> quit
  • app_update 232130 updates an existing install; add validate to check the files.
  • app_update 232130 -beta "branch name" installs a beta branch when Tripwire runs one.

Automating it, one line:

SteamCmd +force_install_dir ./KF2Server +login anonymous +app_update 232130 validate +exit

Or a script run with SteamCmd +runscript kf2_ds.txt:

force_install_dir ./KF2Server
login anonymous
app_update 232130 validate
exit

validate overwrites KF2Server.bat on every update. If you edited it, launch from your own batch file instead.

On Linux: sudo apt install steamcmd, put the same commands in a script with an absolute force_install_dir, and run steamcmd +runscript /path/update.txt.

Start the server

start .\Binaries\win64\kfserver kf-bioticslab
./Binaries/Win64/KFGameSteamServer.bin.x86_64 kf-bioticslab

The included .bat file does not work on Linux.

To bring a Windows server back up automatically after a crash, run it in a loop (a script by SuSpeCT from the killingfloor.ru forum):

@echo off
title KF2 ANTICRASH
:loop
echo (%time%) Server started.
start /wait .\Binaries\win64\kfserver.exe kf-bioticslab?MaxPlayers=6?Difficulty=1
echo (%time%) WARNING: server closed or crashed, restarting.
goto loop

To stop the server for good, close the script window first, then the server window.

If the log repeats Attempting server re-register now... and Waiting for Steam Server UID: close any Steam game on that machine, validate the files, and install UE3Redist.exe from Binaries\Redist.

Ports

PortDefaultProtocolPurpose
Game7777UDPMain game traffic
Query27015UDPSteam master server
Web Admin8080TCPWebAdmin page, if enabled
Steam20560UDPSteam
NTP123UDPWeekly Outbreak only: internet time to pick the right outbreak

Game modes

Survival (6 players) is the default. Others are selected with ?Game= or in WebAdmin's Change Map tab:

ModeLaunch URL additionPlayers
Versus Survival?Game=KFGameContent.KFGameInfo_VersusSurvival?maxplayers=12up to 12
Weekly Outbreak?Game=KFGameContent.KFGameInfo_WeeklySurvival6
Endless?Game=KFGameContent.KFGameInfo_Endless6

At the time the wiki was written, Versus supported BurningParis, BioticsLab, Prison, VolterManor and Farmhouse.

Command-line options

Launch the server once first: it generates the config files from the defaults. Never edit the Default* files.

URL arguments (kf-bioticslab?AdminPassword=x?MaxPlayers=6):

ArgumentMeaning
AdminName=WebAdmin user name when configuring from the command line
AdminPassword=Server admin password
MaxPlayers=Player limit
Difficulty=0 Normal, 1 Hard, 2 Suicidal, 3 Hell on Earth

Switches (kf-bioticslab -Port=7787):

SwitchMeaning
-Port=Game port. Changing it shifts the query port by the same amount unless you set -QueryPort
-QueryPort=Steam query port (default 27015)
-WebAdminPort=WebAdmin port (marked beta on the wiki)
-Multihome=Binds the server to one IP on a machine with several
-PREFERREDPROCESSOR=Pins the process to one core/thread
-ConfigSubDir=Reads INI files from a subfolder of KFGame/Config, so several servers can have separate settings

PCServer-KFGame.ini

SectionKeyMeaning
[Engine.AccessControl]AdminPasswordAdmin password, also the WebAdmin password for user Admin
[Engine.AccessControl]GamePasswordPassword players need to join
[Engine.GameReplicationInfo]ServerNameName in the browser and in game
[Engine.GameReplicationInfo]AdminContactContact shown in the browser
game sectionbUseMapList=TrueUse your own map list instead of all maps
game sectionGameLength=0 short (4 waves), 1 normal (7), 2 long (10)

Map cycle example:

GameMapCycles=(Maps=("KF-BurningParis","KF-Bioticslab","KF-Outpost","KF-VolterManor","KF-Catacombs","KF-EvacuationPoint"))

Do not put more than 519 maps in rotation; the wiki warns it breaks the server.

PCServer-KFEngine.ini: tick rate and DDoS protection

Under [IpDrv.TcpNetDriver]:

KeyDefaultMeaning
NetServerMaxTickRate30Server tick rate
EnableDDOSProtectionMust be True for the settings below to work
MaxUnverifiedConnections1500Simultaneous unverified connections before new ones are ignored
HandShakeTimeOutSec1Handshake timeout in seconds
EnableBlockListBlock an IP with too many unverified connections
MaxUnverifiedConsWithSameIpToBlock16Unverified connections from one IP before it is blocked
BlockListTimeSeconds60How long the IP stays blocked

More on tick rate: KF2 tickrate guide.

WebAdmin

  1. In KFWeb.ini, section [IpDrv.WebServer], set bEnabled=true. Change ListenPort=8080 if you run several servers on one IP.
  2. Open http://server-ip:8080 in a browser. User Admin, password = AdminPassword from PCServer-KFGame.ini. With no admin password set, nobody can log in.

Several admins: in KFWebAdmin.ini under [WebAdmin.WebAdmin] add AuthenticationClass=WebAdmin.MultiWebAdminAuth, start the server once, then add admins in WebAdmin or in the generated MultiAdmin.ini.

Workshop maps

With the server stopped (a running server overwrites the changes):

; PCServer-KFEngine.ini
[OnlineSubsystemSteamworks.KFWorkshopSteamworks]
ServerSubscribedWorkshopItems=605633924
ServerSubscribedWorkshopItems=605551918

[IpDrv.TcpNetDriver]
DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload
  • The number is the id= from the Workshop URL.
  • The DownloadManagers line must be the first one in its section. Do not delete anything else there.
  • Start the server, wait for the downloads, stop it, then find the map file name in KFGame\Cache\<id>\0\BrewedPC (without .kfm) and add it to the map cycle.
  • On Linux the cache folder is not created automatically: mkdir -p KFGame/Cache.

To show a custom map in WebAdmin's Change Map list, add a data store to PCServer-KFGame.ini:

[KF-Default KFMapSummary]
MapName=KF-Default
ScreenshotPathName=UI_MapPreview_TEX.UI_MapPreview_Placeholder

The old HTTP redirect ([IpDrv.HTTPDownload] with RedirectToURL=) is deprecated by Workshop. If you still use one on Linux, end the URL with a slash and keep map names lowercase, otherwise clients get 1 KB empty files. See also custom maps via nginx redirect.

Welcome screen

In PCServer-KFGame.ini, with the server stopped:

BannerLink=http://example.com/banner.png
ServerMOTD=Welcome to our server. \n \n Have fun and good luck!
WebsiteLink=http://example.com/

The banner must be a PNG. \n makes a new line. Setting WebsiteLink through WebAdmin resets it to empty after saving, so edit it in the file.

Server Takeover

Server Takeover lets matchmaking players who start a private game "borrow" an idle server that has not opted out: the server switches to their settings and becomes private for the session, without exposing admin passwords, then opens up again. To opt out:

; PCServer-KFEngine.ini
[Engine.GameEngine]
bUsedForTakeover=FALSE

You can also turn it off in WebAdmin's general settings.

FAQ

How do I stop players from taking over my KF2 server?
Add bUsedForTakeover=FALSE under [Engine.GameEngine] in PCServer-KFEngine.ini. The server is then removed from the Server Takeover pool.
Why does my KF2 server keep printing 'Waiting for Steam Server UID'?
Close any Steam game running on the same machine, validate the server files with app_update 232130 validate, and install UE3Redist.exe from Binaries\Redist.