├── .dockerignore ├── arkmanager ├── instance.cfg └── arkmanager.cfg ├── log.sh ├── test ├── ark-thecenter.env ├── ark-ragnarok.env ├── ark-theisland.env └── run-test.sh ├── renovate.json ├── .github ├── stale.yml └── ISSUE_TEMPLATE.md ├── docker-compose.yml ├── LICENSE ├── Dockerfile ├── .circleci └── config.yml ├── run.sh └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | test/ -------------------------------------------------------------------------------- /arkmanager/instance.cfg: -------------------------------------------------------------------------------- 1 | # Config root directory 2 | arkserverroot="/ark/server" -------------------------------------------------------------------------------- /log.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | while true; do 4 | sleep $LOG_RCONCHAT 5 | arkmanager rconcmd GetChat 2>/dev/null | sed '/^Running command.*$/d' | tr -d '"' | sed '/^\s*$/d' | sed '/^Command processed.*$/d' | sed '/^Error connecting to server.*$/d' 6 | done -------------------------------------------------------------------------------- /test/ark-thecenter.env: -------------------------------------------------------------------------------- 1 | am_ark_SessionName=Ark Server 2 | am_serverMap=TheCenter 3 | am_ark_ServerAdminPassword=k3yb04rdc4t 4 | am_ark_ServerPassword= 5 | am_ark_MaxPlayers=10 6 | am_ark_QueryPort=27015 7 | am_ark_Port=7778 8 | am_ark_RCONPort=32330 9 | #am_ark_AltSaveDirectoryName=SavedArks 10 | #am_arkwarnminutes=15 11 | #am_arkAutoUpdateOnStart=false 12 | am_ark_GameModIds=889745138,731604991,893904615,564895376,931434275,1404697612,621154190 13 | #ARKCLUSTER=true 14 | #am_arkStagingDir= 15 | #ARKSERVER_SHARED=/arkserver 16 | -------------------------------------------------------------------------------- /test/ark-ragnarok.env: -------------------------------------------------------------------------------- 1 | am_arkNoPortDecrement=true 2 | am_ark_SessionName=Ark Server 3 | am_serverMap=Ragnarok 4 | am_ark_ServerAdminPassword=k3yb04rdc4t 5 | am_ark_ServerPassword= 6 | am_ark_MaxPlayers=10 7 | am_ark_QueryPort=27016 8 | am_ark_Port=7780 9 | am_ark_RCONPort=32331 10 | #am_arkwarnminutes=15 11 | am_arkAutoUpdateOnStart=false 12 | am_ark_GameModIds=889745138,731604991,893904615,564895376,931434275,1404697612,621154190 13 | ARKCLUSTER=true 14 | # this must be unique across all clusters on steam! 15 | am_arkopt_clusterid=FooBar 16 | ARKSERVER_SHARED=/arkserver 17 | -------------------------------------------------------------------------------- /test/ark-theisland.env: -------------------------------------------------------------------------------- 1 | am_arkNoPortDecrement=true 2 | am_ark_SessionName=Ark Server 3 | am_serverMap=TheIsland 4 | am_ark_ServerAdminPassword=k3yb04rdc4t 5 | am_ark_ServerPassword= 6 | am_ark_MaxPlayers=10 7 | am_ark_QueryPort=27015 8 | am_ark_Port=7778 9 | am_ark_RCONPort=32330 10 | #am_arkwarnminutes=15 11 | am_arkAutoUpdateOnStart=true 12 | am_ark_GameModIds=889745138,731604991,893904615,564895376,931434275,1404697612,621154190 13 | ARKCLUSTER=true 14 | # this must be unique across all clusters on steam! 15 | am_arkopt_clusterid=FooBar 16 | ARKSERVER_SHARED=/arkserver 17 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "enabledManagers": ["regex"], 7 | "regexManagers": [ 8 | { 9 | "fileMatch": [ 10 | "^.circleci/config.yml$", 11 | "^Dockerfile$" 12 | ], 13 | "matchStrings": [ 14 | "\\sdefault: (?.*?) # (?.*?):(?.*?)\\n", 15 | "# (?.*?):(?.*?)\\sARG .*?_VERSION=(?.*)\\n" 16 | ], 17 | "versioningTemplate": "semver" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 30 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 3 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | - good first issue 10 | - help wanted 11 | # Label to use when marking an issue as stale 12 | staleLabel: stale 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | This issue has been automatically marked as stale because it has not had 16 | recent activity. It will be closed if no further activity occurs. Thank you 17 | for your contributions. 18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: false 20 | exemptProjects: true 21 | exemptMilestones: true 22 | exemptAssignees: true 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | ## Image Setup Details 6 | 7 | 8 | * **Image Tag**: 9 | 11 | * **Docker Host OS**: 12 | 14 | * **`docker run` command or `docker-compose.yml` file**: 15 | ``` 16 | version: '3' 17 | 18 | services: 19 | your-compose-file-here: 20 | image: drpsychick/arkserver:0.0.0 21 | ``` 22 | 23 | ## Description of Issue 24 | 25 | Description of issue 26 | 27 | ## Additional Information 28 | 30 | Additional information -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | arkserver: 3 | image: drpsychick/arkserver:latest 4 | container_name: arkserver 5 | restart: always 6 | ports: 7 | - "27015:27015" 8 | - "27015:27015/udp" 9 | - "7778:7778" 10 | - "7778:7778/udp" 11 | - "7777:7777" 12 | - "7777:7777/udp" 13 | # Uncomment for RCON 14 | # - "32330:32330" 15 | # - "32330:32330/udp" 16 | environment: 17 | ### CHANGE THESE 18 | - am_ark_SessionName=Ark Server 19 | - am_serverMap=Fjordur 20 | - am_ark_ServerAdminPassword= 21 | - am_ark_ServerPassword= 22 | - am_ark_MaxPlayers=20 23 | - am_arkflag_crossplay=false 24 | - am_arkwarnminutes=60 25 | ### LEAVE THESE 26 | - am_ark_QueryPort=27015 27 | - am_ark_Port=7778 28 | - am_arkserverroot="/ark/server" 29 | - am_arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" 30 | # RCON stuff if you need 31 | - am_ark_RCONPort=32330 32 | - LOG_RCONCHAT=0 33 | volumes: # Persistent data 34 | - /srv/ark-server/steam:/home/steam/.steam/steamapps 35 | - /srv/ark-server/ark:/ark 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Thomas Hoag 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG STEAMCMD_VERSION=latest 2 | ARG AMG_BUILD=latest 3 | # github-releases:arkmanager/ark-server-tools 4 | ARG AMG_VERSION=v1.6.68 5 | FROM drpsychick/steamcmd:$STEAMCMD_VERSION AS base 6 | 7 | USER root 8 | 9 | RUN apt-get update \ 10 | && apt-get install -y \ 11 | curl \ 12 | cron \ 13 | bzip2 \ 14 | perl-modules \ 15 | lsof \ 16 | libc6-i386 \ 17 | # libsdl2-2.0.0:i386 \ 18 | sudo \ 19 | && apt-get autoremove -y \ 20 | && apt-get clean -y \ 21 | && rm -rf /var/lib/apt/lists/* \ 22 | && rm -rf /tmp/* \ 23 | && rm -rf /var/tmp/* 24 | 25 | FROM base AS arkmanager-latest 26 | RUN curl -sL "https://git.io/arkmanager" | bash -s steam 27 | 28 | FROM base AS arkmanager-versioned 29 | ARG AMG_VERSION 30 | RUN curl -sL "https://raw.githubusercontent.com/arkmanager/ark-server-tools/$AMG_VERSION/netinstall.sh" | bash -s steam -- --unstable 31 | 32 | ARG AMG_BUILD 33 | FROM arkmanager-$AMG_BUILD 34 | RUN ln -s /usr/local/bin/arkmanager /usr/bin/arkmanager 35 | 36 | COPY arkmanager/arkmanager.cfg /etc/arkmanager/arkmanager.cfg 37 | COPY arkmanager/instance.cfg /etc/arkmanager/instances/main.cfg 38 | COPY run.sh /home/steam/run.sh 39 | COPY log.sh /home/steam/log.sh 40 | 41 | RUN echo "%sudo ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers \ 42 | && usermod -a -G sudo steam \ 43 | && mkdir /ark /arkserver \ 44 | && chown -R steam:steam /ark /arkserver 45 | 46 | WORKDIR /home/steam 47 | USER steam 48 | 49 | ENV am_ark_SessionName=Ark\ Server \ 50 | am_serverMap=TheIsland \ 51 | am_ark_ServerAdminPassword=k3yb04rdc4t \ 52 | am_ark_MaxPlayers=70 \ 53 | am_ark_QueryPort=27015 \ 54 | am_ark_Port=7778 \ 55 | am_ark_RCONPort=32330 \ 56 | am_ark_AltSaveDirectoryName=SavedArks \ 57 | am_arkwarnminutes=15 \ 58 | am_arkAutoUpdateOnStart=false 59 | 60 | ENV VALIDATE_SAVE_EXISTS=false \ 61 | BACKUP_ONSTART=false \ 62 | LOG_RCONCHAT=0 \ 63 | ARKCLUSTER=false 64 | 65 | # only mount the steamapps directory 66 | # mount /home/steam/.steam/steamapps if you want to share storage for steam mod staging 67 | VOLUME /ark 68 | # optionally shared volumes between servers in a cluster 69 | VOLUME /arkserver 70 | # mount /arkserver/ShooterGame/Saved seperate for each server 71 | # mount /arkserver/ShooterGame/Saved/clusters shared for all servers 72 | 73 | CMD [ "./run.sh" ] 74 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Required ENV variables 2 | # DOCKER_USER, DOCKER_PASS 3 | version: 2.1 4 | aliases: 5 | - ¶meters 6 | steamcmd_version: 7 | default: latest 8 | type: string 9 | amg_build: 10 | default: latest 11 | type: string 12 | amg_version: 13 | default: v1.6.68 # github-releases:arkmanager/ark-server-tools 14 | type: string 15 | repo: 16 | default: drpsychick 17 | type: string 18 | repo_name: 19 | default: arkserver 20 | type: string 21 | - &build 22 | - checkout 23 | - setup_remote_docker 24 | - run: 25 | # plain docker build x86 without cross-platform 26 | name: Build images 27 | command: | 28 | echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin &> /dev/null || exit 1 29 | if [ "latest" = "<< parameters.amg_build >>" ]; then 30 | echo "Building << parameters.repo >>/<< parameters.repo_name >>:<< parameters.steamcmd_version >>" 31 | docker build --progress plain \ 32 | --build-arg STEAMCMD_VERSION=<< parameters.steamcmd_version >> \ 33 | --tag << parameters.repo >>/<< parameters.repo_name >>:<< parameters.steamcmd_version >> . 34 | if [ "${CIRCLE_BRANCH}" = "master" ]; then 35 | docker push << parameters.repo >>/<< parameters.repo_name >>:<< parameters.steamcmd_version >> 36 | fi 37 | else 38 | echo "Building << parameters.repo >>/<< parameters.repo_name >>:<< parameters.steamcmd_version >>-<< parameters.amg_version >>" 39 | docker build --progress plain \ 40 | --build-arg STEAMCMD_VERSION=<< parameters.steamcmd_version >> \ 41 | --build-arg AMG_BUILD=<< parameters.amg_build >> \ 42 | --build-arg AMG_VERSION=<< parameters.amg_version >> \ 43 | --tag << parameters.repo >>/<< parameters.repo_name >>:<< parameters.steamcmd_version >>-<< parameters.amg_version >> . 44 | docker push << parameters.repo >>/<< parameters.repo_name >>:<< parameters.steamcmd_version >>-<< parameters.amg_version >> 45 | fi 46 | jobs: 47 | build: 48 | parameters: *parameters 49 | docker: 50 | - image: docker 51 | resource_class: small 52 | steps: *build 53 | 54 | workflows: 55 | version: 2 56 | build-images: 57 | jobs: 58 | - build: 59 | matrix: 60 | parameters: 61 | steamcmd_version: ["latest", "jammy", "focal"] 62 | - build: 63 | matrix: 64 | parameters: 65 | steamcmd_version: ["latest"] 66 | amg_build: ["versioned"] 67 | amg_version: ["master", "v1.6.62"] 68 | 69 | # build tags weekly 70 | weekly: 71 | triggers: 72 | - schedule: 73 | # first day of month, 5:33 am, UTC 74 | cron: "33 5 1 * *" 75 | filters: 76 | branches: 77 | only: 78 | - master 79 | jobs: 80 | - build: 81 | matrix: 82 | parameters: 83 | steamcmd_version: ["latest", "jammy", "focal"] 84 | - build: 85 | matrix: 86 | parameters: 87 | steamcmd_version: ["latest"] 88 | amg_build: ["versioned"] 89 | amg_version: ["master", "v1.6.62"] 90 | -------------------------------------------------------------------------------- /test/run-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IMAGE=drpsychick/arkcluster 4 | TAG=focal 5 | (cd ..; docker build --build-arg STEAMCMD_VERSION=$TAG --tag $IMAGE:$TAG .) 6 | #docker pull $IMAGE:$TAG 7 | 8 | function testDirectoriesExist() { 9 | nok=0 10 | if [ ! -d "$1/backup" ]; then nok=$((nok+1)); echo "/backup is missing!"; fi 11 | if [ ! -d "$1/config" ]; then nok=$((nok+1)); echo "/config is missing!"; fi 12 | if [ ! -d "$1/log" ]; then nok=$((nok+1)); echo "/log is missing!"; fi 13 | 14 | if [ $nok -gt 0 ]; then 15 | echo "FAIL: $nok errors" 16 | fi 17 | } 18 | 19 | # Test a simple server with only one directory mounted 20 | function testNewSimpleServer() { 21 | echo "====> TEST $FUNCNAME" 22 | mkdir -p ark-theisland 23 | 24 | serverdir=ark-theisland 25 | docker run --rm -it --name $serverdir \ 26 | --env-file $serverdir.env \ 27 | -v $PWD/$serverdir:/ark \ 28 | -e ARKCLUSTER=false \ 29 | -e ARKSERVER_SHARED= \ 30 | -e LIST_MOUNTS=true \ 31 | -e AM_INSTALL_ARGS=--beta=preaquatica \ 32 | $IMAGE:$TAG 33 | [ $? -ne 0 ] && echo "FAIL: docker exec failed" 34 | 35 | testDirectoriesExist $serverdir 36 | 37 | rm -rf ark-theisland 38 | } 39 | 40 | # Test if server fails to start up if it finds shared files in /arkserver 41 | function testNewSharedServerFail() { 42 | echo "====> TEST $FUNCNAME" 43 | mkdir -p ark-theisland arkserver arkclusters 44 | 45 | serverdir=ark-theisland 46 | docker run --rm -it --name $serverdir \ 47 | --env-file $serverdir.env \ 48 | -v $PWD/$serverdir:/ark \ 49 | -v $PWD/arkclusters:/arkclusters \ 50 | -v $PWD/arkserver:/arkserver \ 51 | -e LIST_MOUNTS=true \ 52 | -e AM_INSTALL_ARGS=--beta=preaquatica \ 53 | $IMAGE:$TAG 54 | [ $? -eq 0 ] && echo "FAIL: docker failure expected!" 55 | 56 | testDirectoriesExist $serverdir 57 | 58 | rm -rf ark-theisland arkserver arkclusters 59 | } 60 | # Test a server with all shared directories mounted 61 | function testNewSharedServer() { 62 | echo "====> TEST $FUNCNAME" 63 | mkdir -p ark-theisland/saved arkserver arkclusters 64 | 65 | serverdir=ark-theisland 66 | docker run --rm -it --name $serverdir \ 67 | --env-file $serverdir.env \ 68 | -v $PWD/$serverdir:/ark \ 69 | -v $PWD/$serverdir/saved:/arkserver/ShooterGame/Saved \ 70 | -v $PWD/arkclusters:/arkserver/ShooterGame/Saved/clusters \ 71 | -v $PWD/arkserver:/arkserver \ 72 | -e LIST_MOUNTS=true \ 73 | -e AM_INSTALL_ARGS=--beta=preaquatica \ 74 | $IMAGE:$TAG 75 | [ $? -ne 0 ] && echo "FAIL: docker failed!" 76 | 77 | testDirectoriesExist $serverdir 78 | 79 | rm -rf ark-theisland arkserver arkclusters 80 | } 81 | 82 | # Test a server with 'saved' being mounted, overlaying files in that location 83 | function testMigratedServer() { 84 | echo "====> TEST $FUNCNAME" 85 | mkdir -p ark-theisland arkserver arkclusters 86 | mkdir -p ark-theisland/server/ShooterGame/Binaries 87 | mkdir -p ark-theisland/server/ShooterGame/Saved/SavedArks 88 | mkdir -p ark-theisland/saved/SavedArks 89 | touch ark-theisland/server/ShooterGame/Saved/SavedArks/savegame-dead.dat 90 | touch ark-theisland/saved/SavedArks/savegame-good.dat 91 | 92 | serverdir=ark-theisland 93 | docker run --rm -it --name $serverdir \ 94 | --env-file $serverdir.env \ 95 | -v $PWD/$serverdir:/ark \ 96 | -v $PWD/$serverdir/saved:/arkserver/ShooterGame/Saved \ 97 | -v $PWD/arkclusters:/arkserver/ShooterGame/Saved/clusters \ 98 | -v $PWD/arkserver:/arkserver \ 99 | -e LIST_MOUNTS=true \ 100 | -e AM_INSTALL_ARGS=--beta=preaquatica \ 101 | $IMAGE:$TAG 102 | [ $? -ne 0 ] && echo "FAIL: docker exec failed" 103 | 104 | testDirectoriesExist $serverdir 105 | 106 | rm -rf ark-theisland arkserver arkclusters 107 | } 108 | 109 | # Test second server waiting for mods 110 | function testSharedMount() { 111 | echo "====> TEST $FUNCNAME" 112 | mkdir -p ark-theisland ark-ragnarok arkserver-persistent arkclusters 113 | mkdir -p ark-theisland/server/ShooterGame/Binaries 114 | mkdir -p ark-theisland/saved/SavedArks 115 | touch ark-theisland/saved/SavedArks/savegame.dat 116 | mkdir -p ark-ragnarok/saved/SavedArks 117 | 118 | # run first server detached 119 | serverdir=ark-theisland 120 | docker run --rm -d --name $serverdir \ 121 | --env-file $serverdir.env \ 122 | -v $PWD/$serverdir:/ark \ 123 | -v $PWD/$serverdir/saved:/arkserver/ShooterGame/Saved \ 124 | -v $PWD/arkclusters:/arkserver/ShooterGame/Saved/clusters \ 125 | -v $PWD/arkserver-persistent:/arkserver \ 126 | -e AM_INSTALL_ARGS=--beta=preaquatica \ 127 | $IMAGE:$TAG 128 | 129 | # start the second server - it should wait for mods 130 | serverdir=ark-ragnarok 131 | docker run --rm -it --name $serverdir \ 132 | --env-file $serverdir.env \ 133 | -v $PWD/$serverdir:/ark \ 134 | -v $PWD/$serverdir/saved:/arkserver/ShooterGame/Saved \ 135 | -v $PWD/arkclusters:/arkserver/ShooterGame/Saved/clusters \ 136 | -v $PWD/arkserver-persistent:/arkserver \ 137 | -e AM_INSTALL_ARGS=--beta=preaquatica \ 138 | $IMAGE:$TAG 139 | [ $? -ne 0 ] && echo "FAIL: docker exec failed" 140 | 141 | testDirectoriesExist $serverdir 142 | 143 | rm -rf ark-theisland ark-ragnarok arkclusters 144 | } 145 | 146 | testNewSimpleServer 147 | testNewSharedServerFail 148 | testNewSharedServer 149 | testMigratedServer 150 | # optional: this downloads ARK and runs 2 servers 151 | #testSharedMount 152 | 153 | -------------------------------------------------------------------------------- /arkmanager/arkmanager.cfg: -------------------------------------------------------------------------------- 1 | # --- SYSTEM CONFIG - DO NOT TOUCH ---# 2 | arkstChannel="master" # change it to a different branch to get non-stable versions 3 | install_bindir="/usr/bin" 4 | install_libexecdir="/usr/libexec/arkmanager" 5 | install_datadir="/usr/share/arkmanager" 6 | 7 | 8 | # config SteamCMD 9 | steamcmdroot="/usr/games" # path of your steamcmd instance - change this to "/usr/games" on Debian/Ubuntu/CentOS if you have the steamcmd package installed 10 | steamcmdexec="steamcmd" # name of steamcmd executable - change this to "steamcmd" on Debian/Ubuntu/CentOS if you have the steamcmd package installed 11 | steamcmd_user="steam" # name of the system user who own steamcmd folder 12 | steamcmd_appinfocache="/home/steam/.steam/appcache/appinfo.vdf" # cache of the appinfo command 13 | steamcmd_workshoplog="/home/steam/.steam/logs/workshop_log.txt" # Steam workshop log 14 | 15 | # config environment 16 | arkserverroot="/ark/server" # path of your ARK server files (default ~/ARK) 17 | arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of ARK server executable 18 | arkbackupdir="/ark/backup" # path to backup directory 19 | arkwarnminutes="60" # number of minutes to warn players when using update --warn 20 | arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file 21 | arkStagingDir="/ark/staging" 22 | 23 | # Port config 24 | ark_Port="7778" # ARK server port (default 7778) 25 | ark_QueryPort="27016" # ARK query port (default 27016) 26 | ark_RCONEnabled="True" # Enable RCON Protocol 27 | ark_RCONPort="32330" # RCON Port 28 | 29 | # Update warning messages 30 | # Modify as desired, putting the %d replacement operator where the number belongs 31 | msgWarnUpdateMinutes="This ARK server will shutdown for an update in %d minutes" 32 | msgWarnUpdateSeconds="This ARK server will shutdown for an update in %d seconds" 33 | msgWarnRestartMinutes="This ARK server will shutdown for a restart in %d minutes" 34 | msgWarnRestartSeconds="This ARK server will shutdown for a restart in %d seconds" 35 | msgWarnShutdownMinutes="This ARK server will shutdown in %d minutes" 36 | msgWarnShutdownSeconds="This ARK server will shutdown in %d seconds" 37 | msgWarnCancelled="Restart cancelled by player request" 38 | 39 | # Restart cancel chat command 40 | #chatCommandRestartCancel="/cancelupdate" 41 | 42 | # ARK server common options - use ark_= 43 | # comment out these values if you want to define them 44 | # inside your GameUserSettings.ini file 45 | serverMap="TheIsland" # server map (default TheIsland) 46 | #serverMapModId="469987622" # Uncomment this to specify the Map Mod Id ( in http://steamcommunity.com/sharedfiles/filedetails/?id=) 47 | #ark_TotalConversionMod="496735411" # Uncomment this to specify a total-conversion mod 48 | ark_RCONEnabled="True" # Enable RCON Protocol 49 | ark_ServerPassword="" # ARK server password, empty: no password required to login 50 | ark_ServerAdminPassword="k3yb04rdc4t" # ARK server admin password, KEEP IT SAFE! 51 | ark_MaxPlayers="70" 52 | #ark_GameModIds="487516323,487516324,487516325" # Uncomment to specify additional mods by Mod Id separated by commas 53 | #ark_AltSaveDirectoryName="SotF" # Uncomment to specify a different save directory name 54 | arkflag_log="" 55 | 56 | # ----- Mods ----- # 57 | #ark_GameModIds="487516323,487516324,487516325" # Uncomment to specify additional mods by Mod Id separated by commas 58 | # Mod OS Selection 59 | mod_branch=Windows 60 | # Add mod-specific OS selection below: 61 | #mod_branch_496735411=Windows 62 | # ----------------# 63 | 64 | # ARK server flags - use arkflag_=true 65 | #arkflag_OnlyAdminRejoinAsSpectator=true # Uncomment to only allow admins to rejoin as spectator 66 | #arkflag_DisableDeathSpectator=true # Uncomment to disable players from becoming spectators when they die 67 | 68 | # ARK server options - i.e. for -optname=val, use arkopt_optname=val 69 | #arkopt_StructureDestructionTag=DestroySwampSnowStructures 70 | 71 | # config Service 72 | servicename="arkserv" # Name of the service (don't change if you don't know what are you doing) 73 | logdir="/ark/log/" # Logs path (default /var/log/arktools) 74 | 75 | # steamdb specific 76 | appid=376030 # Linux server App ID 77 | mod_appid=346110 # App ID for mods 78 | 79 | # Need to be true to work with UPDATEPONSTART (See #10) 80 | arkAutoUpdateOnStart="true" # set this to true if you want to always update before startup 81 | 82 | defaultinstance="main" 83 | configfile_main="/ark/config/arkmanager.cfg" 84 | 85 | # We don't use the dots because it doesn't show. 86 | progressDisplayType=spinner -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Define directories 4 | SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | REPODIR="$(dirname "$SCRIPTDIR")" 6 | ARKSERVER=${ARKSERVER_SHARED:-"/ark/server"} 7 | # optional args for arkmanager 8 | AM_INSTALL_ARGS=${AM_INSTALL_ARGS:=""} 9 | AM_UPDATE_ARGS=${AM_UPDATE_ARGS:=""} 10 | 11 | # Always fail script if a command fails 12 | set -eo pipefail 13 | 14 | echo "###########################################################################" 15 | echo "# Ark Server - " `date` 16 | echo "###########################################################################" 17 | 18 | # Determine if the user has root or sudo privileges 19 | if sudo -n true 2>/dev/null; then 20 | HAS_PRIVILEGES="true" 21 | echo "Detected sudo capable user... Continuing..." 22 | else 23 | HAS_PRIVILEGES="false" 24 | echo "Detected user that is not sudo-capable, Continuing without sudo..." 25 | fi 26 | 27 | # Ensure correct file permissions (checking ownership) only if root/sudo is available 28 | if [ "$HAS_PRIVILEGES" = "true" ]; then 29 | echo "Ensuring correct permissions..." 30 | sudo find /ark -not -user steam -o -not -group steam -exec chown -v steam:steam {} \; 31 | sudo find /home/steam -not -user steam -o -not -group steam -exec chown -v steam:steam {} \; 32 | else 33 | echo "Skipping permission fix as root or sudo privileges are not available." 34 | fi 35 | 36 | if [ -n "$ARKSERVER_SHARED" ]; then 37 | # Directory created when something is mounted to 'Saved' 38 | if [ "$HAS_PRIVILEGES" = "true" ] && [ -d "$ARKSERVER_SHARED/ShooterGame" ]; then 39 | sudo chown steam:steam $ARKSERVER_SHARED/ShooterGame 40 | fi 41 | echo "Shared server files in $ARKSERVER_SHARED..." 42 | 43 | # Ensure the Saved directory is mounted properly 44 | if [ -z "$(mount | grep "on $ARKSERVER_SHARED/ShooterGame/Saved ")" ]; then 45 | echo "===> ABORT !" 46 | echo "You seem to be using a shared server directory: '$ARKSERVER_SHARED'" 47 | echo "But you have NOT mounted your game instance saved directory to '$ARKSERVER_SHARED/ShooterGame/Saved'" 48 | exit 1 49 | fi 50 | 51 | # Shared server files do not support staging directory 52 | export am_arkStagingDir= 53 | fi 54 | 55 | # Cluster setup 56 | if [ "$ARKCLUSTER" = "true" ]; then 57 | if [ "$HAS_PRIVILEGES" = "true" ] && [ -d "$ARKSERVER/ShooterGame/Saved" ]; then 58 | sudo chown steam:steam $ARKSERVER/ShooterGame/Saved 59 | fi 60 | echo "Shared clusters files in $ARKSERVER/ShooterGame/Saved/clusters..." 61 | if [ -z "$(mount | grep "on $ARKSERVER/ShooterGame/Saved/clusters ")" ]; then 62 | echo "===> ABORT !" 63 | echo "You seem to using ARKCLUSTER=true" 64 | echo "But you have NOT mounted your shared clusters directory to '$ARKSERVER/ShooterGame/Saved/clusters'" 65 | exit 1 66 | fi 67 | fi 68 | 69 | # Remove arkmanager tracking files if they exist 70 | # They can cause issues with starting the server multiple times 71 | # due to the restart command not completing when the container exits 72 | echo "Cleaning up any leftover arkmanager files..." 73 | [ -f $ARKSERVER/ShooterGame/Saved/.ark-warn-main.lock ] && rm -rf $ARKSERVER/ShooterGame/Saved/.ark-warn-main.lock 74 | [ -f $ARKSERVER/ShooterGame/Saved/.ark-update.lock ] && rm -rf $ARKSERVER/ShooterGame/Saved/.ark-update.lock 75 | [ -f $ARKSERVER/ShooterGame/Saved/.ark-update.time ] && rm -rf $ARKSERVER/ShooterGame/Saved/.ark-update.time 76 | [ -f $ARKSERVER/ShooterGame/Saved/.arkmanager-main.pid ] && rm -rf $ARKSERVER/ShooterGame/Saved/.arkmanager-main.pid 77 | [ -f $ARKSERVER/ShooterGame/Saved/.arkserver-main.pid ] && rm -rf $ARKSERVER/ShooterGame/Saved/.arkserver-main.pid 78 | [ -f $ARKSERVER/ShooterGame/Saved/.autorestart ] && rm -rf $ARKSERVER/ShooterGame/Saved/.autorestart 79 | [ -f $ARKSERVER/ShooterGame/Saved/.autorestart-main ] && rm -rf $ARKSERVER/ShooterGame/Saved/.autorestart-main 80 | 81 | # Create necessary directories if they don't exist 82 | [ ! -d /ark/config ] && mkdir /ark/config 83 | [ ! -d /ark/log ] && mkdir /ark/log 84 | [ ! -d /ark/backup ] && mkdir /ark/backup 85 | [ ! -d /ark/staging ] && mkdir /ark/staging 86 | 87 | if [ ! -d $ARKSERVER/ShooterGame/Binaries ]; then 88 | echo "No game files found. Preparing for install..." 89 | mkdir -p $ARKSERVER/ShooterGame 90 | mkdir -p $ARKSERVER/ShooterGame/Saved/Config/LinuxServer 91 | mkdir -p $ARKSERVER/ShooterGame/Saved/$am_ark_AltSaveDirectoryName 92 | mkdir -p $ARKSERVER/ShooterGame/Content/Mods 93 | mkdir -p $ARKSERVER/ShooterGame/Binaries/Linux/ 94 | fi 95 | 96 | echo "Creating arkmanager.cfg from environment variables..." 97 | echo -e "# Ark Server Tools - arkmanager config\n# Generated from container environment variables\n\n" > /ark/config/arkmanager.cfg 98 | if [ -f /ark/config/arkmanager_base.cfg ]; then 99 | cat /ark/config/arkmanager_base.cfg >> /ark/config/arkmanager.cfg 100 | fi 101 | 102 | echo -e "\n\narkserverroot=\"$ARKSERVER\"\n" >> /ark/config/arkmanager.cfg 103 | printenv | sed -n -r 's/am_(.*)=(.*)/\1=\"\2\"/ip' >> /ark/config/arkmanager.cfg 104 | 105 | if [ ! -w /var/spool/cron/crontabs/ ]; then 106 | echo "Hardened filesystem detect, cannot setup Crontab..." 107 | else 108 | 109 | if [ ! -f /ark/config/crontab ]; then 110 | echo "No crontab found, Creating crontab..." 111 | cat << EOF >> /ark/config/crontab 112 | # Example of job definition: 113 | # .---------------- minute (0 - 59) 114 | # | .------------- hour (0 - 23) 115 | # | | .---------- day of month (1 - 31) 116 | # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... 117 | # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat 118 | # | | | | | 119 | # * * * * * user-name command to be executed 120 | 121 | # Examples for Ark: 122 | # 0 * * * * arkmanager update # update every hour 123 | # */15 * * * * arkmanager backup # backup every 15min 124 | # 0 0 * * * arkmanager backup # backup every day at midnight 125 | */30 * * * * arkmanager update --update-mods --warn --saveworld 126 | 10 */8 * * * arkmanager saveworld && arkmanager backup 127 | 15 10 * * * arkmanager restart --warn --saveworld 128 | 129 | EOF 130 | fi 131 | 132 | # If there is uncommented line in the file 133 | CRONNUMBER=`grep -v "^#" /ark/config/crontab | wc -l` 134 | if [ $CRONNUMBER -gt 0 ]; then 135 | if [ "$HAS_PRIVILEGES" = "false" ]; then 136 | echo "Starting cron in background as non-root..." 137 | cron && tail -f /dev/null 138 | else 139 | echo "Starting cron service..." 140 | sudo service cron start 141 | fi 142 | 143 | echo "Loading crontab..." 144 | # We load the crontab file if it exist. 145 | crontab /ark/config/crontab 146 | 147 | else 148 | echo "No crontab set." 149 | fi 150 | fi 151 | 152 | # Create symlinks for configs 153 | [ -f /ark/config/AllowedCheaterSteamIDs.txt ] && ln -sf /ark/config/AllowedCheaterSteamIDs.txt $ARKSERVER/ShooterGame/Saved/AllowedCheaterSteamIDs.txt 154 | [ -f /ark/config/Engine.ini ] && ln -sf /ark/config/Engine.ini $ARKSERVER/ShooterGame/Saved/Config/LinuxServer/Engine.ini 155 | [ -f /ark/config/Game.ini ] && ln -sf /ark/config/Game.ini $ARKSERVER/ShooterGame/Saved/Config/LinuxServer/Game.ini 156 | [ -f /ark/config/GameUserSettings.ini ] && ln -sf /ark/config/GameUserSettings.ini $ARKSERVER/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini 157 | 158 | if [ "$VALIDATE_SAVE_EXISTS" = "true" -a ! -z "$am_serverMap" ]; then 159 | savepath="$ARKSERVER/ShooterGame/Saved/$am_ark_AltSaveDirectoryName" 160 | savefile="$am_serverMap.ark" 161 | echo "Validating that a save file exists for $am_serverMap" 162 | echo "Checking $savepath" 163 | if [! -f "$savepath/$savefile" ]; then 164 | echo "$savefile not found!" 165 | echo "Attempting to notify via Discord..." 166 | arkmanager notify "Critical error: unable to find $savefile in $savepath!" 167 | 168 | # wait on failure so we don't spam docker logs 169 | sleep 5m 170 | exit 1 171 | else 172 | echo "$savefile found." 173 | fi 174 | else 175 | echo "Save file validation is not enabled." 176 | fi 177 | 178 | if [ "$BACKUP_ONSTART" = "true" ]; then 179 | echo "Backing up on start..." 180 | arkmanager backup 181 | else 182 | echo "Backup on start is not enabled." 183 | fi 184 | 185 | function stop { 186 | arkmanager broadcast "Server is shutting down" 187 | arkmanager notify "Server is shutting down" 188 | arkmanager stop 189 | exit 0 190 | } 191 | 192 | # Stop server in case of signal INT, QUIT or TERM 193 | # enable job control to catch signals 194 | set -m 195 | trap stop INT QUIT TERM 196 | 197 | # log from RCON to stdout 198 | if [ $LOG_RCONCHAT -gt 0 ]; then 199 | bash -c ./log.sh & 200 | fi 201 | 202 | if [ "$LIST_MOUNTS" = "true" ]; then 203 | echo "LIST Mounts:" 204 | echo "ARKSERVER_SHARED=$ARKSERVER_SHARED ARKCLUSTER=$ARKCLUSTER" 205 | for d in /ark $ARKSERVER_SHARED $ARKSERVER/ShooterGame/Saved/ $ARKSERVER/ShooterGame/Saved/SavedArks; do 206 | echo "--> $d" 207 | ls -la $d 208 | done 209 | if [ "$ARKCLUSTER" = "true" ]; then 210 | echo "--> $ARKSERVER/ShooterGame/Saved/clusters" 211 | ls -la $ARKSERVER/ShooterGame/Saved/clusters 212 | fi 213 | mount | grep "on /ark" 214 | exit 0 215 | fi 216 | 217 | if [ "$am_arkAutoUpdateOnStart" != "true" ]; then 218 | echo -n "Waiting for ARK server to be updated: " 219 | while (! arkmanager checkupdate); do 220 | echo -n "." 221 | sleep 10 222 | done 223 | echo 224 | 225 | if [ -n "$am_ark_GameModIds" ]; then 226 | echo -n "Waiting for mods to be updated: " 227 | # requires arkmanager >= v1.6.62 228 | while (arkmanager checkmodupdate --skip-workshop-dir); do 229 | echo -n "." 230 | sleep 10 231 | done 232 | echo 233 | fi 234 | fi 235 | 236 | # fix for broken steamcmd app_info_print: execute install/update manually, checking for updates fails. 237 | # https://github.com/ValveSoftware/steam-for-linux/issues/9683#issuecomment-1826928761 238 | if [ ! -f "$ARKSERVER/steamapps/appmanifest_376030.acf" ]; then 239 | arkmanager install ${AM_INSTALL_ARGS} 240 | elif [ "$am_arkAutoUpdateOnStart" = "true" ]; then 241 | arkmanager update --force --no-autostart ${AM_UPDATE_ARGS} 242 | fi 243 | 244 | # run in subshell, so it does not trap signals 245 | (arkmanager start --no-background --verbose) & 246 | arkmanpid=$! 247 | wait $arkmanpid 248 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CircleCI](https://img.shields.io/circleci/build/github/SickHub/arkserver)](https://app.circleci.com/pipelines/github/SickHub/arkserver) 2 | [![Docker image](https://img.shields.io/docker/image-size/drpsychick/arkserver?sort=date)](https://hub.docker.com/r/drpsychick/arkserver/tags) 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/drpsychick/arkserver.svg?style=flat-square)](https://hub.docker.com/r/drpsychick/arkserver/) 4 | [![License](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](https://github.com/drpsychick/arkserver/blob/master/LICENSE) 5 | 6 | [![GitHub issues](https://img.shields.io/github/issues/SickHub/arkserver.svg)](https://github.com/SickHub/arkserver/issues) 7 | [![GitHub closed issues](https://img.shields.io/github/issues-closed/SickHub/arkserver.svg)](https://github.com/SickHub/arkserver/issues?q=is%3Aissue+is%3Aclosed) 8 | [![GitHub pull requests](https://img.shields.io/github/issues-pr/SickHub/arkserver.svg)](https://github.com/SickHub/arkserver/pulls) 9 | [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/SickHub/arkserver.svg)](https://github.com/SickHub/arkserver/pulls?q=is%3Apr+is%3Aclosed) 10 | [![Contributors](https://img.shields.io/github/contributors/SickHub/arkserver.svg)](https://github.com/SickHub/arkserver/graphs/contributors) 11 | [![Paypal](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FTXDN7LCDWUEA&source=url) 12 | [![GitHub Sponsor](https://img.shields.io/badge/github-sponsor-blue?logo=github)](https://github.com/sponsors/DrPsychick) 13 | 14 | # Docker image `drpsychick/arkserver` 15 | Docker image for a dedicated ARK Survival Evolved server with arkmanager. 16 | 17 | **UPDATE August 2022**: I cloned this repo and split from the original, because my PR was never accepted. 18 | The original is here: [thmhoag/arkserver](https://github.com/thmhoag/arkserver). 19 | 20 | ## Overview 21 | 22 | This is an image for running an ARK: Survival Evolved server in a Docker container. 23 | It is heavily based off of [TuRz4m](https://github.com/TuRz4m)'s work located here: [TuRz4m/Ark-docker](https://github.com/TuRz4m/Ark-docker). 24 | It uses [FezVrasta](https://github.com/FezVrasta)'s [arkmanager/ark-server-tools](https://github.com/arkmanager/ark-server-tools) 25 | to manage single-instances or a cluster of ARK: Survival Evolved server inside a docker containers. 26 | 27 | This image builds on the [drpsychick/steamcmd](https://github.com/drpsychick/steamcmd) image to include the latest version of `steamcmd`. 28 | 29 | For more information on `arkmanager`, see the repo here: [arkmanager/ark-server-tools](https://github.com/arkmanager/ark-server-tools). 30 | 31 | ### Features 32 | * Automated install (pull the image and run, no additional commands necessary) 33 | * Configuration via Environment Variables 34 | * Easy crontab manipulation for automated backups, updates, daily restarts, weekly dino wipes, etc 35 | * Simple volume structure for server files, config, logs, backups, etc 36 | * Inherently includes all features present in `arkmanager` 37 | 38 | ### Tags 39 | | Tag | Description | 40 | |----------------|------------------------------------------| 41 | | latest | most recent build from the master branch | 42 | | x.x.x (semver) | release builds | 43 | 44 | ## Usage 45 | 46 | ### Installing the image 47 | 48 | Pull the latest (or any other desired version): 49 | ```bash 50 | docker pull drpsychick/arkserver:latest 51 | ``` 52 | 53 | ### Running the server 54 | 55 | To run a generic server with no configuration modifications: 56 | ```bash 57 | $ docker run -d \ 58 | -v steam:/home/steam/.steam/steamapps \ # mounted so that workshop (mod) downloads are persisted 59 | -v ark:/ark \ # mounted as the directory to contain the server/backup/log/config files 60 | -p 27015:27015 -p 27015:27015/udp \ # steam query port 61 | -p 7778:7778 -p 7778:7778/udp \ # gameserver port 62 | -p 7777:7777 -p 7777:7777/udp \ # gameserver port 63 | drpsychick/arkserver 64 | ``` 65 | 66 | If the exposed ports are modified (in the case of multiple containers/servers on the same host) the `arkmanager` config will need to be modified to reflect the change as well. This is required so that `arkmanager` can properly check the server status and so that the ARK server itself can properly publish its IP address and query port to steam. 67 | 68 | ## Environment Variables 69 | 70 | A set of required environment variables have default values provided as part of the image: 71 | 72 | | Variable | Value | Description | 73 | |----------------------------|---------------|------------------------------------------------------------------------------| 74 | | am_ark_SessionName | `Ark Server` | Server name as it will show on the steam server list | 75 | | am_serverMap | `TheIsland` | Game map to load | 76 | | am_ark_ServerAdminPassword | `k3yb04rdc4t` | Admin password to be used via ingame console or RCON | 77 | | am_ark_MaxPlayers | `70` | Max concurrent players in the game | 78 | | am_ark_QueryPort | `27015` | Steam query port (allows the server to show up on the steam list) | 79 | | am_ark_Port | `7778` | Game server port (allows clients to connect to the server) | 80 | | am_ark_RCONPort | `32330` | RCON port | 81 | | am_arkwarnminutes | `15` | Number of minutes to wait/warn players before updating/restarting | 82 | | am_arkflag_crossplay | `false` | Allow crossyplay with Players on Epic | 83 | | ARKCLUSTER | `false` | If true, requires `ShooterGame/Saved/clusters` to be mounted | 84 | | ARKSERVER_SHARED | | To optionally share server binary files, use `/arkserver` volume, see below | 85 | | LOG_RCONCHAT | `0` | Fetch chat commands every X seconds and log them to stdout, `0` = disabled | 86 | | AM_INSTALL_ARGS | | Optional arguments to `arkmanager install`, for example `--beta=preaquatica` | 87 | | AM_UPDATE_ARGS | | Optional arguments to `arkmanager update` | 88 | 89 | ### Adding Additional Variables 90 | 91 | Any configuration value that is available via `arkmanager` can be set using an environment variable. This works by taking any environment variable on the container that is prefixed with `am_` and mapping it to the corresponding environment variable in the `arkmanager.cfg` file. 92 | 93 | For a complete list of configuration values available, please see [FezVrasta](https://github.com/arkmanager)'s great documentation here: [arkmanager Configuration Files](https://github.com/arkmanager/ark-server-tools#configuration-files) 94 | 95 | Some examples: 96 | ```shell script 97 | am_ark_ServerPassword=s3cr3t 98 | am_ark_GameModIds=889745138,731604991 99 | am_arkopt_clusterid=mycluster 100 | am_arkflag_NoTransferFromFiltering= 101 | am_arkflag_servergamelog= 102 | am_arkflag_ForceAllowCaveFlyers= 103 | ``` 104 | 105 | ## Volumes 106 | 107 | This image has two main volumes that should be mounted as named volumes or host directories for the persistence of the server install and all related configuration files. More information on Docker volumes here: [Docker: Use Volumes](https://docs.docker.com/storage/volumes/) 108 | The optional volumes can be used to share the server binary files or `clusters` files required to run an ARK cluster and be able to jump from one map to another. 109 | 110 | > [!IMPORTANT] 111 | > The `steam` user in the image has UID/GID 1001/1001. All files on the host must give read/write access to this UID/GID. 112 | 113 | | Path | Description | 114 | |---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| 115 | | /home/steam/.steam/steamapps | Directory of steamapps and workshop files. Should be mounted so that mod installs are persisted between container runs/restarts | 116 | | /ark | Directory that will contain the server files, config files, logs and backups. More information below | 117 | | /arkserver | (optional, $ARKSERVER_SHARED) Directory that contains the server binary files from steam, shared for multiple instances | 118 | | /arkserver/ShooterGame/Saved | (depends) Directory that contains the game save files - must be mounted if using shared server files | 119 | | /arkserver/ShooterGame/Saved/clusters | (depends) Directory that contains the shared cluster files required to jump from one ARK server to another - must be mounted if using shared server files | 120 | 121 | ### Subdirectories of /ark 122 | 123 | Inside the `/ark` volume there are several directories containing server related files: 124 | 125 | | Path | Description | 126 | |--------------|------------------------------------------------------------------------------------------------------------------------------------------| 127 | | /ark/backup | Location of the zipped backups genereated from the `arkmaanger backup` command. Compressed using bz2. | 128 | | /ark/config | Location of server config files. More information: | 129 | | /ark/log | Location of the arkmanager and arkserver log files | 130 | | /ark/server | Location of the server installation performed by `steamcmd`. This will contain the ShooterGame directory and the actual server binaries. | 131 | | /ark/staging | Default directory for staging game and mod updates. Can be changed using in `arkmanager.cfg` | 132 | 133 | ## Running a cluster 134 | In order to run an ARK cluster, all you need are multiple servers sharing the `clusters` directory and using a shared, 135 | unique `clusterid` - and a lot of RAM. 136 | Additionally you can share the server files, so that all servers use the same version and you don't have to 137 | store identical files twice on disk. 138 | 139 | Example: (using the .env files in `/test`) 140 | ```shell script 141 | IMAGE=drpsychick/arkserver 142 | TAG=bionic 143 | mkdir -p theisland ragnarok arkserver arkclusters theisland/saved ragnarok/saved 144 | 145 | # start server 1 with am_arkAutoUpdateOnStart=true 146 | serverdir=theisland 147 | docker run --rm -it --name $serverdir \ 148 | --env-file test/ark-$serverdir.env \ 149 | -v $PWD/$serverdir:/ark \ 150 | -v $PWD/$serverdir/saved:/arkserver/ShooterGame/Saved \ 151 | -v $PWD/arkclusters:/arkserver/ShooterGame/Saved/clusters \ 152 | -v $PWD/arkserver:/arkserver \ 153 | -p 27015:27015/udp -p 7778:7778/udp -p 32330:32330 \ 154 | $IMAGE:$TAG 155 | 156 | # wait for the server to be up, it should download all mods and the game 157 | 158 | # start server 2+ with am_arkAutoUpdateOnStart=false 159 | # using the SAME `arkserver` and `arkclusters` directory 160 | serverdir=ragnarok 161 | docker run --rm -it --name $serverdir \ 162 | --env-file test/ark-$serverdir.env \ 163 | -v $PWD/$serverdir:/ark \ 164 | -v $PWD/$serverdir/saved:/arkserver/ShooterGame/Saved \ 165 | -v $PWD/arkclusters:/arkserver/ShooterGame/Saved/clusters \ 166 | -v $PWD/arkserver:/arkserver \ 167 | -p 27016:27016/udp -p 7780:7780/udp -p 32331:32331 \ 168 | $IMAGE:$TAG 169 | 170 | # now you can reach your servers on 27015 and 27016 respectively 171 | 172 | # cleanup 173 | rm -rf theisland ragnarok arkserver arkclusters 174 | ``` 175 | 176 | To test jumping from one server to another: 177 | * join one server, enable cheats with `enablecheats ` 178 | * cheat your character the transmitter tek engram `cheat GiveTekengramsTo transmitter` 179 | * cheat your character a transmitter item `cheat gfi TekTransmitter 1 1 0` 180 | * place the transmitter, turn it on, enter the inventory -> you should see "travel to another server" button in the middle 181 | * click it and select the server you want to travel to 182 | 183 | The `survivorID` is the number displayed when you hover over the specimen implant (diamond shaped item) 184 | you always have (https://ark.fandom.com/wiki/Specimen_Implant). 185 | --------------------------------------------------------------------------------