{"id":27079142,"url":"https://github.com/yanwenkun/barotrauma-server-docker","last_synced_at":"2025-07-04T03:40:27.077Z","repository":{"id":135211867,"uuid":"441022687","full_name":"YanWenKun/barotrauma-server-docker","owner":"YanWenKun","description":"🐳 Dockerfile for 🤿 Barotrauma Dedicated Server. | 《潜渊症》独立服务器 Docker 镜像。","archived":false,"fork":false,"pushed_at":"2024-06-19T03:47:12.000Z","size":105,"stargazers_count":37,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T01:32:27.485Z","etag":null,"topics":["barotrauma","docker","game-server-hosting"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/yanwk/barotrauma-server","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YanWenKun.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-23T00:53:17.000Z","updated_at":"2025-02-21T19:45:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e403250-8068-4fd9-8738-818d8cdf05c5","html_url":"https://github.com/YanWenKun/barotrauma-server-docker","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/YanWenKun/barotrauma-server-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fbarotrauma-server-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fbarotrauma-server-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fbarotrauma-server-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fbarotrauma-server-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YanWenKun","download_url":"https://codeload.github.com/YanWenKun/barotrauma-server-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanWenKun%2Fbarotrauma-server-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263442094,"owners_count":23467213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barotrauma","docker","game-server-hosting"],"created_at":"2025-04-06T01:32:28.996Z","updated_at":"2025-07-04T03:40:27.032Z","avatar_url":"https://github.com/YanWenKun.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Run Barotrauma Dedicated Server in Docker\n\nimage::docs/submarine-whale.svg[\"Good Luck\"]\n\n*link:README.zh.adoc[\u003e\u003e 中文文档 \u003c\u003c]*\n\nThis repo is inspired by https://github.com/CM2Walki/steamcmd[CM2Walki] \nand https://github.com/gnoeley/barotrauma-dedicated-server-docker[gnoeley], with different approaches.\n\n## Quick Start\n\n*See https://hub.docker.com/r/yanwk/barotrauma-server[Docker Hub Page].*\n\n## Flavors\n\n### TL;DR\n\n* If you just want to start a vanilla game in 5 minutes, use \u003c\u003chow-to-run-dockerful-flavor,`dockerful`\u003e\u003e.\n* If you want a long-running server with loads of mods, use `slim` and \u003c\u003cprepare-your-files,follow the steps\u003e\u003e.\n\n### Details\n\n*_Barotrauma Dedicated Server_* is basically a core subset of the game, without assets like images and sounds.\nThe game is program-data mixed, so is the Server, which brings more to consider when deploy in container-style.\n\nMost importantly, is whether you need Modding or not.\n\nFor different scenario, we have three flavors: \n\n* \u003c\u003chow-to-run-slim-flavor,`slim`\u003e\u003e would run container in an \"old fashioned\", \"non-dockerful\", yet robust way.\n** It only come with .NET runtime and SteamCMD (Official Steam Client CLI).\n** It will download \u0026 install the game server on first start.\n** It will update the game server (via SteamCMD) on every container restart.\n** **It mounts the whole game server folder as a docker volume.**\n*** So you can thoroughly modding your game (out of Mods folder). \n*** Restarting/Redeploying of container won't replace your files (But Be Careful Of Game Updates ;-)\n** No environment variables. Just edit settings files.\n\n* \u003c\u003chow-to-run-preload-flavor,`preload`\u003e\u003e is just `slim` with the server installed.\n** It will update the game server (via SteamCMD) on every container start.\n** Use it when you prefer `slim` but your server has a slow connection to Steam.\n** If you're familiar with `docker build`, you could use this `Dockerfile.preload` to build your own image, preloading all your files into it.\n\n* \u003c\u003chow-to-run-dockerful-flavor,`dockerful`\u003e\u003e is \"containerized\" at best.\n** No SteamCMD included. Won't check update when start (so **starts fast** and **won't stuck at connecting Steam**).\n** If the game updates, you'll need to run a new container with an up-to-date `yanwk/barotrauma-server:dockerful` image (this repo auto-builds weekly).\n** Certain files (including your **settings, mods, submarines and campaign saves**) are mounted to a docker volume for persistence.\n** You can set Server Name, Server Password, Server Publicity and Admin's SteamID by setting ENV variables.\n** **Will be a mess if Barotrauma makes a break change. So short-term game is preferred.**\n** `Dockerfile.dockerful` also pre-load Mods files into image like `preload`. But will try copy(no overwrite) to persistence storage on every start. Could be messy if not clean it afterwards properly.\n\n[[prepare-your-files]]\n## Before start: Prepare your files\n\nNOTE: If you choose `dockerful`, and have no mods/submarines/saves to upload, just jump to \u003c\u003chow-to-run-dockerful-flavor,Run dockerful\u003e\u003e.\n\n1. Run Barotrauma on **your computer**, enable all mods you want.\n2. Create a server, assume it's the dedicated server, set Server Name,\n  Password, Public Visibility (not editable after server started). Then start the server.\n  * You can leave game mode settings for later.\n  * You don't need to actual start a round, settings will immediately write to file.\n3. Quit game, open the game folder (e.g. Steam\\steamapps\\common\\Barotrauma). Find these files:\n\n.Main settings for server\n serversettings.xml\n\n.All player-settings, we only need language and mods settings in it.\n config_player.xml\n\n.Client permissions, mark you as the owner.\n Data/clientpermissions.xml\n\n.Karma settings, don't need if not changed.\n Data/karmasettings.xml\n\nAddtionally, you may want to copy:\n\n.Mods folder (including Submarine files)\n LocalMods/\n\n.Multiplayer campaign saves\n----\n# on Windows\n\"%localappdata%\\Daedalic Entertainment GmbH\\Barotrauma\\Multiplayer\"\n\n# on macOS / Linux\n\"~/.local/share/Daedalic Entertainment GmbH/Barotrauma/Multiplayer\"\n----\n\nCopy these files into a convenient place.\n\nTIP: You could also https://ignis05.github.io/baro-save-editor/[conver a singleplayer campaign to multiplayer].\n\n### Edit `config_player.xml`\n\nWe only need language setting (affect bots chat, outpost names, server log, etc):\n\n language=\"English\"\n\nand mods settings:\n\n[source,xml]\n----\n  \u003ccontentpackages\u003e\n    \u003ccorepackage\n      path=\"Content/ContentPackages/Vanilla.xml\" /\u003e\n    \u003cregularpackages\u003e\n      \u003cpackage\n        path=\"LocalMods/MyMod1/filelist.xml\" /\u003e\n      \u003cpackage\n        path=\"LocalMods/MyMod2/filelist.xml\" /\u003e\n    \u003c/regularpackages\u003e\n  \u003c/contentpackages\u003e\n----\n\nYou could in theory just replace server-side `config_player.xml` with your local one. Settings like graphics and sounds may not have effect on server. However it's better not doing that.\n\n[[how-to-run-slim-flavor]]\n## Guide: Run `slim`\n\n### 1. Check your server environment\n\n* Make sure you can access your container's volume, or file system.\n** If not, check \u003c\u003chow-to-run-dockerful-flavor,`dockerful`\u003e\u003e.\n\n### 2. Run the server once\n\n.A. Using `docker run`\n[source,sh]\n----\ndocker run \\\n  --name barotrauma-server-slim \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-gamedir:/home/runner/Steam/steamapps/common/Barotrauma Dedicated Server\" \\\n  yanwk/barotrauma-server:slim\n----\n\n.B. Using `docker compose`\n[source,sh]\n----\ngit clone https://github.com/YanWenKun/barotrauma-server-docker.git\ndocker compose -f docker-compose.slim.yml up\n----\n\n* If everything goes well, the log will show \"Server started\".\n* For now, we can connect the server via IP address only.\n** Make sure `27015/udp` \u0026 `27016/udp` is open.\n\n### 3. Upload your files\n\nNote, make sure no player is in server, or just stop the server.\n\nUpload \u0026 replace the files mentioned above.\nYou can find them in *docker volume*.\n\nIf you need absolute path:\n\n \"/home/runner/Steam/steamapps/common/Barotrauma Dedicated Server\"\n\nMultiplayer campaign save:\n\n \"/home/runner/Steam/steamapps/common/Barotrauma Dedicated Server/Daedalic Entertainment GmbH/Barotrauma/Multiplayer\"\n\n\n### 4. Restart the server\n\nFinally, restart the server in order for your changes to take effect.\n\n.A. Using `docker restart`\n docker restart barotrauma-server-slim\n\n.B. Using `docker compose`\n docker compose -f docker-compose.slim.yml restart\n\nIf you chekced \"public server\", you could see it on the list now.\n\nAlso, if you need to update the server, just restart it.\n\n\n[[how-to-run-preload-flavor]]\n## Guide: Run `preload`\n\nSame as \u003c\u003chow-to-run-slim-flavor,`slim`\u003e\u003e, just replace the image tag:\n\n.A. Using `docker run`\n[source,sh]\n----\ndocker run \\\n  --name barotrauma-server-preloaded \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-gamedir:/home/runner/Steam/steamapps/common/Barotrauma Dedicated Server\" \\\n  yanwk/barotrauma-server:preload\n----\n\n.B. Using `docker compose`\n[source,sh]\n----\ngit clone https://github.com/YanWenKun/barotrauma-server-docker.git\ndocker compose --file docker-compose.preload.yml up\n----\n\n\n[[how-to-run-dockerful-flavor]]\n## Guide: Run `dockerful`\n\n### 1. Run server with ENV variables\n\n.A. Using `docker run`\n[source,sh]\n----\ndocker run \\\n  --name barotrauma-server-dockerful \\\n  --env DEFAULT_SERVERNAME=AABBCC \\\n  --env DEFAULT_PASSWORD=112233 \\\n  --env DEFAULT_PUBLICITY=true \\\n  --env DEFAULT_LANGUAGE=\"English\" \\\n  --env DEFAULT_OWNER_STEAMNAME=\"S0m3_b0dy\" \\\n  --env DEFAULT_OWNER_STEAMID=\"STEAM_1:1:123456789\" \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-data:/persistence\" \\\n  yanwk/barotrauma-server:dockerful\n----\n\n* STEAMNAME is your Steam displayed name, NOT your account.\n\n* STEAMID can be found via: https://steamid.io/\n\n* STEAMNAME and STEAMID should be used together.\n\n.B. Using `docker compose`\n[source,sh]\n----\ngit clone https://github.com/YanWenKun/barotrauma-server-docker.git\n### Edit Compose file... ###\ndocker compose --file docker-compose.dockerful.yml up\n----\n\nThe server is now good to go.\nSteps below are optional.\n\n### 2. Upload your files (optional)\n\nAccess your docker volume, there are four subfolders. Upload to them accordingly:\n\n[cols=2]\n|=== \n|Folder Name |Description\n\n|configs\n|Server Settings\n\n|mods\n|Same as LocalMods/ Folder (including submarines)\n\n|multiplayer-saves\n|Multiplayer Campaign Save\n\n|=== \n\nYou may want to check \u003c\u003cprepare-your-files,file list\u003e\u003e.\n\n[[restart-dockerful]]\n### 3. Restart server (optional)\n\nYou need to restart the server for changes to take effect.\n\nYou can restart the container, or just create a new one:\n\n[source,sh]\n----\ndocker rm --force barotrauma-server-dockerful\n\ndocker run \\\n  --name barotrauma-server-dockerful \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-data:/persistence\" \\\n  yanwk/barotrauma-server:dockerful\n----\n\n### 4. Update server settings\n\nJust set ENV variables and start a new container:\n\n[source,sh]\n----\ndocker rm --force barotrauma-server-dockerful\n\ndocker run \\\n  --name barotrauma-server-dockerful \\\n  --env FORCE_SERVERNAME=BBCCAA \\\n  --env FORCE_PASSWORD=223344 \\\n  --env FORCE_PUBLICITY=true \\\n  --env FORCE_LANGUAGE=\"English\" \\\n  --env FORCE_OWNER_STEAMNAME=\"S0m3_b0dy\" \\\n  --env FORCE_OWNER_STEAMID=\"STEAM_1:1:123456789\" \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-data:/persistence\" \\\n  yanwk/barotrauma-server:dockerful\n----\n\nIf you use Docker Compose, just edit the Compose file.\n\nAfter you force-updated new settings, it's better to \u003c\u003crestart-dockerful,start a new container (again) without ENV variables\u003e\u003e to avoid accidental overwrite in future.\n\n\n[[build-your-own]]\n## Advanced: Build your own pre-loaded image\n\nIn this ultimate way, you build your own docker image pre-loaded with all settings, mods, submarines and saves.\nThis could be useful if you don't have access to your container's volume. But you still need to find a way to backup your saves.\n\nNOTE: Update files in docker image won't affect volume. If you need to update mods on server frequently, you may want to edit Dockerfile.preload or Dockerfile.dockerful to meet your own needs (Focus on config_player.xml and LocalMods/ ).\n\n1. Clone this repo\n\n git clone https://github.com/YanWenKun/barotrauma-server-docker.git\n\n2. \u003c\u003cprepare-your-files,Prepare your files\u003e\u003e.\n\n3. Replace the files in link:preloads/[preloads/]\n\n4. Build \u0026 Run\n\nA. Using `docker compose` (edit `docker-compose.preload.yml`)\n\n docker compose --file docker-compose.preload.yml up --build\n\nB. Using `docker build` and `docker run`\n\n[source,sh]\n----\ndocker build . -f Dockerfile.preload -t my-baro-server\n----\n\n[source,sh]\n----\ndocker run \\\n  --name my-barotrauma-server \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-gamedir:/home/runner/Steam/steamapps/common/Barotrauma Dedicated Server\" \\\n  my-baro-server\n----\n\n### Testing: Run without server start\n\nSince the Dockerfile here is using CMD as entry, you can easily override it, like:\n\n[source,sh]\n----\ndocker run \\\n  -it \\\n  --rm \\\n  --user root \\\n  -p 27015:27015/udp \\\n  -p 27016:27016/udp \\\n  -v \"baro-gamedir:/home/runner/Steam/steamapps/common/Barotrauma Dedicated Server\" \\\n  my-baro-server \\\n  /bin/bash\n----\n\nThis will start a container in root bash without starting the server.\n\n## Extra: An example Dockerfile for any game-server using SteamCMD\n\nCheck link:docs/Dockerfile.exmaple[Dockerfile.exmaple].\n\n* It's a minimal Dockerfile.\n* Try replacing `$STEAMAPPID`, `$GAMEDIR` and `DedicatedServerApp`. \n* Try add deps, runtimes.\n* You can refer to link:Dockerfile.slim[Dockerfile.slim]\nand link:Dockerfile.preload[Dockerfile.preload].\n\n## Disclaimer\n\nlink:docs/submarine-whale.svg[This image] is derived from\nhttps://www.maxpixel.net/Sperm-Whale-Valentines-Day-Wal-Heart-Blast-600387[here]\nand\nhttps://www.svgrepo.com/svg/193183/submarine[here]\nwith\nhttps://creativecommons.org/publicdomain/zero/1.0/[CC0].\n\nSource code under\nlink:LICENSE[MIT License].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanwenkun%2Fbarotrauma-server-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanwenkun%2Fbarotrauma-server-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanwenkun%2Fbarotrauma-server-docker/lists"}