Run Enshrouded dedicated server in a container. Optionally includes helm chart for running in Kubernetes.
Disclaimer: This is not an official image. No support, implied or otherwise is offered to any end user by the author or anyone else. Feel free to do what you please with the contents of this repo.
The processes within the container do NOT run as root. Everything runs as the user steam (gid:10000/uid:10000 by default). If you exec into the container, you will drop into /home/steam as the steam user. Enshrouded will be installed to /home/steam/enshrouded. Any persistent volumes should be mounted to /home/steam/enshrouded/savegame and be owned by 10000:10000.
If you absolutely require to run the process in the container as a gid/uid other than 10000, you can build your own image based on my dockerfile. Instructions are covered Here
| Port | Protocol | Default |
|---|---|---|
| Query Port | UDP | 15637 |
| Steam Port | UDP | 27015 |
| Name | Description | Default | Required |
|---|---|---|---|
| SERVER_NAME | Name for the Server | Enshrouded Containerized | False |
| SERVER_PASSWORD | Password for the server | None | False |
| PORT | Game port | 15637 | False |
| STEAM_PORT | Port used for Steam query | 27015 | False |
| SERVER_SLOTS | Number of slots for connections (Max 16) | 16 | False |
| SERVER_IP | IP address for server to listen on | 0.0.0.0 | False |
| EXTERNAL_CONFIG | If you would rather manually supply a config file, set this to true (1) | 0 | False |
Note: SERVER_IP is ignored if using Helm because that isn't how Kubernetes works.
docker-compose-external.yml copys enshrouded_server_extenal.json into container to replace the default config file to make it simpler to change all of the sever settings and user groups more info on settings here
To run the container in Docker, run the following command:
docker volume create enshrouded-persistent-data
docker run \
--detach \
--name enshrouded-server \
--mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
--publish 15637:15637/udp \
--publish 27015:27015/udp \
--env=SERVER_NAME='Enshrouded Containerized Server' \
--env=SERVER_SLOTS=16 \
--env=SERVER_PASSWORD='ChangeThisPlease' \
--env=PORT=15637 \
sknnr/enshrouded-dedicated-server:latestTo use Docker Compose, either clone this repo or copy the compose.yaml file out of the container directory to your local machine. Edit the compose file to change the environment variables to the values you desire and then save the changes. Once you have made your changes, from the same directory that contains the compose and the env files, simply run:
docker-compose up -dTo bring the container down:
docker-compose downcompose.yaml file:
version: "3"
services:
enshrouded:
image: sknnr/enshrouded-dedicated-server:latest
ports:
- "15637:15637/udp"
- "27015:27015/udp"
environment:
- SERVER_NAME=Enshrouded Containerized
- SERVER_PASSWORD=PleaseChangeMe
- PORT=15637
- SERVER_SLOTS=16
- SERVER_IP=0.0.0.0
volumes:
- enshrouded-persistent-data:/home/steam/enshrouded/savegame
volumes:
enshrouded-persistent-data:to use the external config compose file
docker-compose -f docker-compose-external-config.yaml up -dTo bring the container down:
docker-compose -f docker-compose-external-config.yaml downcompose.yaml file:
services:
enshrouded:
image: sknnr/enshrouded-dedicated-server:latest
ports:
- "15637:15637/udp"
environment:
- EXTERNAL_CONFIG=1
volumes:
- 'enshrouded-persistent-data:/home/steam/enshrouded/savegame'
- ./enshrouded_server_extenal.json:/home/steam/enshrouded/enshrouded_server.json #replaces defaut configuration file
restart: unless-stopped
volumes:
enshrouded-persistent-data:
# to set up a persistent volume, you can use the local driver with a bind mount
# Uncomment the following lines to use a local directory for persistent data storage
# Note: Ensure the path exists on your host machine before starting the container
# driver: local
# driver_opts:
# type: none
# device: /path/to/your/host/directory # Change this to your desired host directory
# o: bind # This volume is bound to the host directory for persistent data storageTo run the container in Podman, run the following command:
podman volume create enshrouded-persistent-data
podman run \
--detach \
--name enshrouded-server \
--mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
--publish 15637:15637/udp \
--publish 27015:27015/udp \
--env=SERVER_NAME='Enshrouded Containerized Server' \
--env=SERVER_SLOTS=16 \
--env=SERVER_PASSWORD='ChangeThisPlease' \
--env=PORT=15637 \
docker.io/sknnr/enshrouded-dedicated-server:latestTo run the container with Podman's new quadlet subsystem, make a file under (when running as root) /etc/containers/systemd/enshrouded.container containing:
[Unit]
Description=Enshrouded Game Server
[Container]
Image=docker.io/sknnr/enshrouded-dedicated-server:latest
Volume=enshrouded-persistent-data:/home/steam/enshrouded/savegame
PublishPort=15637:15637/udp
PublishPort=27015:27015/udp
ContainerName=enshrouded-server
Environment=SERVER_NAME="Enshrouded Containerized Server"
Environment=SERVER_PASSWORD="ChangeThisPlease"
Environment=PORT=15637
Environment=SERVER_SLOTS=16
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target
I've built a Helm chart and have included it in the helm directory within this repo. Modify the values.yaml file to your liking and install the chart into your cluster. Be sure to create and specify a namespace as I did not include a template for provisioning a namespace.
The chart in this repo is also hosted in my helm-charts repository here
To install this chart from my helm-charts repository:
helm repo add jsknnr https://jsknnr.github.io/helm-charts
helm repo updateTo install the chart from the repo:
helm install enshrouded jsknnr/enshrouded-dedicated-server --values myvalues.yaml
# Where myvalues.yaml is your copy of the Values.yaml file with the settings that you wantIf you are having issues connecting to the server once the container is deployed, I promise the issue is not with this image. You need to make sure that the ports 15636 and 15637 (or whichever ones you decide to use) are open on your router as well as the container host where this container image is running. You will also have to port-forward the game-port and query-port from your router to the private IP address of the container host where this image is running. After this has been done correctly and you are still experiencing issues, your internet service provider (ISP) may be blocking the ports and you should contact them to troubleshoot.
For additional help, refer to this closed issue where some folks were able to debug their issues. It may be of help.
#16
I recommend having Docker or Podman manage the volume that gets mounted into the container. However, if you absolutely must bind mount a directory into the container you need to make sure that on your container host the directory you are bind mounting is owned by 10000:10000 by default (chown -R 10000:10000 /path/to/directory). If the ownership of the directory is not correct the container will not start as the server will be unable to persist the savegame.