Mordhau

Dedicated Server Hosting Guide (Linux)

21 10
 Kaervan

@Destroptor

To get to the point where I ran into the Saved directory missing, I followed the original post to that point. My directories looked like this:

[email protected]:~$ tree -L 1

├── linux32
├── linux64
├── mordhau
├── package
├── public
├── siteserverui
├── Steam
├── steamcmd.sh
├── update_mordhau.txt
└── update.sh (my script for updating the server with steamcmd)
7 directories, 3 files

[email protected]:~$ cd mordhau/
[email protected]:~/mordhau$ tree -L 1

├── Engine
├── Manifest_DebugFiles_Linux.txt
├── Manifest_NonUFSFiles_Linux.txt
├── Manifest_UFSFiles_Linux.txt
├── Mordhau
├── MordhauServer.sh
└── steamapps

3 directories, 4 files

[email protected]:~/mordhau$ cd Mordhau/
[email protected]:~/mordhau/Mordhau$ tree -L 1

├── AssetRegistry.bin
├── Binaries
├── Config
├── Content
├── Intermediate
├── Mordhau.uproject
├── Plugins

6 directories, 2 files

The OP says I should be expecting the directory named Saved in that last command output, but it wasn't there. After some digging around, I ran the MardhauServer.sh script in the second directory listing above with just sh MordhauServer.sh. It did a bunch of stuff on startup and ran in the forground. After waiting a bit, I hit CTRL+C and looked in /home/steam/mordhau/Mordhau and the Saved directory was there with Game.ini and others inside of it.

If this doesn't help, I'll be home around 6:30PM PDT and can jump on discord to give you a hand.

2 0
  • 1 May
 Destroptor

@Kaervan

Thank you so much for the detailed explanation. I found the problem elsewhere though. I might have derped and installed in a directory where root access was necessary. After moving the steam folder to my home folder, and a chown command it would then create the folders and files needed

5 4
  • 1 May
 Zenchess

@Destroptor said:
@Kaervan Can you elaborate? I tried to run the server - I had it full of players but still no "Saved" folder. Is it a problem with folder ownership or something?

Run the server briefly, then quit it . The Saved folder will be placed there.

21 10
  • 2 May
 Kaervan

@Destroptor said:
@Kaervan

Thank you so much for the detailed explanation. I found the problem elsewhere though. I might have derped and installed in a directory where root access was necessary. After moving the steam folder to my home folder, and a chown command it would then create the folders and files needed

Good to hear you got it worked out!

1 0

Server is running rly fine. Thanks for the Guide, but i have a question:
Is there a way to running more instances by changing the port and change the config folderlocation?
The Server doesnt rly need much ressources, also with 64 players, so i thought about it and somtimes its necessary to change the port.

Another Question was about the startmap on the server, but the windows thread had the answer.
https://mordhau.com/forum/topic/10250/how-i-got-my-dedicated-server-ot-run-and-appear-on/?page=4#c66

Thanks for the answer.

Knight 18 24
  • 2 May
 Gluten

Thanks for the great guide Vinc.
Wanted just to say that "+login anonymous" works now after release!

13 1
  • 2 May
 TRRBen

@Khalimerot said:
Hi,

doest anybody know how i can change the port mordhau is listening?

I already have multiple unreal engine games server running, and default port seems to use the sames one.

Thank you.

Did you figure this out?

5 0
 Fassan

@TRRBen said:

@Khalimerot said:
Hi,

doest anybody know how i can change the port mordhau is listening?

I already have multiple unreal engine games server running, and default port seems to use the sames one.

Thank you.

Did you figure this out?

+1
I have several servers and gigabit internet but only 1 IP so very interested in this.

Also if there are any best practices or recomendations in tickrate + number of player slots / cpu core + ram ?

2 1

@Khalimerot in the MordhauServer.sh , edit the last line to include the alternate ports:

"$UE4_PROJECT_ROOT/Mordhau/Binaries/Linux/MordhauServer-Linux-Shipping" Mordhau -ConnectionPort=7780 -QueryPort=27016 [email protected]

For Windows I had to also put the connection port in engine.ini, so I did the same for Linux, add the connection port to engine.ini like this:

[url]
Port=7780

4 1
  • 3 May
 ExCTyrdlu

I created start script for systemd with on failure restart and update validate

Systemd unit

sudo cat > /etc/systemd/system/mordhau.service <<EOL
[Unit]
Description=Mordhau Server
Requires=network.target local-fs.target
After=network.target local-fs.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
User=steam
Group=steam
ExecStartPre=/home/steam/Steam/steamcmd.sh +login anonymous +runscript /home/steam/Steam/update_mordhau.txt
ExecStart=/home/steam/Steam/mordhau/Mordhau/Binaries/Linux/MordhauServer-Linux-Shipping Mordhau
ExecStop=/bin/kill -SIGINT $MAINPID

[Install]
WantedBy=multi-user.target
EOL

Installation

sudo systemctl enable mordhau.service

sudo systemctl start mordhau.service

it replaces the original startup script you can only use this one.

5 0
  • 3 May
 Fassan

@ExCTyrdlu said:
I created start script for systemd with on failure restart and update validate

Systemd unit

sudo cat > /etc/systemd/system/mordhau.service <<EOL
[Unit]
Description=Mordhau Server
Requires=network.target local-fs.target
After=network.target local-fs.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
User=steam
Group=steam
ExecStartPre=/home/steam/Steam/steamcmd.sh +login anonymous +runscript /home/steam/Steam/update_mordhau.txt
ExecStart=/home/steam/Steam/mordhau/Mordhau/Binaries/Linux/MordhauServer-Linux-Shipping Mordhau
ExecStop=/bin/kill -SIGINT $MAINPID

[Install]
WantedBy=multi-user.target
EOL

Installation

sudo systemctl enable mordhau.service

sudo systemctl start mordhau.service

it replaces the original startup script you can only use this one.

Thnx it works great!
Can you share how you specced your server and tickrate bandwidth usage etc?

4 1
  • 3 May
 ExCTyrdlu

@Fassan
My 22 player server running on 1x 2.095GHz, 2GB RAM, 20GB SSD 100/100 Mbps, tickrate is 60. I haven't problem with overload/lags on full server.

bandwidth.PNG

21 10
  • 3 May
 Kaervan

oooh, datadog. well aren't you fancy. I was going to post my grafana snapshots for full 32 player server, but it looks pretty much identical to your graphs. It looks like you could easily go to 28-32 players based on your image if you wanted.

Knight 18 24
  • 3 May
 Gluten

@ExCTyrdlu said:
I created start script for systemd with on failure restart and update validate

Systemd unit

sudo cat > /etc/systemd/system/mordhau.service <<EOL
[Unit]
Description=Mordhau Server
Requires=network.target local-fs.target
After=network.target local-fs.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
User=steam
Group=steam
ExecStartPre=/home/steam/Steam/steamcmd.sh +login anonymous +runscript /home/steam/Steam/update_mordhau.txt
ExecStart=/home/steam/Steam/mordhau/Mordhau/Binaries/Linux/MordhauServer-Linux-Shipping Mordhau
ExecStop=/bin/kill -SIGINT $MAINPID

[Install]
WantedBy=multi-user.target
EOL

Installation

sudo systemctl enable mordhau.service

sudo systemctl start mordhau.service

it replaces the original startup script you can only use this one.

Thanks for the script! When I run the server it just loops (successfully, every time) the update script without ever running the server itself (according to "systemctl status mordhau.service"), any idea why is it stuck there?

4 1
  • 3 May
 ExCTyrdlu

Have you tried to start the server first manually?

for more logs
journalctl -r -u mordhau.service

5 0
  • 3 May
 Fassan

@ExCTyrdlu said:
@Fassan
My 22 player server running on 1x 2.095GHz, 2GB RAM, 20GB SSD 100/100 Mbps, tickrate is 60. I haven't problem with overload/lags on full server.

bandwidth.PNG

This is my cpu load on 16 player:

mordhau2.PNG

But I am running at 120 tickrate, is that overkill?
When I was running 32 players sometimes I got small lags and the cpu then spiked for like a minute.

4 0

@AussieTerror said:
@Khalimerot in the MordhauServer.sh , edit the last line to include the alternate ports:

"$UE4_PROJECT_ROOT/Mordhau/Binaries/Linux/MordhauServer-Linux-Shipping" Mordhau -ConnectionPort=7780 -QueryPort=27016 [email protected]

For Windows I had to also put the connection port in engine.ini, so I did the same for Linux, add the connection port to engine.ini like this:

[url]
Port=7780

A little late reply sorry @Fassan & @TRRBen

Thanks for the help @AussieTerror

I use the following startup line : "nohup ./MordhauServer.sh -Port=xxxx -QueryPort=xxxxx &"

and it works.

Edit:
And does anyone know why my Game.ini is like that after running the server :

RfTLijd

It's difficult to edit afterward...each time I have to stop the server, redo the Game.ini completly and rerun

9 2

@Khalimerot

I had exactly the same problem with the Game.ini.
Could someone post his Game.ini so i have a working one?

4 0

@SirBorryvonHinten said:
@Khalimerot

I had exactly the same problem with the Game.ini.
Could someone post his Game.ini so i have a working one?

There is a basic Game.ini one the Windows dedicated server turorial :

https://mordhau.com/forum/topic/10250/how-i-got-my-dedicated-server-ot-run-and-appear-on/

[/Script/Mordhau.MordhauGameMode]
PlayerRespawnTime=5.000000
BallistaRespawnTime=30.000000
CatapultRespawnTime=30.000000
HorseRespawnTime=30.000000
DamageFactor=1.000000
TeamDamageFactor=0.500000
MapRotation=FFA_ThePit
MapRotation=TDM_Camp
MapRotation=SKM_Grad
MapRotation=FFA_Contraband
MapRotation=TDM_Tourney
MapRotation=SKM_MountainPeak
MapRotation=FFA_Taiga
MapRotation=TDM_ThePit
MapRotation=SKM_Camp
MapRotation=FFA_Grad
MapRotation=TDM_Contraband
MapRotation=SKM_Tourney
MapRotation=FFA_MountainPeak
MapRotation=TDM_Taiga
MapRotation=SKM_ThePit
MapRotation=FFA_Camp
MapRotation=TDM_Grad
MapRotation=SKM_Contraband
MapRotation=FFA_Tourney
MapRotation=TDM_MountainPeak
MapRotation=SKM_Taiga

[/Script/Mordhau.MordhauGameSession]
MaxSlots=<number of slots. Default: 16>
ServerName=<Your server name>
ServerPassword=<OPTIONAL. Only players with this password may join your server.>
AdminPassword=<Password required to log-in as admin.>
BannedPlayers=()**Not sure how this works, but it may be a list of banned users, set up by listing their STEAMID64s.

21 10
 Kaervan

@Fassan said:

@ExCTyrdlu said:
@Fassan
My 22 player server running on 1x 2.095GHz, 2GB RAM, 20GB SSD 100/100 Mbps, tickrate is 60. I haven't problem with overload/lags on full server.

bandwidth.PNG

This is my cpu load on 16 player:

mordhau2.PNG

But I am running at 120 tickrate, is that overkill?
When I was running 32 players sometimes I got small lags and the cpu then spiked for like a minute.

A dev confirmed in another thread that the server only requires one core. The official servers are quad core ~4ghz systems running one server per core. The deciding factors for a good experience are

CPU speed - player count dependent on core speed
Bandwidth - need sufficient throughput for player count

Your tickrate will have a direct impact on both of these. Your server is receiving data from all the clients for what they are doing, and sending the data for what everyone is doing to everyone. The tickrate is the rate that the client updates are received and sent. A higher tickrate means that the client will send that many updates to the server per second, and your server will send those updates to clients. This will drive more cpu load for processing and more bandwidth usage (PPS, BPS).

To compare, I'm running a 32 player server on a 2.1ghz CPU at a tickrate of 60, and haven't heard any complaints. Here's a clip of my server load while it was full yesterday:
mordhau.png