7 Days to Die Server with Docker in 7 Simple Steps

7 days to die with Docker

Are you ready to immerse yourself in the zombie-infested world of 7 Days to Die with your friends? Setting up a dedicated server can seem daunting, but with Docker, it becomes a breeze. This guide will walk you through the process of creating your own 7 Days to Die server using Docker in just a few easy-to-follow steps.

Why Use Docker for Your 7 Days to Die Server?

Docker offers several advantages for hosting game servers:

  • Isolation: Each server runs in its isolated container, preventing conflicts and ensuring stability.
  • Consistency: Docker containers provide a consistent environment, reducing issues caused by different system configurations.
  • Easy Updates: Re-deploying a Docker container is a straightforward way to update your server to the latest version.
  • Portability: You can easily move your server between different machines or cloud providers.
  • Resource Management: Docker makes managing system resources for your server efficient and flexible.

Getting Started: Prerequisites

Before we start, make sure you have the following installed:

  1. Docker: Install Docker Desktop on Windows or macOS, or Docker Engine on Linux.
  2. Docker Compose: Docker Compose is typically bundled with Docker Desktop, or you can install it separately.

Step-by-Step Guide: Setting Up Your 7 Days to Die Server with Docker

Let’s dive into setting up your server using Docker Compose.

Step 1: Create a docker-compose.yml File

Create a new file named docker-compose.yml and paste the following content into it:

version: '3.8'
services:
  7dtdserver:
    image: vinanrra/7dtd-server
    container_name: 7days-gameserver
    environment:
      - START_MODE=1
      - VERSION=stable
      - PUID=1000 # your uid of your user
      - PGID=1000 # your gid of your user's group
      - TimeZone=Africa/Johannesburg
      - TEST_ALERT=YES
      #- ALLOC_FIXES=YES #Optional - Install ALLOC FIXES
    volumes:
      - ./data/serverfiles:/home/sdtdserver/serverfiles/ #Optional, serverfiles
      - ./data/7daystodie:/home/sdtdserver/.local/share/7DaysToDie/ #Optional, maps files
      - ./data/log:/home/sdtdserver/log/ #Optional, logs
      - ./data/backups:/home/sdtdserver/lgsm/backup/ #Optional, backups
      - ./data/lgsm-config:/home/sdtdserver/lgsm/config-lgsm/sdtdserver # Optional, alerts
    ports:
      - 26900:26900/tcp
      - 26900:26900/udp
      - 26901:26901/udp
      - 26902:26902/udp
      - 8080:8080/tcp
      - 8081:8081/tcp
      - 8082:8082/tcp
    restart: unless-stopped #NEVER USE WITH START_MODE=4 or START_MODE=0
    logging:
      driver: "json-file"
      options:
        max-size: "1m"

Explanation:

  • version: '3.8': Specifies the Docker Compose file version.
  • services:: Defines the services to run.
  • 7dtdserver:: The name of our 7 Days to Die server service.
  • image: vinanrra/7dtd-server: The Docker image we are using.
  • container_name: 7days-gameserver: The name of our Docker container.
  • environment:: Environment variables for configuring the server.
    • START_MODE: Controls startup mode: 0 = update and start, 1 = only update, 2 = only start.
    • VERSION: Sets the server version (stable or experimental).
    • PUID and PGID: Your user ID and group ID to prevent permission issues.
    • TimeZone: Sets the timezone.
    • TEST_ALERT: Enables test alerts.
    • ALLOC_FIXES: Optional – Installs ALLOC FIXES.
  • volumes: Mounts host directories to the container for persistent data.
    • ./data/serverfiles: Server files.
    • ./data/7daystodie: Map and save files.
    • ./data/log: Server logs.
    • ./data/backups: Backups of your server data.
    • ./data/lgsm-config: Configuration files for alerts.
  • ports: Maps container ports to host ports.
    • 26900:26900/tcp, 26900:26900/udp: Game port.
    • 26901:26901/udp, 26902:26902/udp: Additional game ports.
    • 8080:8080/tcp: Web control panel.
    • 8081:8081/tcp: Telnet port.
    • 8082:8082/tcp: Additional port.
  • restart: unless-stopped: Restarts the container unless manually stopped.
  • logging: Specifies the logging configuration.

Step 2: Set Your User ID (PUID) and Group ID (PGID)

To avoid permission issues, replace PUID=1000 and PGID=1000 with your actual User ID and Group ID. You can find these using the following commands:

  • Linux/macOS:
    • id -u (for PUID)
    • id -g (for PGID)
  • Windows:
    • You might need to use a tool or find this information through the system settings. It usually defaults to 1000.

Step 3: Configure Environment Variables

Adjust the environment variables as needed in docker-compose.yml:

  • TimeZone: Set your correct timezone. (e.g., America/New_York).
  • START_MODE: Set to 0 for the first run to update and start. After the first run, you can use 2 to skip updates when restarting.
  • VERSION: Choose stable for the latest stable version, or latest_experimental for the experimental branch.
  • Optional variables:
    • SEVEN_DAYS_TO_DIE_SERVER_STARTUP_ARGUMENTS Set custom startup arguments (defaults are set to”-logfile /dev/stdout -quit -batchmode -nographics -dedicated”)
    • SEVEN_DAYS_TO_DIE_CONFIG_FILE Set a different configuration file (default is /app/.local/share/7DaysToDie/serverconfig.xml)
    • SEVEN_DAYS_TO_DIE_TELNET_PORT, SEVEN_DAYS_TO_DIE_TELNET_PASSWORD Configure telnet port and password
    • SEVEN_DAYS_TO_DIE_UPDATE_CHECKING To enable automatic updates once a server update hits Steam, set to 1
    • SEVEN_DAYS_TO_DIE_BRANCH To select a different branch (e.g., latest_experimental

Step 4: Start the Server

Navigate to the directory containing your docker-compose.yml file in your terminal, and run the following command:

docker-compose up -d

This command will:

  • Download the 7 Days to Die server image from Docker Hub.
  • Create a new container named 7days-gameserver.
  • Start the server in detached mode (running in the background).

Since this is the first run, the server files will be downloaded and the server config will be generated.

Step 5: Configure Server Settings

After the initial setup, your server configuration file will be available at data/serverfiles/sdtdserver.xml. You can edit this file to customize your server settings, such as:

  • ServerName: The name of your server.
  • ServerPassword: Set a password for your server.
  • ServerMaxPlayerCount: The maximum number of players.
  • GameWorld: The world to use (e.g., Navezgane, RWG).
  • GameName: The name of your game.
  • BloodMoonFrequency: How often blood moons occur.
  • LootAbundance: Adjust the loot abundance.
  • EACEnabled: Enable or disable EasyAntiCheat.

Here is a configuration example:

<?xml version="1.0" encoding="UTF-8"?>
<ServerSettings>
<!-- GENERAL SERVER SETTINGS -->
<!-- Server representation -->
<property name="ServerName" value="My7DaysServer" />
<!-- Whatever you want the name of the server to be. -->
<property name="ServerDescription" value="a demo for a blog post" />
<!-- Whatever you want the server description to be, will be shown in the server browser. -->
<property name="ServerWebsiteURL" value="" />
<!-- Website URL for the server, will be shown in the serverbrowser as a clickable link -->
<property name="ServerPassword" value="secret" />
<!-- Password to gain entry to the server -->
<property name="ServerLoginConfirmationText" value="" />
<!-- If set the user will see the message during joining the server and has to confirm it before continuing. For more complex changes to this window you can change the "serverjoinrulesdialog" window in XUi -->
<!-- Networking -->
<property name="ServerPort" value="26900" />
<!-- Port you want the server to listen on. Keep it in the ranges 26900 to 26905 or 27015 to 27020 if you want PCs on the same LAN to find it as a LAN server. -->
<property name="ServerVisibility" value="2" />
<!-- Visibility 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. -->
<property name="ServerDisabledNetworkProtocols" value="SteamNetworking" />
<!-- Networking protocols that should not be used. Separated by comma. Possible values: LiteNetLib, SteamNetworking. Dedicated servers should disable SteamNetworking if there is no NAT router in between your users and the server or when port-forwarding is set up correctly -->
<property name="ServerMaxWorldTransferSpeedKiBs" value="1024" />
<!-- Maximum (!) speed in kiB/s the world is transferred at to a client on first connect if it does not have the world yet. Maximum is about 1300 kiB/s, even if you set a higher value. -->
<!-- Slots -->
<property name="ServerMaxPlayerCount" value="8" />
<!-- Maximum Concurrent Players -->
<property name="ServerReservedSlots" value="0" />
<!-- Out of the MaxPlayerCount this many slots can only be used by players with a specific permission level -->
<property name="ServerReservedSlotsPermission" value="100" />
<!-- Required permission level to use reserved slots above -->
<property name="ServerAdminSlots" value="0" />
<!-- This many admins can still join even if the server has reached MaxPlayerCount -->
<property name="ServerAdminSlotsPermission" value="0" />
<!-- Required permission level to use the admin slots above -->
<!-- Admin interfaces -->
<property name="ControlPanelEnabled" value="true" />
<!-- Enable/Disable the web control panel -->
<property name="ControlPanelPort" value="8080" />
<!-- Port of the control panel webpage -->
<property name="ControlPanelPassword" value="secret" />
<!-- Password to gain entry to the control panel -->
<property name="TelnetEnabled" value="true" />
<!-- Enable/Disable the telnet -->
<property name="TelnetPort" value="8081" />
<!-- Port of the telnet server -->
<property name="TelnetPassword" value="" />
<!-- Password to gain entry to telnet interface. If no password is set the server will only listen on the local loopback interface -->
<property name="TelnetFailedLoginLimit" value="10" />
<!-- After this many wrong passwords from a single remote client the client will be blocked from connecting to the Telnet interface -->
<property name="TelnetFailedLoginsBlocktime" value="10" />
<!-- How long will the block persist (in seconds) -->
<property name="TerminalWindowEnabled" value="true" />
<!-- Show a terminal window for log output / command input (Windows only) -->
<!-- Folder and file locations -->
<property name="AdminFileName" value="serveradmin.xml" />
<!-- Server admin file name. Path relative to the SaveGameFolder -->
<!-- Other technical settings -->
<property name="EACEnabled" value="true" />
<!-- Enables/Disables EasyAntiCheat -->
<property name="HideCommandExecutionLog" value="0" />
<!-- Hide logging of command execution. 0 = show everything, 1 = hide only from Telnet/ControlPanel, 2 = also hide from remote game clients, 3 = hide everything -->
<property name="MaxUncoveredMapChunksPerPlayer" value="131072" />
<!-- Override how many chunks can be uncovered on the ingame map by each player. Resulting max map file size limit per player is (x * 512 Bytes), uncovered area is (x * 256 m²). Default 131072 means max 32 km² can be uncovered at any time -->
<property name="PersistentPlayerProfiles" value="false" />
<!-- If disabled a player can join with any selected profile. If true they will join with the last profile they joined with -->
<!-- GAMEPLAY -->
<!-- World -->
<property name="GameWorld" value="Navezgane" />
<!-- "RWG" (see WorldGenSeed and WorldGenSize options below) or any already existing world name in the Worlds folder (currently shipping with e.g. "Navezgane", "PREGEN01", ...) -->
<property name="WorldGenSeed" value="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 -->
<property name="WorldGenSize" value="4096" />
<!-- If 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 -->
<property name="GameName" value="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 -->
<property name="GameMode" value="GameModeSurvival" />
<!-- GameModeSurvival -->
<!-- Difficulty -->
<property name="GameDifficulty" value="2" />
<!-- 0 - 5, 0=easiest, 5=hardest -->
<property name="BlockDamagePlayer" value="100" />
<!-- How much damage do players to blocks (percentage in whole numbers) -->
<property name="BlockDamageAI" value="100" />
<!-- How much damage do AIs to blocks (percentage in whole numbers) -->
<property name="BlockDamageAIBM" value="100" />
<!-- How much damage do AIs during blood moons to blocks (percentage in whole numbers) -->
<property name="XPMultiplier" value="100" />
<!-- XP gain multiplier (percentage in whole numbers) -->
<property name="PlayerSafeZoneLevel" value="5" />
<!-- If a player is less or equal this level he will create a safe zone (no enemies) when spawned -->
<property name="PlayerSafeZoneHours" value="5" />
<!-- Hours in world time this safe zone exists -->
<!-- -->
<property name="BuildCreate" value="false" />
<!-- cheat mode on/off -->
<property name="DayNightLength" value="60" />
<!-- real time minutes per in game day: 60 minutes -->
<property name="DayLightLength" value="18" />
<!-- in game hours the sun shines per day: 18 hours day light per in game day -->
<property name="DropOnDeath" value="1" />
<!-- 0 = nothing, 1 = everything, 2 = toolbelt only, 3 = backpack only, 4 = delete all -->
<property name="DropOnQuit" value="0" />
<!-- 0 = nothing, 1 = everything, 2 = toolbelt only, 3 = backpack only -->
<property name="BedrollDeadZoneSize" value="15" />
<!-- Size (box "radius", so a box with 2 times the given value for each side's length) of bedroll deadzone, no zombies will spawn inside this area, and any cleared sleeper volumes that touch a bedroll deadzone will not spawn after they've been cleared. -->
<property name="BedrollExpiryTime" value="45" />
<!-- Number of days a bedroll stays active after owner was last online -->
<!-- Performance related -->
<property name="MaxSpawnedZombies" value="64" />
<!-- This setting covers the entire map. There can only be this many zombies on the entire map at one time. Changing this setting has a huge impact on performance. -->
<property name="MaxSpawnedAnimals" value="50" />
<!-- If your server has a large number of players you can increase this limit to add more wildlife. Animals don't consume as much CPU as zombies. NOTE: That this doesn't cause more animals to spawn arbitrarily: The biome spawning system only spawns a certain number of animals in a given area, but if you have lots of players that are all spread out then you may be hitting the limit and can increase it. -->
<property name="ServerMaxAllowedViewDistance" value="12" />
<!-- Max viewdistance a client may request (6 - 12). High impact on memory usage and performance. -->
<!-- Zombie settings -->
<property name="EnemySpawnMode" value="true" />
<!-- Enable/Disable enemy spawning -->
<property name="EnemyDifficulty" value="0" />
<!-- 0 = Normal, 1 = Feral -->
<property name="ZombieMove" value="0" />
<!-- 0-4 (walk, jog, run, sprint, nightmare) -->
<property name="ZombieMoveNight" value="3" />
<!-- 0-4 (walk, jog, run, sprint, nightmare) -->
<property name="ZombieFeralMove" value="3" />
<!-- 0-4 (walk, jog, run, sprint, nightmare) -->
<property name="ZombieBMMove" value="3" />
<!-- 0-4 (walk, jog, run, sprint, nightmare) -->
<property name="BloodMoonFrequency" value="7" />
<!-- What frequency (in days) should a blood moon take place. Set to "0" for no blood moons -->
<property name="BloodMoonRange" value="0" />
<!-- How many days can the actual blood moon day randomly deviate from the above setting. Setting this to 0 makes blood moons happen exactly each Nth day as specified in BloodMoonFrequency -->
<property name="BloodMoonWarning" value="8" />
<!-- The Hour number that the red day number begins on a blood moon day. Setting this to -1 makes the red never show. -->
<property name="BloodMoonEnemyCount" value="8" />
<!-- This is the number of zombies that can be alive (spawned at the same time) at any time PER PLAYER during a blood moon horde, however, MaxSpawnedZombies overrides this number in multiplayer games. Also note that your game stage sets the max number of zombies PER PARTY. Low game stage values can result in lower number of zombies than the BloodMoonEnemyCount setting. Changing this setting has a huge impact on performance. -->
<!-- Loot -->
<property name="LootAbundance" value="100" />
<!-- percentage in whole numbers -->
<property name="LootRespawnDays" value="30" />
<!-- days in whole numbers -->
<property name="AirDropFrequency" value="72" />
<!-- How often airdrop occur in game-hours, 0 == never -->
<property name="AirDropMarker" value="false" />
<!-- Sets if a marker is added to map/compass for air drops. -->
<!-- Multiplayer -->
<property name="PartySharedKillRange" value="100" />
<!-- The distance you must be within to receive party shared kill xp and quest party kill objective credit. -->
<property name="PlayerKillingMode" value="3" />
<!-- Player Killing Settings (0 = No Killing, 1 = Kill Allies Only, 2 = Kill Strangers Only, 3 = Kill Everyone) -->
<!-- Land claim options -->
<property name="LandClaimCount" value="1" />
<!-- Maximum allowed land claims per player. -->
<property name="LandClaimSize" value="41" />
<!-- Size in blocks that is protected by a keystone -->
<property name="LandClaimDeadZone" value="30" />
<!-- Keystones must be this many blocks apart (unless you are friends with the other player) -->
<property name="LandClaimExpiryTime" value="7" />
<!-- The number of days a player can be offline before their claims expire and are no longer protected -->
<property name="LandClaimDecayMode" value="0" />
<!-- Controls how offline players land claims decay. 0=Slow (Linear) , 1=Fast (Exponential), 2=None (Full protection until claim is expired). -->
<property name="LandClaimOnlineDurabilityModifier" value="4" />
<!-- How much protected claim area block hardness is increased when a player is online. 0 means infinite (no damage will ever be taken). Default is 4x -->
<property name="LandClaimOfflineDurabilityModifier" value="4" />
<!-- How much protected claim area block hardness is increased when a player is offline. 0 means infinite (no damage will ever be taken). Default is 4x -->
<property name="LandClaimOfflineDelay" value="0" />
<!-- The number of minutes after a player logs out that the land claim area hardness transitions from online to offline. Default is 0 -->
<property name="TwitchServerPermission" value="90" />
<!-- Required permission level to use twitch integration on the server -->
<property name="TwitchBloodMoonAllowed" value="false" />
<!-- If the server allows twitch actions during a blood moon. This could cause server lag with extra zombies being spawned during blood moon. -->
<!-- There are several game settings that you cannot change when starting a new game.
You can use console commands to change at least some of them ingame.
setgamepref BedrollDeadZoneSize 30 -->
</ServerSettings>

Step 6: Configure Discord Notifications (Optional)

If you want to receive server notifications on Discord:

  1. Create a Discord webhook in your desired channel.
  2. Modify the data/lgsm-config/common.cfg file: discordalert="on" discordwebhook="https://discord.com/api/webhooks/x/x" Replace the placeholder URL with your actual webhook URL.

Step 7: Restart the Server

After making changes to the configuration files, restart your server with:

docker-compose restart

This will apply your configuration changes.

Connecting to Your Server

  1. Launch the 7 Days to Die game.
  2. Select “Join A Game”.
  3. Click “Connect To IP”.
  4. Enter the IP address of your server and the port 26900. If your server is on the same network use your internal IP address.
  5. If your server is accessible over the internet, make sure that ports 26900 (TCP and UDP), 26901 (UDP) and 26902 (UDP) are forwarded from your router to your server.
  6. Enter your server password if you set one up in the serverconfig.xml file.

Managing Your Server

You can manage your server by executing commands inside the container:

  1. Access the container’s bash shell: docker exec -it 7days-gameserver bash
  2. Switch to the sdtdserver user: su - sdtdserver
  3. Use LinuxGSM commands to manage the server:
    • ./sdtdserver start or ./sdtdserver st: Start the server.
    • ./sdtdserver stop or ./sdtdserver sp: Stop the server.
    • ./sdtdserver restart or ./sdtdserver r: Restart the server.
    • ./sdtdserver monitor or ./sdtdserver m: Check server status.
    • ./sdtdserver update or ./sdtdserver u: Check for server updates.
    • ./sdtdserver backup or ./sdtdserver b: Create a backup.

Installing Mods

You can install mods by placing them in the data/serverfiles/Mods folder within your host directory.
You can find mods on sites like:

  • https://7daystodiemods.com/
  • Use LinuxGSM commands for mods ./sdtdserver mods-install mi, ./sdtdserver mods-remove mr, ./sdtdserver mods-update mu

Refer to the documentation: https://docs.linuxgsm.com/commands/mods

Recommended Server Specifications

The recommended specs for a 7 Days to Die server depend on the number of players and the complexity of your world:

  • CPU: A modern quad-core processor with a clock speed of 3.0 GHz or higher for a small group. Consider 6 cores or more for larger groups and more complex worlds.
  • RAM: At least 8GB of RAM for up to 8 players. 16GB of RAM is advisable for larger groups or heavily modded servers.
  • Storage: A fast SSD with at least 10GB free space. The game world can grow as you explore so keep that in mind.
  • Network: A stable network connection with good upload speed is needed, especially for servers that are internet-facing. A 100Mb/s connection is usually sufficient.

Conclusion

With Docker, setting up your own 7 Days to Die server is easier and more manageable than ever. By following these steps, you’ll have a robust and reliable server for you and your friends in no time. Enjoy the post-apocalyptic survival experience with a customized server tailored to your preferences! If you like this content, you can check out the author’s website or follow @ruanbekker on Twitter.

Supercraft

Recent Posts

Best 7 Days to Die Server Managers in 2025

Okay, so you're looking to run your own 7 Days to Die server, awesome! That…

12 hours ago

Project Zomboid Roadmap 2025: What to Expect After the Huge Build 42 Update

Project Zomboid fans, the wait is finally over! The highly anticipated Build 42 update has…

2 days ago

7 Best Graphics Cards for Palworld

Palworld has taken the gaming world by storm, captivating players with its unique blend of…

2 days ago

Valheim Graphics Card: Choosing the Right GPU for Optimal Performance

Valheim, the popular Viking-themed survival game, has captivated players with its immersive world and challenging…

2 days ago

7 Days to Die What GPU for Optimal Performance

7 Days to Die is a popular zombie survival game known for its open-world sandbox…

2 days ago

7 Days to Die 1.2 Mods: A Whole New Level of Apocalypse

Hey, survivors! If you're still roaming the post-apocalyptic world of 7 Days to Die, you…

1 week ago