Running a Server

KF2 Dedicated Server Step by Step: SteamCMD, WebAdmin, Ports

Since Killing Floor 2 dropped listen servers, learning to run a dedicated server is a must for anyone who wants to host. This guide, originally in Spanish, covers a public or private server from installation to port forwarding, and adds a handy set of console commands for a practice server.

Guide header Header of the original guide.

Step 1: install SteamCMD

Download steamcmd.zip from Valve and unpack it into a folder such as C:\SteamCMD\. Run steamcmd.exe, let it download its files and close it afterwards.

Step 2: install the KF2 server

To keep SteamCMD and the server in the same folder, run steamcmd again, type login anonymous, then app_update 232130. The server files land next to SteamCMD.

Alternative: separate folders

Create a folder for the server, for example C:\KF2Server\. In steamcmd run login anonymous, then force_install_dir C:\KF2Server\, then app_update 232130. The download takes a while; close the program when it finishes.

Step 3: test the server

Run the server once so the remaining files are generated. Start KF2Server.bat (a shortcut is handy). The map takes a while to load. Success looks like this in the console window:

  • Log: KF2 VERSION 10XX
  • Log: Initializing game engine completed
  • Log: STEAM GAME SERVER UID: XXXXXXXXX

The UID line shows the Steam connection works. If it is missing, update the server or check that port 20560 is open. Then open the game, find your server on the LAN tab and connect. Important: change the default password (123) in KF2Server.bat.

WebAdmin

WebAdmin setup Illustration from the WebAdmin section of the original guide.

  1. Find your IPv4 with ipconfig in cmd, for example 192.168.6.66.
  2. In ...\KFGame\Config\KFWeb.ini change bEnabled=false to bEnabled=true.
  3. Change the admin password in KF2Server.bat so nobody can troll your server.
  4. With the server running, open http://<your IPv4>:8080/ or localhost:8080 in a browser and log in (login admin, password from the .bat file).

Manual configuration

Close the server and edit ...\KFGame\Config\PCServer-KFGame.ini:

  • GameDifficulty: 0 Normal, 1 Hard, 2 Suicidal, 3 Hell on Earth.
  • GamePassword: set a password to restrict access.
  • GameLength: 0 short, 1 medium, 2 long.

Useful console commands for a practice server

Spawn a dazed ZED (SpawnZED Clot) after enabling cheats and leave it alive so the wave never ends; then you can experiment safely. Log in as admin from the in-game console with AdminLogin password.

CommandEffect
EnableCheatsRequired for the commands below
ImRich, DoshMe #Money
OpenTrader, OpenTraderMenuUse the trader pod and open its menu
SpawnZEDLods ClotSpawns a handful of ZEDs
SpawnZED ClotSpawns one dazed, harmless ZED
SpawnAI ClotSpawns a normal ZED with AI
SpawnZedGroup x y zZED type x, y waves, z ZEDs per wave
HealMe [#], ArmorMe [#]Health and armor
SpawnHumanPawn 0 1Adds a dazed player
KillBots, KillZedsRemove spawned players or all ZEDs
Ghost, WalkNoclip on and off
God, DemigodGod mode, or damage with 1 HP survival
FlyFlying
AllAmmoFull ammo
ResetDoorsResets all doors
PlayersOnlyFreezes everything except players
ToggleZedsIgnoreMeZEDs with AI ignore you
ToggleHUD, ShowHUDShow or hide the HUD

Replace Clot with Crawler, Gorefast, Stalker, Bloat, Siren, Husk, Scrake, Fleshpound, Clota (Clot), Clotu (Cyst) or Clots (Slasher).

Updating the server

After every game patch repeat Step 2 and add validate to the last command: app_update 232130 validate. SteamCMD checks the files and downloads the update.

Opening ports

If nobody can connect, first update the server, then make sure antivirus and firewall do not block these ports (UDP and TCP):

  • Game port 7777
  • Query port 27015
  • Web admin 8080
  • Steam port 20560

Often the internet provider blocks them. The guide suggests asking the provider to enable DMZ for the IPv4 you noted, which opens all ports for that address. A dynamic IP can change after a modem restart, so the request may need repeating.

See also KF2 dedicated server with SteamCMD and Ports and NAT.

FAQ

Which ports does a KF2 dedicated server need?
The guide lists game port 7777, query port 27015, web admin 8080 and Steam port 20560.
How do I update the KF2 server after a patch?
Run steamcmd, log in anonymously, set the install directory if you use a separate folder and run app_update 232130 validate.
What do the GameLength values mean?
0 is the short game (4 waves plus boss), 1 is medium (7 plus boss) and 2 is long (10 plus boss), shown in the guide as 5/4, 8/7 and 11/10 waves.