Mordhau

Dedicated Server Hosting Guide (Linux)

Knight 122 258
  • 5
  • 13 Sep '17
 Vin¢

If you wish to host a dedicated server but don't want to do everything manually, I would highly recommend renting a SimRai server. However, by renting servers yourself you can achieve arguably better performance for a significantly reduced cost, plus greater flexibility for configuration options as and when they become available in the future. This guide acts as a quick tutorial and reference for anybody trying to manually set up a dedicated server for Mordhau. Specifically, I will be focusing on creating an Ubuntu Linux server, but any other distro should work too, perhaps with minor adjustments to the commands shown here.

If you're intent on using Windows for whatever reason then you can find a step-by-step guide here which explains how to do everything. Credit goes to Atropis Orbis for that.

This guide also assumes a basic understanding of how to use the command line. As a prerequisite you should have a capable server to which you have root access (e.g via SSH). If you're unsure about what hardware to choose I would suggest at least 1GB of RAM and at least 6GB of disk space (though memory usage may vary depending on how you configure your game server).

As a general overview, we need to do three things:

  • Install the game server application from steam using SteamCMD
  • Install any dependencies (i.e libraries) that the server needs
  • Configure and run the server

Installing the Game via SteamCMD

Let's start by installing SteamCMD. First, install the dependencies for SteamCMD:

$ sudo apt-get install lib32gcc1

As the root user, create a separate user as follows under which we will run the server. We do this as a security precaution: you should never run the server as root.

$ useradd -m steam

Now, we'll swap to the newly created account:

$ su - steam
# Or if you aren't currently logged in as root, use:
$ sudo -iu steam

Now, we can install SteamCMD. This installs it in the current directory:

$ curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

SteamCMD allows us to download and install the server and any updates that we may need at a later date. We'll create a simple SteamCMD script that we can run whenever we want to update our server. Create a file in the current directory with the following contents; I named mine update_mordhau.txt:

@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
force_install_dir ./mordhau
app_update 629800 validate
quit

As you can see, the command app_update 629800 is the one that installs the server executable, with 629800 being the Steam app ID we want to install (Mordhau Dedicated Server). We also ask SteamCMD to install Mordhau to the mordhau folder in the current directory.

Running the script for the first time will cause SteamCMD to download the contents of the server application to your computer entirely. Any subsequent runs of this script will simply check for an update and install it if available. We can run it with:

$ ./steamcmd.sh +login <your_username> <your_password> +runscript update_mordhau.txt

Make sure to replace <your_username> and <your_password> with your steam login information (you should omit the angle brackets). Here you may be asked to enter a code from the Steam Mobile Authenticator. Note that if you used a package manager to install SteamCMD, you may need to use simply steamcmd instead of ./steamcmd.sh.

This should initiate a fairly large download, so this may take a few minutes or hours depending on the network bandwidth of the server. Just remember to run the above command when you want to update your server to a new Mordhau patch.

See the SteamCMD documentation for more information on how to use SteamCMD.

Install Game Server Dependencies

At this point you should have all the required files to run the server in the mordhau folder. Unfortunately, we still need to install a few more things before we can start the server. If you try and run the server at this point, you'll get some errors relating to libraries not being found. We need to install these dependencies manually, so let's go ahead and do that. Note that the following is very distro-specific: you'll have to use your own intuition for which package is correct if you aren't using a distro that uses apt (or maybe search the comments for a list of library names for your specific package manager).

Using apt, you can run the following (you'll need root access for this, temporarily):

$ sudo apt-get install -y libfontconfig1 libpangocairo-1.0-0 libnss3 libgconf2-4 libxi6 libxcursor1 libxss1 libxcomposite1 libasound2 libxdamage1 libxtst6 libatk1.0-0 libxrandr2

Configuring and Running the Server

Finally, we can now start thinking about how we want to configure the server. First, navigate to the folder where Mordhau is installed. If you've been following along, this will mean simply running cd mordhau.

If you type ls, you will see a few folders. The server configuration files are stored in Mordhau/Config. If you navigate there and see what files are there (cd Mordhau/Config && ls) you will see a few Default*.ini files. The one we will want to edit the most is DefaultGame.ini. So let's open up that file in your favourite command line text editor (you could also download the file, edit it on your host machine and upload it back - but editing it in place is much simpler). nano is one such simple text editor, so simply run: nano DefaultGame.ini.

If you scroll down about 20 lines or you should see something like this:

[/Script/Mordhau.MordhauGameSession]
bIsLANServer=False
MaxSlots=16
ServerName=
ServerPassword=
AdminPassword=
Admins=
BannedPlayers=

[/Script/Mordhau.MordhauGameMode]
MapRotation=SKM_Contraband
...
MapRotation=FFA_ThePit

Most fields here are self explanatory, but I'll explain them anyway. MaxSlots is the maximum number of players the server can facilitate. ServerName is the name of the server as it appears to players in the server browser. ServerPassword is the password you need to enter to join the server - if left blank then no password restrictions are imposed. AdminPassword is a password that can be used by players to log in as admin and do certain things such as change the map. Although it is currently left blank I would highly suggest adding one (even if you don't use it) since if somebody wants to use your server temporarily you can just give them the admin password and not have to do everything yourself. Admins is a list of SteamIDs of players that are to be permanent administrators. You can find a user's SteamID using a website such as steamid.io - you're looking for the 'steamID64' field. For example, to add me and GIRU as admins on your server, just write:

Admins=76561198120639625
Admins=76561198005392690

And no, that's not a mistake: you need to repeat the line if you want multiple users as permanent admininstrators. Using this, the players don't have to login with the admin password, as they are logged in automatically upon joining the server.

BannedPlayers is a list of blacklisted players that cannot join your server. You can add entries manually (with a similar syntax to the way you add admins).

Next, we see the MapRotation fields. When one map ends, the server loads the next entry in the MapRotation field. For example, if I just wanted Contraband Skirmish and Camp FFA (in that order), I'd write:

MapRotation=SKM_ContraBand
MapRotation=FFA_Camp

The map prefixes should be self-explanatory: SKM is Skirmish, FFA is FFA/Deathmatch, TDM is Team Deathmatch, etc.

Note that some people have reported issues with the Admins and MapRotation fields on the Windows dedicated server, saying that they simply don't work. If this is the case for you, try putting a '+' before each line that starts with Admins= or MapRotation= - this has fixed the issue for many. If you have any more information regarding this bug and how to fix it, please contact me so I can update the information here.

If you want to change the tickrate of your server (default is 30, 60 or 120 may improve gameplay), you need to edit the DefaultEngine.ini file in the same folder. Find and update the following line (around line 181 at the time of writing this guide):

NetServerMaxTickRate=30

Having configured everything we want to configure, we can finally run the server. In the root of the mordhau folder, there should be a file called MordhauServer.sh - this is the script that actually runs the server. We can execute it with:

./MordhauServer.sh

After 15s or so, your server should be up and running. The problem with this method is that it's tied to the current command line session - as soon as you close your SSH connection, the server will close too. We need to run it in the background, using this command:

nohup ./MordhauServer.sh &

Instead of displaying the output directly to your screen, this will write the server log to a file in the current directory named nohup.out. Type man nohup for more details on this behaviour. Alternatively you can use systemd to run your server in the background. See this link for more information.

When you want to shut down the server, you'll need to type ps -a (or ps -ax if you don't see it) and look for the process ID of the game server. Then, close it with kill <pid> where you replace <pid> with the process ID you just found.


Thanks for reading this guide. If you have any questions pertaining to information in this guide, you can ask in the comments here.

990 5549
  • 13 Sep '17
 crushed — Art

This topic has been pinned.

106 128
  • 2
  • 13 Sep '17
 Bang

Vincent you're a fucking god.

Edit: Thanks a ton, I'll be trying this out later and seeing how it goes.

Knight 14 6
  • 14 Sep '17
 Grebnedlog

Thanks for the details, waiting (im)patiently for the Windows instructions!

Knight 797 787
  • 3
  • 14 Sep '17
 afiNity

Thanks for the guide, helped me a lot.

Count 671 1117
  • 14 Sep '17
 Zexis

This is a great guide Vinc, thank you very much. +1

Knight 5 2
  • 14 Sep '17
 viktae

Ty! Didn't find the APP ID of the server, how did you do?

Knight 122 258
  • 14 Sep '17
 Vin¢

@viktae said:
Ty! Didn't find the APP ID of the server, how did you do?

Dominator told me it.

Sellsword 24 24
  • 19 Sep '17
 LemonTroutsky

what are the recommended specs for a 16-man server?

Duke 277 693
  • 1
  • 22 Sep '17
 Ruby Rhoderick

If I'd like to use SteamCMD to install the Mordhau server on a Windows server, would I use the same appID supplied above? Or is there one specific to Windows server? Thanks.

-edit
Nevermind. Turns out you can't login anonymously into SteamCMD to download the Mordhau dedicated server.

6 1
  • 1 Oct '17
 RonPaul

Hello,

I've started running into an issue since A6 came out. My server seems to only play FFA_Pit. Here is my current maplist config in the .ini file:

+MapRotation=TDM_Camp
+MapRotation=FFA_Grad
+MapRotation=TDM_ThePit
+MapRotation=SKM_Camp
+MapRotation=TDM_Contraband
+MapRotation=FFA_ThePit
+MapRotation=TDM_Camp
+MapRotation=SKM_Grad
+MapRotation=TDM_Contraband
+apRotation=FFA_Camp
+MapRotation=TDM_ThePit
+MapRotation=SKM_Contraband

Knight 122 258
  • 1 Oct '17
 Vin¢

@RonPaul said:
Hello,

I've started running into an issue since A6 came out. My server seems to only play FFA_Pit. Here is my current maplist config in the .ini file:

+MapRotation=TDM_Camp
+MapRotation=FFA_Grad
+MapRotation=TDM_ThePit
+MapRotation=SKM_Camp
+MapRotation=TDM_Contraband
+MapRotation=FFA_ThePit
+MapRotation=TDM_Camp
+MapRotation=SKM_Grad
+MapRotation=TDM_Contraband
+apRotation=FFA_Camp
+MapRotation=TDM_ThePit
+MapRotation=SKM_Contraband

One of your lines is missing an 'M' in 'MapRotation'

6 1
  • 1 Oct '17
 RonPaul

Had a long week, missed that. I'll check my server later and see if it is working now. I don't think it will matter based on the fact that none of the other maps would be switched to. Originally I didn't even have the + sign in front of MapRotation and it was working fine prior to A6.

26 13
  • 1 Oct '17
 Gauvin

@RonPaul said:
Had a long week, missed that. I'll check my server later and see if it is working now. I don't think it will matter based on the fact that none of the other maps would be switched to. Originally I didn't even have the + sign in front of MapRotation and it was working fine prior to A6.

So you prepended + to each line in hope of fixing the rotation?

26 13
  • 1 Oct '17
 Gauvin

@Vin¢ said:

I would suggest at least 1GB of RAM and at least 6GB of disk space (though memory usage may vary depending on how you configure your game server).

There is a large cost difference between 1GB and 512MB of ram. 2GB is even twice as much as 1. Do you have some specific info about ram usage of a Linux server for Mordhau? The command htop can help you visualize your processes and the memory they take up. If this takes 100 to 200 MB of ram (under load, meaning when 16 players are playing, or maybe when a new map is loading) it would be nice, as I know that my current server with Linux barely uses 50MB of ram at idle! But I'm probably being too optimistic.
Anyway thanks!

6 1
  • 1 Oct '17
 RonPaul

Gauvin,

I did prepend + in hope of fixing the issue based off of some other threads I have read. Prior to A6 I didn't have the + prepended and the map rotation was working fine.

26 13
  • 2
  • 2 Oct '17
 Gauvin

Server name: Chambering and training damage off - US East
Ram usage using Linux server: ~200MB
CPU usage: 30%cpu on 5 players and a bot so far.

Now trying to find how to input admin commands automatically at every map change without admin being there.

26 13
  • 3 Oct '17
 Gauvin

@RonPaul said:
Gauvin,

I did prepend + in hope of fixing the issue based off of some other threads I have read. Prior to A6 I didn't have the + prepended and the map rotation was working fine.

My map rotation is working. On a linux server and with + in front of every map name.

Mercenary 16 5
  • 20 Oct '17
 Sumerian

Thank you for the guide. I'm trying this on my Amazon Lightsail Server but the OS is Amazon Linux and I'm having trouble with installing dependencies.

$ sudo apt-get install -y libfontconfig1 libpangocairo-1.0-0 libnss3 libgconf2-4 libxi6 libxcursor1 libxss1 libxcomposite1 libasound2 libxdamage1 libxtst6 libatk1.0-0 libxrandr2

Does anyone knows how to install these dependencies on Amazon Linux? (Amazon Linux uses YUM install method)

Knight 122 258
  • 21 Oct '17
 Vin¢

@Sumerian said:
Thank you for the guide. I'm trying this on my Amazon Lightsail Server but the OS is Amazon Linux and I'm having trouble with installing dependencies.

$ sudo apt-get install -y libfontconfig1 libpangocairo-1.0-0 libnss3 libgconf2-4 libxi6 libxcursor1 libxss1 libxcomposite1 libasound2 libxdamage1 libxtst6 libatk1.0-0 libxrandr2

Does anyone knows how to install these dependencies on Amazon Linux? (Amazon Linux uses YUM install method)

I would guess that most of the yum packages have the same name, so you should just be able to do sudo yum install x (where x is the name of the package) for each of those I listed. Some of them might have slightly different names, but you should still be able to hunt them down (you can search for them like this).