Running a Server

KF2 Dedicated Server Setup in 10 Steps (Japanese Guide)

This short Japanese guide walks through a Killing Floor 2 dedicated server on Windows in ten steps: SteamCMD scripting, the launch file, router ports, initial settings, WebAdmin and custom maps. It is compact and practical, so it makes a good checklist next to the longer SteamCMD server guide.

Server startup

Step 1. Download steamcmd.zip from Valve. Create a steamcmd folder directly on drive C and put steamcmd.exe in it.

Step 2. In that folder create a text file named kf2_ds.txt with four lines:

login anonymous
force_install_dir ./kf2server
app_update 232130 validate
exit

Step 3. Create a batch file such as download.bat containing SteamCmd +runscript kf2_ds.txt. Running it creates the kf2server folder and downloads the server files. Run it again whenever the game updates (the author heard of an auto update but did not confirm it).

Step 4. Edit C:\steamcmd\kf2server\KF2Server.bat and set the launch line, for example start .\Binaries\win64\kfserver kf-bioticslab?adminpassword=123. The 123 is the default admin password, so change it for security. From then on run KF2Server.bat to start the server. To stop, close the window.

Opening ports

Step 5. In your router or modem settings, forward these ports to your PC (static IP masquerade or port mapping):

  • UDP 7777
  • UDP 20560
  • UDP 27015
  • TCP 8080, only if you want to administer from outside

Initial configuration

Step 6. Edit C:\steamcmd\kf2server\KFGame\Config\PCServer-KFGame.ini:

  • MaxPlayers: maximum players; more than 6 needs a mutator.
  • MaxSpectators: spectators count toward the 6 participants.
  • GameDifficulty: 0 Normal, 1 Hard, 2 Suicidal, 3 Hell on Earth.
  • AdminPassword: needed for WebAdmin.
  • GamePassword: optional join password.
  • ServerName: the server name.
  • bPartitionSpectators: allow spectating (True or False).

WebAdmin

Step 7. In DefaultWeb.ini and KFWeb.ini set bEnabled=True, then open http://localhost:8080. The login is administrator and the password is the one set in the launch line in Step 4. WebAdmin can show server status, chat with players in game, force map changes, edit the map list, ban by IP or Steam ID, and run map and kick votes.

Custom maps

Step 8. Put the downloaded KF-xxxxxx.kfm into C:\SteamCmd\kf2server\KFGame\BrewedPC\Maps\ (subfolders are fine). Then in PCServer-KFGame.ini, next to the entry

[KF-BioticsLab KFMapSummary]
MapName=KF-BioticsLab
ScreenshotPathName=UI_MapPreview_TEX.UI_MapPreview_BioticsLab

add a new section [KF-xxxxxx KFMapSummary] with MapName=KF-xxxxxx and save.

Step 9. Open WebAdmin, go to Settings, then Map Cycles. Your custom map appears in the Available Maps table on the left. Drag it to Map Cycles on the right and press Save Map Cycle. You can also edit the ini directly, but the web page is easier.

Step 10. Let clients download maps automatically. The default KF2 web server is very slow, so redirect to a separate web server. In PCServer-KFEngine.ini set, under [IpDrv.HTTPDownload], RedirectToURL=http://yourhost.example/. If your map is not hosted there, set up your own web server or use a rental web space and place the files in it.

References

The original lists the official Tripwire wiki page for the KF2 dedicated server and the official forum for server setup. See also KF2 custom maps nginx redirect.

FAQ

Which ports must be forwarded for a KF2 server?
UDP 7777, UDP 20560 and UDP 27015. TCP 8080 is needed only if you want to use WebAdmin from outside your network.
How can I make custom map downloads faster?
Set RedirectToURL under [IpDrv.HTTPDownload] in PCServer-KFEngine.ini to an external web server that hosts the map files, because the built-in web server transfers slowly.
How many players can the server hold?
MaxPlayers in PCServer-KFGame.ini sets the limit. Going above 6 requires a mutator, and spectators count against the 6 participants.