Sign inSign up

silentmecha/7dtd

By silentmecha

Updated over 1 year ago

7 Days to die server on linux inside of Docker

Image
0

10K+

silentmecha/7dtd repository overview

Docker Pulls Image Size Buy Me a Coffee

silentmecha/7dtd

This repository contains the files needed to build and run a Docker image for a 7 Days to Die dedicated server. This image is built on Ubuntu and is specifically designed for quickly setting up a 7 Days to Die server. It uses a customized version of steamcmd/steamcmd:ubuntu-24, which includes additional programs, environment variables, and a dedicated USER account to ensure easy server creation and consistent configuration across instances. The image is optimized for streamlined deployment and management of 7 Days to Die servers with all necessary dependencies and settings pre-configured.

Warning: The latest version on Docker Hub may be out of date. Please check the GitHub repository for the most recent updates.

Note: This image does not yet set all the settings for the server according to the ENV values. This is still a work in progress.

Usage

This stack uses an image from atmoz. To see more on the image used visit their GitHub https://github.com/atmoz/sftp.

For more info on environment variables and what they do see Environment Variables

Available Tags
  • base: Contains only the environment setup, excluding the game files.
  • latest: Includes the game files needed for the server.
Simplest Method

The simplest usage for this is using the docker-compose method to pull the latest image and run it.

git clone https://github.com/silentmecha/7dtd.git 7DaysToDie
cd 7DaysToDie
cp .env.example .env
nano .env
docker-compose pull
docker-compose up -d
Using the base tag

If you don't want to pull the entire image and don't need to keep multiple instances up to date, you can use the base tag.

git clone https://github.com/silentmecha/7dtd.git 7DaysToDie
cd 7DaysToDie
cp .env.example .env
nano .env
docker-compose -f docker-compose.base.yml up -d
Building Locally

If you prefer to build everything locally, you can start by building the base image and then the latest image.

git clone https://github.com/silentmecha/7dtd.git 7DaysToDie
cd 7DaysToDie
cp .env.example .env
nano .env
docker build -f base.Dockerfile -t silentmecha/7dtd:base -t silentmecha/7dtd:latest .
docker build -f Dockerfile -t silentmecha/7dtd:latest .
docker-compose up -d
Updating

Updating is now as simple as running a build on the Dockerfile or using docker-compose build. This will update the image without downloading all the game files again.

docker-compose build
docker-compose up -d
Environment Variables
Variable NameDefault ValueDescription
SERVERNAMEServerNameWhatever you want the name of the server to be.
SERVERPORT26900Port used to connect to the server
SERVERPORT_126901Server port + 1 ( Confirmation for the port usage to follow )
SERVERPORT_226902Server port + 2 ( Confirmation for the port usage to follow )
SERVERVISIBILITY2Visibility of this server: 2 = public, 1 = only shown to friends, 0 = not listed. As you are never friend of a dedicated server setting this to "1" will only work when the first player connects manually by IP.
SERVERPASSWORDPassword to gain entry to the server
SERVERMAXPLAYERCOUNT8Maximum Concurrent Players (8 is the maximum supported player count. Anything over 30 will cause corrupted save data.)
SERVERRESERVEDSLOTS0Out of the MaxPlayerCount this many slots can only be used by players with a specific permission level.
SERVERADMINSLOTS0This many admins can still join even if the server has reached MaxPlayerCount
SERVERDESCRIPTION"A 7 Days to Die server running inside of docker"Whatever you want the server description to be, will be shown in the server browser.
SERVERWEBSITEURLWebsite URL for the server, will be shown in the serverbrowser as a clickable link
EACENABLEDtrueEnables/Disables EasyAntiCheat
GAMEWORLDNavezgane"RWG" (see WorldGenSeed and WorldGenSize options below) or any already existing world name in the Worlds folder (currently shipping with e.g. "Navezgane", "PREGEN01", ...)
GAMENAME"My Game"Whatever you want the game name to be. This affects the save game name as well as the seed used when placing decoration (trees etc) in the world. It does not control the generic layout of the world if creating an RWG world
WORLDGENSEED"asdf"If RWG this is the seed for the generation of the new world. If a world with the resulting name already exists it will simply load it
WORLDGENSIZE4096If RWG this controls the width and height of the created world. It is also used in combination with WorldGenSeed to create the internal RWG seed thus also creating a unique map name even if using the same WorldGenSeed. Has to be between 2048 and 16384, though large map sizes will take long to generate / download / load. Must be a value of 1024, and later than 12k maps do not function for multiplayer.
PLAYERKILLINGMODE3Player Killing Settings (0 = No Killing, 1 = Kill Allies Only, 2 = Kill Strangers Only, 3 = Kill Everyone)
CONTROLPANELPORT8080Port of the control panel webpage
CONTROLPANELENABLEDtrueEnable/Disable the web control panel
CONTROLPANELPASSWORDCHANGEMEPassword to gain entry to the control panel
TELNETENABLEDtrueEnable/Disable the telnet
TELNETPORT8081Port of the telnet server
TELNETPASSWORDPassword to gain entry to telnet interface. If no password is set the server will only listen on the local loopback interface
ADDITIONAL_ARGSCurrently not used
SFT_USERfooUsername for SFTP access to edit save data
SFT_PASSpassPassword for SFTP access to edit save data
SFT_PORT2222Port for SFTP access (should not be 22 )

For more info on the usage of SFTP see here. If you do not want to use a plane text password see encrypted-password

Ports

Currently the following ports are used.

PortTypeDefault
TELNETPORTTCP8081
CONTROLPANELPORTTCP8080
SERVERPORTTCP26900
SERVERPORTUDP26900
SERVERPORT_1UDP26901
SERVERPORT_2UDP26902
SFT_PORTTCP2222

All these ports must be forwarded through your router, except for TELNETPORT, CONTROLPANELPORT, and SFT_PORT, unless you want to access the server via Telnet, use the web control panel externally, or remotely edit the save data, respectively.

License

This project is licensed under the MIT License.

If you enjoy this project and would like to support my work, consider buying me a coffee. Your support is greatly appreciated!

Tag summary

Content type

Image

Digest

sha256:e9bc5843c

Size

12 GB

Last updated

over 1 year ago

docker pull silentmecha/7dtd