Barotrauma

Barotrauma

View Stats:
 This topic has been pinned, so it's probably important
WickedNik Oct 28, 2019 @ 3:03pm
Quick and dirty way to setup a dedicated server on a DigitalOcean VPS
#
Prerequisites
If you are planning on following this guide please keep in mind that you need to be able to work with linux.

About the setup
The whole process involves the following:

1) Creating up a new Ubuntu 18.04 VPS (I chose a 10/mo from DigitalOcean)
2) Creating a new user i.e. steam (avoid using root for obvious reasons)
3) Manually install steam on the users home directory
4) Login to steam using steamcmd to download Barotrauma with your own Steam ID and then login as anonymous to steam using steamcmd to download Barotrauma Dedicated Server
5) Create a script to run your server
6) Edit server files
7) Enjoy playing.

For the sake of my sanity, I will skip steps 1 and 2, and move straight to how to install steam.

Installing steamcmd

These are the commands required to install steamcmd.

sudo apt-get install lib32gcc1
mkdir ~/Steam && cd ~/Steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz

In my case I also needed to link steamclient.so so I run:

ln -s ~/Steam/linux64/steamclient.so ~/Steam/steamapps/common/Barotrauma\ Dedicated\ Server/lib64/steamclient.so

Without it the server would appear to run but I would get a “Server failed to initialise” error.

Using steamcmd to download BaroTrauma on your server

From your home directory run the command bellow to start steamcmd.

./Steam/steamcmd.sh

In steamcmd login with your steam account by using the following command:

login yourusername

After you’ve added your password and your steam guard code (if enabled) run

app_update 602960

Next, you need to login as anonymous and download the dedicated server by running:

login anonymous

And:

app_update 1026340

After this step, all files should be on your server.

Create a script to run your server

You can run the server from your home directory with this command:

./Steam/steamcmd.sh +login anonymous +app_run 1026340

But, since we want this running in the background create a runserver.sh file and paste the following command in there.

screen ./Steam/steamcmd.sh +login anonymous +app_run 1026340

The game will now start in a screen session. Detach the session and the server will keep running.

Edit server files

You server files will be located in

~/Steam/steamapps/common/Barotrauma Dedicated Server/

Remember to edit ~/Steam/steamapps/common/Barotrauma\ Dedicated\ Server/serversettings.xml and change public to true, otherwise don’t expect your server to show up!!!

That’s all. Launch your 24/7 dedicated server and have fun.

PS. I’m using a 15USD/MO VPS and hosting for 16 people with no problems.

PS2. Don’t know if I will be supporting this guide and keep in mind that I have no firewall or security settings here.


Last edited by WickedNik; Oct 30, 2019 @ 9:27am
< >
Showing 1-14 of 14 comments
Dynamoon  [developer] Oct 29, 2019 @ 7:33am 
Thanks for taking the time to write this! It looks good, so I pinned it :)
WickedNik Oct 30, 2019 @ 9:34am 
Fell in love with the game the first time the sub exploded and I felt that if it could be easier for people to host games if they had the full list of instructions. Took me a while myself to get everything right from various sources (Linode, DO, the forums here).

Next thing is to put all this in a shell script so that someone can either run that, or, initiate a new VPS with this script setting up everything on launch.
^1GOLDFiSH Jun 14, 2020 @ 2:52pm 
Hey,
Thanks for the info. Managed to peice together a Docker image which should let you run and install the dedicated server with a single command.
https://hub.docker.com/repository/docker/goldfish92/barotrauma-dedicated-server

Still some work to be done to make it easy to persist saved state between runs but will keep the README updated.

UPDATE:
Updated instructions to show how to add Submarines and persist Multiplayer saves between server restarts. Good to go!
Have fun running your servers :-)
Last edited by ^1GOLDFiSH; Jun 16, 2020 @ 2:33pm
Yonderwolf Sep 1, 2020 @ 11:00am 
Everytime I try to run the "Dedicated server exec" it give me this Report:

Barotrauma Dedicated Server crash report (generated on 8/16/2020 4:33:15 PM)


Barotrauma seems to have crashed. Sorry for the inconvenience!


Game version 0.10.4.0 (ReleaseMac, branch release, revision 965c31410a)
Level seed: no level loaded
Loaded submarine: None
Selected screen: None


System info:
Operating system: Unix 19.6.0.0 64 bit


Exception: Could not find a part of the path '/Users/seannazari/Data/ContentPackages'. (System.IO.DirectoryNotFoundException)
Target site: IntPtr CreateDirectoryHandle(System.String, Boolean)
Stack trace:
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at Barotrauma.ContentPackage.LoadAll() in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaShared/SharedSource/ContentPackage.cs:line 652
at Barotrauma.GameSettings..ctor() in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaShared/SharedSource/GameSettings.cs:line 635
at Barotrauma.GameMain..ctor(String[] args) in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaServer/ServerSource/GameMain.cs:line 85
at Barotrauma.Program.Main(String[] args) in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaServer/ServerSource/Program.cs:line 46

Any explanation or fixes to this as of right now I'm very confused.
Dynamoon  [developer] Sep 4, 2020 @ 7:12am 
@seannazari thank you for this and sorry for the trouble – we hadn't seen that before, and we're investigating now! It's hard to give more information yet, but this seems to be an important find.
Yonderwolf Sep 13, 2020 @ 2:14pm 
@Dynamoon Just to let you know I'm running on a mac computer pro, when I ran the script. I've also tried the method above and I can't seem to find the mac commands to complete it. If there is anyway you can take the time to tell me how to do it I'll be happy to spread the word on how to do it.
Last edited by Yonderwolf; Sep 13, 2020 @ 2:17pm
Yonderwolf Sep 23, 2020 @ 5:43pm 
@Dynamoon Seems like even though now it gets to the later stages to starting a dedicated server it pops up with a "InitGameServer returned false (0,16704,27015,27016,Authentication,"1.0.0.0")" at the end of the process.

[9/23/2020 7:36:37 PM]
Starting the server...
[9/23/2020 7:36:37 PM]
Using Lidgren networking. Manual port forwarding may be required. If players cannot connect to the server, you may want to use the in-game hosting menu (which uses SteamP2P networking and does not require port forwarding).


Coroutine Barotrauma.Networking.GameServer+<StartServer>d__47 threw an exception: InitGameServer returned false (0,16704,27015,27016,Authentication,"1.0.0.0")
at Steamworks.SteamServer.Init(AppId appid, SteamServerInit init, Boolean asyncCallbacks) in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Libraries/Facepunch.Steamworks/SteamServer.cs:line 93
at Barotrauma.Steam.SteamManager.CreateServer(GameServer server, Boolean isPublic) in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaServer/ServerSource/Networking/SteamManager.cs:line 24
at Barotrauma.Networking.GameServer.StartServer(Boolean isPublic)+MoveNext() in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs:line 195
at Barotrauma.CoroutineManager.IsDone(CoroutineHandle handle) in /Users/eetupitkanen/Documents/Repositories/Barotrauma-development/Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs:line 212
CAppInfoCacheReadFromDiskThread took 302 milliseconds to initialize

The second part was all in red text and idk if this is because I'm doing something wrong, If so can you please enlighten me on what I have to do as it doesn't seem to start the server.
Yonderwolf Oct 1, 2020 @ 11:17am 
Alright I've done some testing and it seems like the server runs BUT, I can't seem to find it in the "server browser". I confirmed this as I tested the start round command and it worked.
Yonderwolf Oct 1, 2020 @ 11:19am 
Also is there anyway to find the server IP in the server console? As I haven't found one.

Anyways you guys stay safe and Good Luck.
Last edited by Yonderwolf; Oct 1, 2020 @ 11:19am
Regalis  [developer] Oct 6, 2020 @ 12:17am 
@seannazari

The separate dedicated server application that's installed through SteamCMD is not available for Mac, so these instructions won't work as-is. Glad you got the server executable bundled with the game running though!

> I can't seem to find it in the "server browser"
Have you logged in to Steam and is Steam running on your computer?

> Also is there anyway to find the server IP in the server console?
I'm afraid there isn't, but you could use something like https://www.whatismyip.com/ to check your external IP address.
Virtones Oct 7, 2020 @ 6:29pm 
Hello, need some help with this one. I've purchased a google cloud VPS and was trying to get a baro server running, but can't go past this error. I've tried with anonymous login to get the server going, and with my personal account as well.

Warning: failed to init SDL thread priority manager: SDL not found
Warning: failed to set thread priority: set failed for priority 8
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
CHIDDeviceListSDL(): Couldn't load libSDL2-2.0.so.0, not enumerating devices
Barotrauma Dedicated Server 0.10.5.1 (ReleaseLinux, branch release, revision 9e259b2148)
Loading game settings
Loading MD5 hash cache
Initializing SteamManager
Initializing GameAnalytics
Initializing GameScreen
Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean
Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean
Selected sub: Typhon
Selected shuttle: Venture
[10/08/2020 01:21:34]
Starting the server...
[10/08/2020 01:21:34]
Using Lidgren networking. Manual port forwarding may be required. If players cannot connect to the server, you may want to use the in-game hosting menu (which uses SteamP2P networking and does not require port forwarding).
Coroutine Barotrauma.Networking.GameServer+<StartServer>d__47 threw an exception: InitGameServer returned false (0,57647,27015,0,NoAuthentication,"1.0.0.0")
at Steamworks.SteamServer.Init(AppId appid, SteamServerInit init, Boolean asyncCallbacks) in /home/joonas/Barotrauma/Libraries/Facepunch.Steamworks/SteamServer.cs:line 93
at Barotrauma.Steam.SteamManager.CreateServer(GameServer server, Boolean isPublic) in /home/joonas/Barotrauma/Barotrauma/BarotraumaServer/ServerSource/Networking/SteamManager.cs:line 24
at Barotrauma.Networking.GameServer.StartServer(Boolean isPublic)+MoveNext() in /home/joonas/Barotrauma/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs:line 195
at Barotrauma.CoroutineManager.IsDone(CoroutineHandle handle) in /home/joonas/Barotrauma/Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs:line 212
Kazop Dec 31, 2020 @ 6:01pm 
Based on the users error above basically being the same as my own, with the help of Jlobblet on the discord, it seems that the main issue is that the command to launch the server is:
~/.steam/steamapps/common/Barotrauma\ Dedicated\ Server/DedicatedServer

If you do "steamcmd +login anonymous +app_run 1026340" then you get the error.

And from a fresh boot when you're not logged into steam, it'll stop at the languages line so the command that works for me is:
steamcmd +login anonymous +quit && screen ~/.steam/steamapps/common/Barotrauma\ Dedicated\ Server/DedicatedServer

I would definitely just make a shell script with the above command. Quick side note, I was able to launch this on my BuyVM VPS but it wouldn't display in server browser but works perfectly fine on my OVH VPS, so if you can't get it to work and you have BuyVM maybe contact support or switch to a new provider. Also, your save location is at "/home/USERNAME/.steam/steamapps/common/Barotrauma Dedicated Server/Daedalic Entertainment GmbH/Barotrauma/Multiplayer", didn't see this listed anywhere and you can just copy over SteamP2P multiplayer saves without any issues. Hope this helps someone else!
Last edited by Kazop; Jan 3, 2021 @ 10:19am
Urantij Apr 7, 2021 @ 7:28pm 
Recently i tried to follow this guide, and wanted to point out, that some of it is out of date.
ln -s ~/Steam/linux64/steamclient.so ~/Steam/steamapps/common/Barotrauma\ Dedicated\ Server/lib64/steamclient.so
needs to be changed to
ln -s ~/Steam/steamapps/common/Barotrauma\ Dedicated\ Server/linux64/steamclient.so ~/Steam/sdk64/steamclient.so
Maybe you need to explicitly create folder for that
mkdir ~/Steam/sdk64

Also, you dont need to install the game with app code 602960 using your username. And you cannot start the server in steamcmd.
Use instead:
~/Steam/steamapps/common/Barotrauma\ Dedicated\ Server/DedicatedServer
Last edited by Urantij; Apr 7, 2021 @ 7:30pm
Does the dedicated server support IPv6?
I can connect to the server using an IPv4 address, but connecting to my server using an IPv6 address failed
Do you have any plans for ipv6?
< >
Showing 1-14 of 14 comments
Per page: 1530 50