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 232130updates an existing install; addvalidateto 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
| Port | Default | Protocol | Purpose |
|---|---|---|---|
| Game | 7777 | UDP | Main game traffic |
| Query | 27015 | UDP | Steam master server |
| Web Admin | 8080 | TCP | WebAdmin page, if enabled |
| Steam | 20560 | UDP | Steam |
| NTP | 123 | UDP | Weekly 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:
| Mode | Launch URL addition | Players |
|---|---|---|
| Versus Survival | ?Game=KFGameContent.KFGameInfo_VersusSurvival?maxplayers=12 | up to 12 |
| Weekly Outbreak | ?Game=KFGameContent.KFGameInfo_WeeklySurvival | 6 |
| Endless | ?Game=KFGameContent.KFGameInfo_Endless | 6 |
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):
| Argument | Meaning |
|---|---|
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):
| Switch | Meaning |
|---|---|
-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
| Section | Key | Meaning |
|---|---|---|
[Engine.AccessControl] | AdminPassword | Admin password, also the WebAdmin password for user Admin |
[Engine.AccessControl] | GamePassword | Password players need to join |
[Engine.GameReplicationInfo] | ServerName | Name in the browser and in game |
[Engine.GameReplicationInfo] | AdminContact | Contact shown in the browser |
| game section | bUseMapList=True | Use your own map list instead of all maps |
| game section | GameLength= | 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]:
| Key | Default | Meaning |
|---|---|---|
NetServerMaxTickRate | 30 | Server tick rate |
EnableDDOSProtection | Must be True for the settings below to work | |
MaxUnverifiedConnections | 1500 | Simultaneous unverified connections before new ones are ignored |
HandShakeTimeOutSec | 1 | Handshake timeout in seconds |
EnableBlockList | Block an IP with too many unverified connections | |
MaxUnverifiedConsWithSameIpToBlock | 16 | Unverified connections from one IP before it is blocked |
BlockListTimeSeconds | 60 | How long the IP stays blocked |
More on tick rate: KF2 tickrate guide.
WebAdmin
- In
KFWeb.ini, section[IpDrv.WebServer], setbEnabled=true. ChangeListenPort=8080if you run several servers on one IP. - Open
http://server-ip:8080in a browser. UserAdmin, password =AdminPasswordfromPCServer-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
DownloadManagersline 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.