How to Host a Dedicated Killing Floor 2 Server on Google Cloud (Linux/Ubuntu)

With the recent release of Killing Floor 2 on the Epic Games Store, players are having a hard time on setting up their servers especially since one can’t just create a lobby and start a game with their friends. Want to have a personal dedicated server running 24 / 7 without using your personal computer? Then this guide’s for you. Buckle up — this is a long one

Advertisement

Google Cloud Setup

If you already have an existing Google Cloud account directly follow the next step. If you don’t have one, you can create one for free by following this tutorial.

Creating a VM Instance

Once you’re at the home page of Google Cloud click the navigation menu at the upper left portion and click Compute Engine under the Compute section.

This image has an empty alt attribute; its file name is image-78.png

The next step would be clicking create an instance on the upper portion of the web-page.

This image has an empty alt attribute; its file name is image-79-1024x38.png

Advertisement

You’ll be directed to the create an instance page where you will be filling out some forms. Change the name to whatever you want while following it’s requirements. Change the region to that which is closest to yours and pick whatever zone you want (there’s no impact to the latency). Have the machine configuration to follow that of the picture. This is the most optimal and low cost in order to run a Killing Floor server.

This image has an empty alt attribute; its file name is image-81.png

Change the boot disk by clicking on change and change the operating system to Ubuntu, the version to Ubuntu 18.04 LTS the boot disk type to SSD persistent disk and the size to 50.

This image has an empty alt attribute; its file name is image-82.png

This image has an empty alt attribute; its file name is image-83-1024x413.png

With all the other fields set as default you can now create the instance. You’ll be directed back to the VM instances and you’ll now see your created instance.

Firewall Settings

After creating your first instance you would need to port forward the ports udp:7777, udp:27015, udp:20560, and tcp:8080. We can do this by clicking the navigation menu and find vpc network and clicking on firewall.

This image has an empty alt attribute; its file name is image-84.png

Once you’re at the firewall page, create a firewall rule by clicking the Create a Firewall Rule at the top.

This image has an empty alt attribute; its file name is image-85.png

Fill in the name with your desired name. Leave the other fields as default except for targets which should be set to all instances of the network and source IP ranges as 0.0.0.0/0. Under protocol and ports is where we’ll be putting the ports. Check specified protocols and ports and also check udp and put into the field 7777. Click create when finished.

Advertisement

This image has an empty alt attribute; its file name is image-86.png

You would need to repeat this step three times each for ports: 7777, 27015, and 20560 on udp and 8080 on tcp.

Killing Floor 2 Server Setup

Once the steps above are completed we can now start on running our Killing Floor 2 server!

Launching VM Instance

Go back to compute engine and locate your created instance. Click on SSH and a new window would open.

This image has an empty alt attribute; its file name is image-87-1024x31.png

With the window open, type the following text (without the quotation): “sudo -s” and press enter, this would make you a root user in Ubuntu. Then, type the words “useradd -m steam” and press enter.

This image has an empty alt attribute; its file name is image-88-1024x748.png

Installing SteamCMD

The next step is to install steamcmd. Your machine would need to install some stuff first. Do it by copy-pasting these lines of text into the instance: 

sudo add-apt-repository multiverse

sudo dpkg –add-architecture i386

sudo apt update

sudo apt install lib32gcc1 steamcmd

After the process of installing is finished type “sudo apt install steamcmd” and press enter. Type “Y” after and press enter.This image has an empty alt attribute; its file name is image-89-1024x597.png

It would install some more stuff then the package configuration would appear. Just press tab in your keyboard then press enter. On the steam license agreement press the down key on your keyboard then press enter.

This image has an empty alt attribute; its file name is image-90-1024x749.png

Installing KF2 Server Files

Now that steamcmd is installed, we now need to download the Killing Floor Server files. First is to make a folder by typing “mkdir /kf2” and pressing enter. Next would be to give ownership of the directory to the user steam by typing “chown steam:steam /kf2” and pressing enter. 

This image has an empty alt attribute; its file name is image-91-1024x756.png

Next is to be the user steam by typing “su – steam” and pressing enter. Next is to type “mkdir ~/Steam && cd ~/Steam” which is to create a folder named Steam and going to that folder. Once inside the folder type “steamcmd” and press enter.

This image has an empty alt attribute; its file name is image-92-1024x749.png

Next is to type “login anonymous” and press enter. This would connect you anonymously to Steam. Next would be to type “force_install_dir /kf2” and press enter. Next is to type “app_update 232130 validate” and press enter. This would download the Killing Floor 2 servers into the /kf2 directory.

This image has an empty alt attribute; its file name is image-93-1024x748.png

After the installation exit Steam by typing “exit” and press enter. We need to launch the server in order to create the config files. Do this by typing “/cd kf2” and pressing enter. In order to launch the server type “./Binaries/Win64/KFGameSteamServer.bin.x86_64 kf-bioticslab” and pressing enter. This would make the server run and initialize the config files. At this point we already know that the server is running but we still have to do a couple of additional steps.

This image has an empty alt attribute; its file name is image-94-1024x751.png

Changing the Config Files

Terminate the server by pressing ctrl + c on your keyboard. Type “ls” in order to see all the folders inside /kf2. Type “cd KFGame/Config” and press enter to go to the config folder. If you were to type “ls” again you’ll see all the config files for the server. The important ones are KFWeb.ini and LinuxServer-KFGame.ini. I’ll only open KFWeb.ini in this tutorial as the contents of LinuxServer-KFGame.ini can be changed in the web portal.

This image has an empty alt attribute; its file name is image-95-1024x747.png

In order to open KFWeb.ini type “nano KFWeb.ini“. Nano is the built in text editor in Ubuntu and it is very useful. Change the value of bEnabled to true and save by pressing ctrl + x, followed by pressing Y and pressing enter.

This image has an empty alt attribute; its file name is image-96-1024x748.png

Advertisement

To go back to the /kf2 directory just type “cd /kf2“. Then we want to delete the file KF2Server.bat. We can do this by typing “rm -r KF2Server.bat“. Afterwards we would want to create a file in order to run the Killing Floor server easily. We can do this by typing “nano“. This will take you to the text editor.

Type “./Binaries/Win64/KFGameSteamServer.bin.x86_64 kf-bioticslab” and in order to save press ctrl+x then press Y then type the filename “KF2Server.sh” then press enter. You now have a new file to launch the server.

This image has an empty alt attribute; its file name is image-97.png

Launching the Server

Congratulations you now have your very own KF2 Server! In order to launch it type “./KF2Server.sh“. The server will now launch and you can connect to it in the game in two ways:

  • Going to the server browser
  • Press “~” on your keyboard and type “open youripaddress

Now you might ask where do I find my ip address? You can find it at compute engine on your google cloud.

This image has an empty alt attribute; its file name is image-98-1024x36.png

Configuring the Server

Now that you have your server open you can now edit the settings using the web portal. In your browser type “youripaddress:8080/ServerAdmin/“. This will lead you to the Killing Floor 2 web portal. The default username would be “admin” and the default password would be “123“. You can change all the settings of the game here.

This image has an empty alt attribute; its file name is image-99-1024x507.png

Make your Server Run 24/7

Now that the server has launched you may think, how can I run this 24/7 and without having to open the console? Well the answer is to use the screen feature of Ubuntu. First if your server is running stop it by pressing ctrl + c. Then exit being the steam user, by typing “exit“. Once you’re at the root user, type “screen“. Now, you’re running a seperate instance. Then type the following (which is just the summary of the steps above):

  • su – steam
  • cd /kf2
  • ./KF2Server.sh

Now that the server is running you can exit the screen by pressing ctrl + a + d. You can now close the console and the server will still be up and running.

Advertisement

Leave a Comment