Hosting Your Own Server

From MWO Wiki
Revision as of 10:49, 23 January 2022 by Osdever (talk | contribs)
Jump to navigation Jump to search

If you're tired of our official servers, you're always free to host your own server and add any content you desire (as long as our server supports it, of course). This article will guide you through the steps you need to take in order to create and host your own MWO server for you and your friends to play on.

Prerequisites

  • A PC running Windows or Linux
  • A router capable of port forwarding to make sure other people can access your server
  • A basic understanding of JSON configs

Downloading the Server

Once you've downloaded the server archive, unpack it somewhere and move on to the Running the Server section.

Running the Server

  • You can double-click the mwo-server executable to do the trick or run it through the console using ./mwo-server in the server directory.
  • You can pass --config-path=[YOUR CONFIG FILE PATH] and/or --log-path=[YOUR LOG FILE PATH] as command-line arguments to mwo-server in order to make the server use different config and/or log files.

Once you've launched the server, you should see its console logs in their entirety. In a freshly launched server, the latest line of the logs will include your server's port. You must FORWARD THAT PORT AND that port + 1 if you want your server to accept non-local connections. (In simpler words: if you see 1551, forward 1551 AND 1552!)
At this point, you should be able to join the server via adding 127.0.0.1 in the MWO Launcher, using your account from official MWO servers. Check out the Customizing the Server section to learn how to change your server's name, ports, settings, timecycles, accounts, mods and much more!

If you did everything right, you should see something similar once you launch the server. Note the port!

Customizing the Server

Now that you have an MWO server running, it's time to change it to better suit your needs. After all, it's literally just named An MWO Server at this point: who wouldn't want to change that?!

Server Config

In order to change your server's settings, you should look no further than the core-server.json file. It contains all of the customization settings that you can (and probably should) change. (Look into the Server Configuration Summary for a near-complete explanation of the file's contents)
The server config file is written in JSON, and the server executable will expect it to be valid JSON. The rest of this article assumes you're at least somewhat acquainted with JSON: if not, you really should learn more about it!

Changing the server's Name, Description and Port

Name & Description

Right at the top of the config file are the serverName and serverDescription fields. You may change them to anything you like: the changes to the config file will only take effect once you restart the server though, so keep that in mind.

Ports

A bit lower is the gamePort field: it defines the main network port of the server. If you plan on running more than one MWO server on your machine, consider changing it to keep it unique for every server instance. Set to 1551 by default, you may change it to any value you like. (You WILL have to also change the apiPort field in the webApi section to a port higher by 1 than the game port in order to keep the server working properly!)

Making your server private

You can lock your server behind a server-wide password. To enable it, set the auth.enabled field to false and the multiplayer.passwordProtected field to true in the server config, then head to SHA256 Online and generate a hash for your server password. Once you're done, copy&paste the password hash into the multiplayer.serverPassword field and restart the server. From that point onwards, anyone trying to join your server will be asked to provide the password you entered. (NOTE: enabling a global server password will turn off accounts, and you will be able to join using any username at all!)

Becoming Admin

Using RCON

You can temporarily grant yourself server-wide admin permissions via RCON. To enable it, set the multiplayer.rconEnabled field to true in the server config, then head to SHA256 Online and generate a hash for your RCON password. Once you're done, copy&paste the password hash into the multiplayer.rconPassword field and restart the server. Now, you can use the /rclogin [password] in-game command to gain admin access for the remainder of your session.
Make sure to come up with a strong password and never tell it to anyone!

Using GPAuth

Check GPAuth Summary for info regarding setting up GPAuth.

Controlling the Anti-Cheat

The anti-cheat system may interfere with mods you decide to install and overall limit the gameplay. In order to disable anti-cheat features, set the verification.verifySyncPackets and verification.verifyVehicleAttributes fields to false in the config. Respectively, you can set both values to true in order to enable anti-cheat (and possibly break all of your mods, since the anti-cheat database is built for Racing resources).
The anti-cheat is disabled by default so that people aren't confused about their server kicking them out whenever they change something.

Installing Mods

If you want to spice up the gameplay, feel free to install mods onto your server! All of your mods go into the resources folder in a specific manner:

  • Car model mods go to resources/game/CARS.
  • VLT modscripts go to resources/scripts.

Do note that we currently don't support addons, and VLT scripts that are too complex may not work properly.
For a good start, consider downloading and unpacking the resources used on our official servers: