The easiest way to host a Barotrauma server is to click the "Host server" button in the main menu. If you run into any problems when trying to host a server or want to use one of the more advanced server hosting options, please read the instructions below.
The easy option: hosting directly from the game
--> Open the "Host server" menu from the main menu.
--> Enter a name for your server and adjust the settings in the menu as you see fit (password, number of players, karma settings...)
--> Click "Start".
--> If you receive a prompt from Windows Firewall with your antivirus or a similar software asking whether to allow the application to connect to the internet, make sure you allow it to do so.
Advanced option: dedicated server
The dedicated server is a command line application, meaning that it has no graphical interface. It's more lightweight than the client application, meaning that it takes less of your computer’s resources to run. It may be the preferred option if you want to leave the server running in the background without playing on it yourself.
--> Launch a file called "DedicatedServer" inside the game folder.
--> If you wish to modify the settings for your server, you can edit a file called "serversettings.xml" inside the game folder. If the file is not present, it can be created by launching the DedicatedServer executable.
--> If you receive a prompt from Windows Firewall, your antivirus or a similar software asking whether to allow the application to connect to the internet, make sure you allow it to do so.
--> If the computer you wish to run the server on has a private IP, you may need to forward ports on your router (either manually or using UPnP port forwarding) to allow players to connect to your server. See the "forwarding ports" section for more instructions.
Advanced option: hosting using SteamCMD
This is a more complex way to host servers, mainly intended for people who want to run a dedicated server 24/7 on a remote machine. Unlike the previous options, it does not require logging in to Steam.
--> Install SteamCMD following these instructions
--> Log in to SteamCMD using the command "login anonymous".
--> Install the Barotrauma dedicated server using "app_update 1026340 validate".
--> Make sure you've configured the server settings, port forwarding, firewall settings and such as instructed in the "dedicated server" section above.
--> Launch the server using "app_run 1026340".
Forwarding ports
If the computer you wish to run the server on has a private IP, you may need to forward ports in your router to allow players to connect to your server.
Some routers support a feature called UPnP (universal plug and play) that can be used to automatically take care of port forwarding. You can enable it by selecting the "Attempt UPnP port forwarding" checkbox in the "Host server" menu, or when using the dedicated server, setting "enableupnp" to "true" in the "serversettings.xml" file.
Once you've enabled UPnP, you can check if others can connect to your server either by asking some else to join it, or by using some remote tool (see the "Resources" section below).
If others are unable to join your server after UPnP has been enabled, you may need to forward ports manually. We’re working on an alternative solution to remove the need for port forwarding, but for now this is how you can do it:
On many router models you can access the settings by navigating to http://192.168.1.1/ using your web browser, finding the port forwarding settings (sometimes called “application sharing”) and forwarding one of the ports using the following settings:
Game port (used to communicate with clients)
Service/Application: barotrauma
External Port: The port you have selected for your server (27015 by default)
Internal Port: The port you have selected for your server (27015 by default)
Protocol: UDP
Query port (used to communicate with Steam)
Service/Application: barotrauma
External Port: The port you have selected for your server (27016 by default)
Internal Port: The port you have selected for your server (27016 by default)
Protocol: UDP
If you are playing the old, non-Steam legacy version, you only need to forward the game port (14242 by default).
Resources
Remote Port Testing URLs
http://www.yougetsignal.com/tools/open-ports/
http://www.canyouseeme.org/
http://www.t1shopper.com/tools/port-scan/
Help with Forwarding Ports
http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/
http://portforward.com/english/routers/port_forwarding/
http://en.wikipedia.org/wiki/Port_forwarding