KF2 Dedicated Server with Workshop: SteamCMD, BAT, WebAdmin
This 2016 guide sets up a Killing Floor 2 dedicated server on Windows from nothing, then adds Steam Workshop content. Paths are examples; the author recommends folder names without spaces and warns to link everything correctly if you choose different ones. For more recent walkthroughs see Dedicated server with SteamCMD and the home server walkthrough.
1. SteamCMD
Create C:\Servers\SteamCMD, download SteamCMD for Windows from Valve and extract steamcmd.exe there. It is a command-line app, so small scripts make it easier. Valve's SteamCMD documentation describes the commands.
2. Install and update the game
Create _kf2_update.txt in the SteamCMD folder:
// KF2 UPDATE & QUIT
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir ../SteamServers/kf2/
app_update 232130 validate
quit
Create a shortcut with target C:\Servers\SteamCMD\steamcmd.exe +runscript _kf2_update.txt and start-in C:\Servers\SteamCMD. Run it whenever you want to update. The resulting layout is C:\Servers\SteamCMD for the tool and C:\Servers\SteamServers\kf2 for the server files.
3. Configure the server
Create a .bat file in C:\Servers\SteamServers\kf2\ (the author calls it KF2Server.bat) with:
start .\Binaries\win64\kfserver kf-bioticslab?adminpassword=123
Run it once so the server writes the ini files. Stop it with Ctrl+C in its window.
Open KFGame\Config\KFWeb.ini and enable the WebAdmin:
ListenPort=20111
bEnabled=true
After the next start, open the WebAdmin at the machine's local IP and port (for example http://192.168.0.3:20111). The username is admin and the password is the one from the .bat file. Change the default password; if you change it in the UI, remove the password from the .bat. If the port is not forwarded to the internet, the risk is small.
Warnings from the author:
- Updating KF2 may overwrite the .bat file, so keep your own copy.
- Map names in the .bat file are lowercase (
kf-shoppingspree). An invalid map name leaves the server in an endless boot loop.
Ports and firewall
Forward these ports: 7777 UDP, 20560 UDP, 27015 UDP (Steam game servers) and 20111 TCP (WebAdmin, only if you want to expose it). Give the server PC a static IP, for example by reserving it in your router's DHCP. If the server works on LAN but not from outside, something is blocking traffic: the router, the operating system or even the ISP modem. Windows Firewall should allow both TCP and UDP inbound for Binaries\win64\kfserver.exe; it normally prompts on first launch.
4. Workshop integration
Edit KFGame\Config\PCServer-KFEngine.ini and add (outside another section, or add the line to the section if it already exists):
[OnlineSubsystemSteamworks.KFWorkshopSteamworks]
ServerSubscribedWorkshopItems=644068210
The number is the Workshop item ID from the item's URL; 644068210 is the map KF-ShoppingSpree. You can add as many items as you like. On a client, downloaded items with IDs and file names are in %USERPROFILE%\Documents\My Games\KillingFloor2\KFGame\Cache.
Under [IpDrv.TcpNetDriver] add:
DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload
At start the server checks Workshop items and downloads missing ones, which can take a few minutes while it keeps running other content. It should also pick up creator updates while running.
Important (as of April 2016): Workshop maps are not automatically added to the WebAdmin map rotation. Add them by hand using the literal map name without extension, for example KF-ShoppingSpree.
FAQ
- Which Steam app ID installs the KF2 server?
- 232130, installed anonymously through SteamCMD.
- Which ports must be forwarded?
- 7777 UDP, 20560 UDP and 27015 UDP, plus 20111 TCP if you want the WebAdmin reachable from the internet.
- Why does my server loop on boot?
- A wrong map name in the .bat file. Use the lowercase map name, for example kf-shoppingspree.