Running a Server

KF2 Linux VPS Dedicated Server Guide (Japanese Community)

This Japanese guide explains how to run a Killing Floor 2 dedicated server on a rented Linux VPS, using the author's own server as the example. If you do not need an always-on server and your home line is fine, a Windows PC is enough and the author points to two other Japanese guides for that, including the 10-step Windows setup.

1. Prepare Linux

The author's environment:

  • Kagoya VPS, about 3,850 yen per month
  • Ubuntu 20.04
  • 4 CPU cores, 4 GB RAM
  • 100 GB storage (KF2 is large, so choose a plan with 100 GB)

VPS instance creation screen The instance creation screen of the rented server.

After logging in, choose Create Instance and pick the specs. Click to add a login key, register it under any name, enter an instance name and press create at the bottom of the page. From the instance list select the new one and click Start. To manage it, open the Console tab (allow pop-ups in your browser if they are blocked).

2. Build steps

At login: type root and enter the password you set when creating the instance.

Swap. The contract is 4 GB, but the author wants about 16 GB, so the missing 12 GB is created on the SSD:

# fallocate -l 12G /swapfile
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile
# sed -i '$ a /swapfile swap swap defaults 0 0' /etc/fstab

The name /swapfile is arbitrary; if it is busy, use another such as /swapfile2. Check with free -m -h.

Firewall. Open these ports:

  • 27015 (Steam)
  • 20560 (Steam)
  • 123 (Weekly)
  • 7777 (Server, any number; open several if you plan multiple servers, the author opens 7777 to 7781)
# apt install firewalld
# firewall-cmd --permanent --add-port=27015/udp
# firewall-cmd --permanent --add-port=20560/udp
# firewall-cmd --permanent --add-port=123/udp
# firewall-cmd --permanent --add-port=7777/udp
# firewall-cmd --reload

Then create a security group in the VPS management site and open the same ports.

SteamCMD and user.

# apt update
# apt upgrade
# apt install lib32gcc1
# apt install curl
# useradd -m [username]
# su - [username]
$ mkdir ~/Steam
$ cd ~/Steam
$ curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
$ ./steamcmd.sh
Steam> force_install_dir kf2server
Steam> login anonymous
Steam> app_update 232130 validate
Steam> exit

3. Common commands

  • cd [dir] change directory
  • ls [dir] list contents
  • vim [file] edit a file
  • cp [file1] [file2] copy
  • rm [file] delete
  • cat read a file
  • df -h storage usage
  • ps -a running processes
  • kill [ID] stop a process

4. Server configuration

The Linux start command is ./Binaries/Win64/KFGameSteamServer.bin.x86_64 kf-bioticslab. To avoid typing it every time, make a shell script (like a bat file):

  1. vim 01.sh to create and edit the file.
  2. Press i to insert, type the command above, press Esc, then :wq to save and quit.
  3. Make it executable with chmod +x 01.sh.
  4. Start the server once with ./01.sh to generate the main files.

Then edit under KFGame/Config:

  • KFWeb.ini: bEnabled=True
  • LinuxServer-KFGame.ini: MaxSpectators=6, AdminPassword=..., bPartitionSpectators=True

Most other settings can be changed in WebAdmin. Use LinuxServer-KFEngine.ini for Workshop integration and LinuxServer-KFGame.ini for map management; these steps match Windows. For several servers, install tmux and run several shell scripts at once in split panes. Stop a server with Ctrl+C, or find it with ps -a and use kill [process ID].

See also KF2 cheap VPS with LinuxGSM.

FAQ

Which ports does the Linux KF2 server need?
UDP 27015 and 20560 for Steam, UDP 123 for the weekly outbreak time sync, and the game port 7777 (open a range such as 7777-7781 if you plan several servers).
What is the Linux server start command?
./Binaries/Win64/KFGameSteamServer.bin.x86_64 followed by the map name, for example kf-bioticslab.
Why add swap on the VPS?
The author runs a 4 GB VPS but wants about 16 GB total, so 12 GB of SSD swap is created with fallocate, mkswap and swapon.