├── .gitignore
├── Dockerfile
├── README.md
├── docker-compose.yml
├── entrypoint.sh
├── healthcheck.sh
└── winetricks.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | *local*
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM debian:bookworm-20241016-slim
2 |
3 | WORKDIR /root
4 |
5 | # ARG only available during build
6 | # never env DEBIAN_FRONTEND=noninteractive !!
7 | ARG DEBIAN_FRONTEND=noninteractive
8 | ARG WINEBRANCH=stable
9 | ARG WINEVERSION=9.0.0.0~bookworm-1
10 |
11 | ENV WINEARCH=win64
12 | ENV WINEDEBUG=-all
13 | ENV WINEPREFIX=/root/server
14 | ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
15 |
16 | RUN \
17 | dpkg --add-architecture i386 && \
18 | apt-get -qq -y update && \
19 | apt-get upgrade -y -qq && \
20 | apt-get install -y -qq software-properties-common curl gnupg2 wget && \
21 | # add repository keys
22 | mkdir -pm755 /etc/apt/keyrings && \
23 | wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key && \
24 | # add repositories
25 | echo "deb http://ftp.us.debian.org/debian bookworm main non-free" > /etc/apt/sources.list.d/non-free.list && \
26 | wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
27 | RUN \
28 | apt-get update -qq && \
29 | echo steam steam/question select "I AGREE" | debconf-set-selections && \
30 | echo steam steam/license note '' | debconf-set-selections && \
31 | apt-get install -qq -y \
32 | libfaudio0:i386 \
33 | libfaudio0
34 | RUN \
35 | apt-get install -qq -y --install-recommends \
36 | winehq-${WINEBRANCH}=${WINEVERSION} \
37 | wine-${WINEBRANCH}-i386=${WINEVERSION} \
38 | wine-${WINEBRANCH}-amd64=${WINEVERSION} \
39 | wine-${WINEBRANCH}=${WINEVERSION} \
40 | steamcmd \
41 | xvfb \
42 | cabextract && \
43 | curl -L https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks > /usr/local/bin/winetricks && \
44 | chmod +x /usr/local/bin/winetricks
45 |
46 | # Winetricks (This block uses most of the build time)
47 | COPY winetricks.sh /root/
48 | RUN \
49 | /root/winetricks.sh && \
50 | rm -f /root/winetricks.sh && \
51 | # Remove stuff we do not need anymore to reduce docker size
52 | apt-get remove -qq -y \
53 | gnupg2 \
54 | software-properties-common && \
55 | apt-get autoremove -qq -y && \
56 | apt-get -qq clean autoclean && \
57 | rm -rf /var/lib/{apt,dpkg,cache,log}/
58 |
59 | COPY healthcheck.sh /root/
60 | HEALTHCHECK --interval=60s --timeout=60s --start-period=600s --retries=3 CMD [ "/root/healthcheck.sh" ]
61 |
62 | COPY entrypoint.sh /root/
63 | ENTRYPOINT /root/entrypoint.sh
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Space Engineers Dedicated Debian Docker Container
2 |
3 | First of all thanks to [7thCore](https://github.com/7thCore) and [mmmaxwwwell](https://github.com/mmmaxwwwell) for their great prework making a linux dedicated server for Space Engineers real!
4 |
5 | I took parts of their projects to create this one (see credits)
6 |
7 | ## Why?
8 |
9 | I wanted to have a more cleaner docker container with less dependencies (integrate sesrv-script parts instead of wget the whole script) and a little more configuration through composer files.
10 |
11 | ## KeyFacts
12 |
13 | | Key | :latest | :winestaging |
14 | | ----------- | -------------------- | -------------------- |
15 | | OS | Debian 12 (Bookworm) | Debian 12 (Bookworm) |
16 | | Wine | 9.0~bookworm-1 | 9.9~bookworm-1 |
17 | | Docker size | ~1.82GB compressed | ~1.82GB compressed |
18 | | Build Time | ~ 19 Minutes | ~ 19 Minutes |
19 |
20 | ## How to use
21 |
22 | First you have to use the `Space Engineers Dedicated Server` Tool to setup your world.
23 |
24 | (detailed instructions follow when requested)
25 |
26 | After you have saved your world upload it (the instance directory) to your docker host machine `/appdata/space-engineers/instances/`.
27 |
28 | ## Using docker-compose with precompiled docker image (devidian/spaceengineers)
29 |
30 | Create a [docker-compose.yml](docker-compose.yml) (see example below) and execute `docker-compose up -d`
31 |
32 | Do not forget to rename `TestInstance` with your instance name!
33 |
34 | ### example composer - just copy and adjust
35 |
36 | ```yaml
37 | services:
38 | se-server:
39 | image: devidian/spaceengineers:winestaging
40 | container_name: se-ds-docker
41 | restart: unless-stopped
42 | volumes:
43 | # left side: your docker-host machine
44 | # right side: the paths in the image (!!do not change!!)
45 | - /appdata/space-engineers/plugins:/appdata/space-engineers/plugins
46 | - /appdata/space-engineers/instances:/appdata/space-engineers/instances
47 | - /appdata/space-engineers/SpaceEngineersDedicated:/appdata/space-engineers/SpaceEngineersDedicated
48 | - /appdata/space-engineers/steamcmd:/root/.steam
49 | ports:
50 | - target: 27016
51 | published: 27016
52 | protocol: udp
53 | mode: host
54 | environment:
55 | - WINEDEBUG=-all
56 | - INSTANCE_NAME=TestInstance
57 | - PUBLIC_IP=1.2.3.4
58 | # public ip required for healthcheck
59 | ```
60 |
61 | ## Build the image yourself from source
62 |
63 | Download this repository and run `docker-compose up -d`
64 |
65 | ## Use the docker image as source for your own image
66 |
67 | If you want to extend the image create a `Dockerfile` and use `FROM devidian/spaceengineers:latest`
68 |
69 | ## FAQ
70 |
71 | ### Can i use plugins?
72 |
73 | Yes just copy plugins to `/appdata/space-engineers/plugins` and they will be added or removed by the [entrypoint.sh](entrypoint.sh) script
74 |
75 | ### Can i run mods?
76 |
77 | Yes as they are saved in your world, the server will download them on the first start.
78 |
79 | ### Can i contribute?
80 |
81 | Sure, feel free to submit merge requests or issues if you have anything to improve this project. If you just have a question, use Github Discussions.
82 |
83 | ## Credits
84 |
85 | | User | repo / fork | what (s)he did for this project |
86 | | --------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------- |
87 | | [mmmaxwwwell](https://github.com/mmmaxwwwell) | https://github.com/mmmaxwwwell/space-engineers-dedicated-docker-linux | downgrading for dotnet48 |
88 | | [7thCore](https://github.com/7thCore) | https://github.com/7thCore/sesrv-script | installer bash script |
89 | | [Diego Lucas Jimenez](https://github.com/tanisdlj) | - | Improved Dockerfile |
90 | | [EthicalObligation](https://github.com/EthicalObligation) | https://github.com/EthicalObligation/docker-spaceengineers-healthcheck | Healthcheck & Quicker startup |
91 | | [draconb](https://github.com/draconb) | - | Hints for plugin support |
92 |
93 | ## Known issues
94 |
95 | - **VRage Remote Client**
96 | - I personally could not manage to connect with te remote client, if anyone gets a connection please tell me (and maybe how you fixed it) [see here](https://github.com/Devidian/docker-spaceengineers/issues/36)
97 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 |
3 | services:
4 | se-server:
5 | build: .
6 | image: spaceengineers:latest
7 | container_name: se-ds-docker
8 | restart: unless-stopped
9 | volumes:
10 | # left side: your docker-host machine
11 | # right side: the paths in the image (!!do not change!!)
12 | - /appdata/space-engineers/plugins:/appdata/space-engineers/plugins
13 | - /appdata/space-engineers/instances:/appdata/space-engineers/instances
14 | - /appdata/space-engineers/SpaceEngineersDedicated:/appdata/space-engineers/SpaceEngineersDedicated
15 | - /appdata/space-engineers/steamcmd:/root/.steam
16 | ports:
17 | - target: 27016
18 | published: 27016
19 | protocol: udp
20 | mode: host
21 | - target: 8080
22 | published: 18080
23 | protocol: tcp
24 | mode: host
25 | environment:
26 | - WINEDEBUG=-all
27 | - INSTANCE_NAME=SE
28 | - PUBLIC_IP=127.0.0.1
29 | # public ip required for healthcheck
--------------------------------------------------------------------------------
/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # VARIABLES
3 | GAME_DIR="/appdata/space-engineers/SpaceEngineersDedicated"
4 | INSTANCES_DIR="/appdata/space-engineers/instances"
5 | PLUGIN_DIR="/appdata/space-engineers/plugins"
6 | CONFIG_PATH="${INSTANCES_DIR}/${INSTANCE_NAME}/SpaceEngineers-Dedicated.cfg"
7 | INSTANCE_IP=$(hostname -I | sed "s= ==g")
8 |
9 |
10 | echo "-------------------------------INSTALL & UPDATE------------------------------"
11 | /usr/games/steamcmd +force_install_dir ${GAME_DIR} +login anonymous +@sSteamCmdForcePlatformType windows +app_update 298740 +quit
12 |
13 | echo "---------------------------------UPDATE CONFIG-------------------------------"
14 | # update IP to host external ip
15 | CURRENT_IP=$(grep -oEi '(.*)' ${CONFIG_PATH} | sed -E "s=|==g")
16 | sed -i "s=.*=${INSTANCE_IP}=g" ${CONFIG_PATH}
17 |
18 | # update world save path
19 | CURRENT_WORLDNAME=$(grep -oEi '(.*)' ${CONFIG_PATH} | sed -E "s=|==g")
20 | SAVE_PATH="Z:\\\\appdata\\\\space-engineers\\\\instances\\\\${INSTANCE_NAME}\\\\Saves\\\\${CURRENT_WORLDNAME}";
21 | sed -E -i "s=|=${SAVE_PATH}=g" ${CONFIG_PATH}
22 |
23 | echo "---------------------------------UPDATE PLUGINS------------------------------"
24 | PLUGIN_COUNT=$(ls -1 ${PLUGIN_DIR}/*.dll | wc -l)
25 | echo "Found ${PLUGIN_COUNT} plugins in ${PLUGIN_DIR}"
26 |
27 | if [ "${PLUGIN_COUNT}" -gt "0" ]; then
28 | PLUGINS_STRING="$(ls -1 /appdata/space-engineers/plugins/*.dll |\
29 | sed -E "s=(.+\.dll)=\1=g" |\
30 | tr -d "\n" )"
31 | else
32 | PLUGINS_STRING=""
33 | fi
34 |
35 | sed -E -i "s=|=${PLUGINS_STRING}=g" ${CONFIG_PATH}
36 |
37 | echo "-----------------------------CURRENT CONFIGURATION---------------------------"
38 | echo "GAME_DIR=$GAME_DIR"
39 | echo "CONFIG_PATH=$CONFIG_PATH"
40 | echo "INSTANCE_IP=$INSTANCE_IP"
41 | echo "CURRENT_IP=$CURRENT_IP"
42 | echo "CURRENT_WORLDNAME=$CURRENT_WORLDNAME"
43 | echo "SAVE_PATH=$SAVE_PATH"
44 | ## END UPDATES ##
45 | wine --version
46 | echo "----------------------------------START GAME---------------------------------"
47 | # mkdir first to fix possible no such file or directory on rm
48 | mkdir -p ${INSTANCES_DIR}/${INSTANCE_NAME}
49 | rm ${INSTANCES_DIR}/${INSTANCE_NAME}/*.log
50 | cd ${GAME_DIR}/DedicatedServer64/
51 | wine SpaceEngineersDedicated.exe -noconsole -ignorelastsession -path Z:\\appdata\\space-engineers\\instances\\${INSTANCE_NAME}
52 | echo "-----------------------------------END GAME----------------------------------"
53 | sleep 1
54 | echo "-----------------------------------BYE !!!!----------------------------------"
--------------------------------------------------------------------------------
/healthcheck.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if curl https://api.steampowered.com/ISteamApps/GetServersAtAddress/v1?addr=${PUBLIC_IP} -qq | grep Space -q
4 | then
5 | exit 0
6 | else
7 | exit 1
8 | fi
--------------------------------------------------------------------------------
/winetricks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # As docker can only run one process we have to use this script to get Xvfb running while calling winetricks stuff
4 | Xvfb :5 -screen 0 1024x768x16 &
5 | env WINEARCH=win64 WINEDEBUG=-all WINEPREFIX=/root/server WINEDLLOVERRIDES="mscoree=d" wineboot --init /nogui
6 | env WINEARCH=win64 WINEDEBUG=-all WINEPREFIX=/root/server wine winecfg /v win10
7 | env WINEARCH=win64 WINEDEBUG=-all WINEPREFIX=/root/server winetricks corefonts
8 | env WINEARCH=win64 WINEDEBUG=-all WINEPREFIX=/root/server winetricks sound=disabled
9 | env WINEARCH=win64 WINEDEBUG=-all WINEPREFIX=/root/server DISPLAY=:5.0 winetricks -q vcrun2019
10 | env WINEARCH=win64 WINEDEBUG=-all WINEPREFIX=/root/server DISPLAY=:5.0 winetricks -q --force dotnet48
--------------------------------------------------------------------------------