Providing that you own the game on Steam, you should have the Mordhau Dedicated Server tool available to you to install in your Steam Library.
The steps required to set it up are as follows:
1. With Steam open, navigate to your Library, and from the "Games" dropdown make sure that "Tools" is also selected.
2. Search for "MORDHAU Dedicated Server" and click install
3. Once the tool has installed, right click on it's entry within Steam and go to "Properties"
4. Under the General tab you should find an option for "Launch options". In there put the following
FFA_Contraband -log -Port=7779 -RconPort=7780 -QueryPort=27018 -Beaconport=15002
Note: the map name and the ports here can be changed, but must remain different from the defaults as the Mordhau game client uses the same ports.
The map will be the default starting map for the server.
5. Launch the game so that it generates all the necessary config files for the server.
6. Once it has fully loaded, shut down the server.<
7. Right click on the "MORDHAU Dedicated Server" entry within Steam, and go to "Manage" and then "Browse local files". You should be able to locate the Game.ini file within the Mordhau\Saved\Config\WindowsServer\
subfolder.
8. You'll need to change details such as the Server name within the Game.ini. You can check the Server Configuration guide for more details and examples.
9. If you're hosting this on your home network, you will also need to open the above ports in your Firewall, and ensure your home Router has all of these ports forwarded to your local machine. You can check https://portforward.com/mordhau-server/ for more details.
10. To connect to a server running on the same machine you are playing on, you will need to open the console with the ` key and type open 127.0.0.1:7779
to connect to your server. If your ports are open and forwarded, other players will be able to join via the server browser as normal. If your server has a password, you can use open 127.0.0.1:7779?ServerPassword=<yourpassword>