A Docker image for running a dedicated server for the game Barotrauma.
Tested with server version 0.20.16.1.
- docker v20.10.16 how to install - step 1 & 2
- docker-compose (recommended) v1.29.2 how to install
An example sequence to build then run:
export UID=$(id -u)
export GID=$(id -g)
docker-compose build
docker-compose up -dIf you are trying to run a modded server and need Lua for Barotrauma, specify the args LUA_SERVER=true.
export UID=$(id -u)
export GID=$(id -g)
docker-compose build --build-arg LUA_SERVER=true
docker-compose up -dYou will then need to add your mods in the mods volume (default $HOME/barotrauma-server/mods) and edit the config_player.xmlfile with the necessary references to the mods. Run docker-compose down && docker-compose up -d to have the server read the new configuration. More details below.
Provided there isn't a breaking change from the developers, to update your server, run:
export UID=$(id -u)
export GID=$(id -g)
docker-compose build --no-cache
Use the additional argument for modded servers (--build-arg LUA_SERVER=true) in case you are running mods.
Then, finally: docker-compose up -d to restart the container.
- Port
27015must be opened for client connections - Port
27016can optionally be opened for steam communication
The container uses three volumes:
- Configs files at
$HOME/barotrauma-server/configs, mounted as/barotrauma/volumes/configin the container - Workshop Mod files at
$HOME/barotrauma-server/workshop-mods, mounted as/barotrauma/volumes/workshopModsin the container - Local Mod files at
$HOME/barotrauma-server/local-mods, mounted as/barotrauma/volumes/localModsin the container - Saves files at
$HOME/barotrauma-server/saves, mounted as/barotrauma/volumes/savesin the container
The various directories/files are then linked with the correct file/directories where the game server expect them to be.
For example, the <gamedir>/config_player.xml is actually a link to /barotrauma/volumes/config/config_player.xml in the container.
To install mods is better to subscribe on them from your steam account so that they are downloaded from the workshop.
Then open the game and choose "Host Server" from within the main menu'. Once you are in the lobby, you can disconnect.
In your game installation folder you should look for the file config_player.xml.
That will contains the necessary configuration strings including your mods or custom submarines.
Upload mods, subs and config_player.xml on your host machine and, once the container is running, copy/move the mods' directories into the mods volume and the submarines's directories into the subs volume.
Now edit the config_player.xml in the configs volume to include the regularpackages sections that include your mods and submarines.
You will need to edit the ones referring to the submarins so that they point to LocalMods and the ones that refer to mods to point to Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed.
The result would be something like:
[...]
<regularpackages>
<!--Start Downloaded Mod-->
<package
path="Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/987654321/filelist.xml" />
<!--End Downloaded Mod-->
</regularpackages>
[...]
Restart the container with docker-compose down && docker-compose up -d and you should be done.
Built starting from FragSoc/barotrauma-docker image, then adding docker-compose support and changing directories' references to match the latest version of Barotrauma, at this point overhauling the entire thing. Credits left to thanks for the initial image that helped understanding how this game server was supposed to be set up prior to the "mods apocalypse".
The few files in this repository are licensed under the GPL.
However, Barotrauma itself is licensed by Undertow Games and Fakefish, no credit is taken for the software running in this container. Read their EULA for more information.