Killing Floor 2

Killing Floor 2

Ocen: 143
Quick guide for creating a private dedicated server
Autorstwa: Twistor
A quick & dirty guide on how to set up a private dedicated server.
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
The official instructions
Let me start by saying that I'm no expert in this. However, it took me about one hour to get the server running. It isn't perfect and this one will probably leave some holes, but if you simply want to get a private server running, this is your guide.

Here are the official instructions:

http://wiki.tripwireinteractive.com/index.php?title=Dedicated_Server_%28Killing_Floor_2%29

This guide is entirely based on that.
Quick launch guide for Windows
SteamCMD

This will follow the previous wiki almost precisely.

1) First install SteamCMD. Download this zip file:

http://media.steampowered.com/installer/steamcmd.zip

Extract it to C:\SteamCMD\
(or wherever you want, I assume that location)

2) Launch SteamCMD.
First launch command prompt, i.e. click Start Menu and type cmd. Then type:

C:\SteamCMD\SteamCMD.exe
This will launch the program.

Alternatively, you can just navigate to C:\SteamCMD\ in Windows and click "SteamCMD.exe" to launch it.

3) Login to SteamCMD. At the moment, anonymous login seems to work better for most people. Therefore, while in SteamCMD prompt, type:

login anonymous

A couple of lines will appear. If it worked, they say the logging in worked OK.

Do not quit the SteamCMD yet. You need it in the following step 4.

Proceed to step 4.
Note: If you run into problems in step 4, try a profile login in SteamCMD instead:

login username password

e.g. this is what it will look like in the prompt:
Steam>login twistor mypassword

In this case you will most likely get Steam Guard message, so get it from your e-mail and type it in when asked.

Again, do not quit the SteamCMD yet. You need it in the following step 4.

Installing and starting up the server

Now, you should be logged in in SteamCMD.

4) Installing the server. Be sure you are logged in SteamCMD in the command prompt. It should look like this:

Steam>

To install the server, paste following lines into SteamCMD:

force_install_dir c:\KF2Server\
app_update 232130 validate

It should download a couple of gigs of some stuff into the forementioned folder KF2Server.

After the download is complete, you may quit SteamCMD by typing: quit
It's no longer needed.

5) Start another command prompt like before.
Then start the server once using the following command:

start c:\KF2Server\Binaries\win64\kfserver kf-bioticslab

A server window will open.
Note: If you get an error message "command not found: start", you are still logged in in SteamCMD. Type "quit" to close that and try the previous start command again.

You need to do this start-up once first so you'll get it to put out some config files. Let it run for a while (like 10-20 seconds). Then:

6) Navigate to c:\kf2server\KFGame\Config\ and open "PCServer-KFGame.ini" in notepad. If you can find the file, close the server window (the required 10-20 seconds have passed).

Find the line that starts
ServerName=Killing Floor 2 Server
Replace Killing Floor 2 Server with whatever you want the server to be called. Do the same to ShortName just below it.

7) If you want a private server, you need to put in a password. Find the line that says:
GamePassword=
and type in your desired password. E.g.

GamePassword=secretword

Now start the server again using:
start c:\KF2Server\Binaries\win64\kfserver kf-bioticslab

It should now be listed in the in-game server browser. However, if not, see Port Forwarding below.
Port forwarding
You probably need to open some ports if you haven't done it yet.

Open the following ports in your firewall:

7777/UDP - MainServer port
20560/UDP
27015/UDP
8080/TCP - WebAdmin

If you don't know how to do port-forwarding, google up your firewall software (e.g. Avira, F-Secure etc.) and port-forwarding. E.g. use a query like "Avira port-forwarding" and you will likely get some instructions.

Note: You have to be careful with this because if you accidentally open a wrong port, you could be making your computer vulnerable to cyber attacks. It's probably not as cool as it sounds.

Once you have done this, you might need to restart your computer to make it work.
Changing settings: WebAdmin
Alright, Normal difficulty with Normal waves might become dull after a while. Also, especially if you have a public server (i.e. no password), you might want to kick and ban annoying people. To do this you can either learn Admin commands (not covered here) or use the browser-based WebAdmin.

Enabling WebAdmin

You can't use the WebAdmin unless you have it enabled. To do this you have to do two things:

1) You need to enable the WebAdmin to use it.
Locate KFWeb.ini in C:\KF2Server\KFGame\Config\ and open it in notepad.
Find the following line:
bEnabled=false

Change it to:
bEnabled=true

2) To be able to connect to WebAdmin you need to open the port for it.
Default port is 8080. You should not change it if you don't know, which ports are available (remember my warning about those unpleasant cyber monster thingies that lurk on weak security).
Consult the Port-forwarding section of this guide to open that port.
Otherwise you might not be able to contact it. However, I think (I've not verified this yet) you can use WebAdmin without port-forwarding on that computer you have installed the server.

Setting up a password

You don't want just anyone connecting to your WebAdmin, so put some password. If your server is a minor one, it can probably be something simple and stupid like '1337' or 'fhtagn'. However, as a responsible citizen of the information age I am obliged to tell you that you should always use a strong password.

Open PCServer-KFGame.ini in notepad again.
Find line that starts
AdminPassword=

Then just put whatever you want there. E.g.
AdminPassword=secreterword

Connecting to WebAdmin

You need to know your IP. Simplest way is to go to whatismyip.com. You can also find it using Command Prompt. Open it like before, and type "ipconfig". A bunch of info is displayed. Your IP is the one that says IPv4 address and then has a number like 120.214.101.175 or similar. I'll use that as an example.

Then the address of your WebAdmin is 120.214.101.175:8080.
First set of numbers is the IP and 8080 is the port if you didn't change it.

Now you can connect to WebAdmin.

1) Open a browser (Mozilla Firefox, Google Chrome etc.)

2) Type the WebAdmin address to address bar. E.g.
120.214.101.175:8080
A helpful hint: If you connect through the same computer that has the dedicated server installed, you can also use:
localhost:8080

Thanks to @Hitsuzen for that last tip!

You need to restart the server to make it work.
If you did it correctly, you can now log in. The default username is Admin (note the capital A).

NOTE: If you by chance launched the server using the batch file C:\KF2Server\KF2Server.bat and didn't edit the file before, note that it will override your password and possibly the username as well. Open that file in notepad and remove the part '?adminpassword=123'.

Apparently, if you don't do this, your username and password will be different:

username: administrator
password: 123
These are the "other" defaults. Once you have logged in, you can change the admin password in the WebAdmin.


In WebAdmin you can manage all kinds of server stuff in the browser. Most important ones are probably choosing level, difficulty and game length.
Updating the server
If the server ceases to work, the reason could be that the Killing Floor 2 server software has been updated. Then it usually can't connect or will result into all kinds of weird errors if succeeded. So, you should update the server.

Quick & Dirty: Repeat steps 2 through 4 in the guide with the same commands.

Under construction
Pro way: Put it all in a batch file. If you want to do this, for now see the wiki at the top of the guide.
Acknowledgements
Thanks to whoever has contributed to the wiki:
http://wiki.tripwireinteractive.com/index.php?title=Dedicated_Server_%28Killing_Floor_2%29
Those instructions are more comprehensive than my attempt and actually not that much longer. For any further information you should consult this wiki page.

Thanks also to 'wbakunis' of KF forums for providing more comprehensive information about the port forwarding. By this I mean mainly this thread:
http://forums.tripwireinteractive.com/showthread.php?t=105311
Also thanks to TowelieKills for providing me that link.

Hopefully you'll get your server fired up.
I will continue to update the guide to make it simpler and more efficient.
Komentarzy: 146
Twistor  [autor] 19 maja 2020 o 10:36 
It should still work, yes. I used it to make another server last summer. If something's critically changed, let me know. Unfortunately I don't have access to the router at my current home but I can still do some troubleshooting.
Cyber Ortek 19 maja 2020 o 8:40 
This is guide still working?
Twistor  [autor] 19 czerwca 2017 o 13:04 
I'll add a few screenshots of that soon.
Twistor  [autor] 19 czerwca 2017 o 13:04 
@RainingMetal
I have to update the guide, as recently I found out another thing you might have to do.

Is your computer behind a router? In addition to opening the ports in the firewall (as given by Windows Defender or your Anti-Virus software), you also have to open the ports in the router. In my new house I had to do that to get the server working.
RainingMetal 19 czerwca 2017 o 12:53 
So basically there's no way to host your own server and play on it with your friends?
Twistor  [autor] 19 czerwca 2017 o 12:39 
@Ellipsis
Hmm, that's curious. Do you have any mods enabled? They might disable the official progression.

Also, there's the setting "ranked games" somewhere. Any chance that you might have turned it off? Though now I can't even find that setting anywhere in the config file.

For your other problem, if it only shows under LAN, you might have set the port forwarding incorrectly.

@RainingMetal
Sorry, I must have missed a couple of messages. I've noticed that to get the game showing, you have to first close the game before running the server.
Ellipsis 19 czerwca 2017 o 12:05 
I managed to set it up and play with my friends under 'Lan'. But i have 1 major issue that is no exp. I mean it gain exp and lvl up but when back to main screen it revert back to what it was.
RainingMetal 20 maja 2016 o 11:47 
So I managed to open all the necessary ports. But when I start up my server, I can't find it on the server browser.
Sleepy_Penguin! 7 stycznia 2016 o 14:56 
Btw you have any clue why my server always got default admin pw despite i try edit it?
Twistor  [autor] 11 września 2015 o 3:41 
@Anchomaster
Myself, I use F-Secure, and to my knowledge I haven't used any router software to configure the ports. I also have Windows Firewall disabled, but I guess you could try opening ports there anyway as none of the other measures have worked yet. Here's an external link [www.dummies.com] to instructions on how to do it.