Running a 7 Days to Die Server on Linux

This tutorial will show you how to set up and run a 7 Days to Die dedicated server on Linux.

7 Days to Die Dedicated Server Linux

7 Days to Die is an open-world survival horror game in which the goal is to survive as long as possible while fending off zombies and other environmental threats. It features a voxel world similar to Minecraft, which allows the world to be destroyed and interesting buildings to be constructed.

One key feature of 7 Days to Die is that it allows you to play with up to 16 people. The best way to achieve this is to set up a dedicated server.

Setting up a dedicated server for 7 Days to Die is a relatively simple process and gives you a place where you can easily have multiple people connect. You don’t even have to own the game to host a server.

Linux is an excellent choice for hosting game servers because it is relatively lightweight. Being lightweight allows Linux to allocate more resources to the 7 Days to Die dedicated server, meaning you can run this game server on a weaker machine.

Please note that you will need at least 8GB of RAM to run this game server. Any less, and you will run into out-of-memory issues.

Installing and Running the 7 Days to Die Dedicated Server on Linux

In the following sections, we will walk you through an easy way to install and run the 7 Days to Die Dedicated server.

These steps for setting up the server focus on Debian-like systems such as Ubuntu. However, they should work with many other Linux systems with slight changes.

Before proceeding, if you are hosting this within a home network, you will want to forward port 26900 for both the TCP and UDP protocols.

Preparing your Linux System

1. Before installing the 7 Days to Die Dedicated Server on Linux, we must install SteamCMD. SteamCMD is the tool we will use to download the latest version of the dedicated server on Linux.

If you don’t have this tool installed already, please follow our guide on installing SteamCMD on Linux before continuing any further.

https://pimylifeup.com/linux-steamcmd/

Creating a Linux User to Run the 7 Days to Die Dedicated Server

2. Our next step is to use the useradd command to create a user called “7days” on our system. We will use this Linux user to run the 7 Days to Die server.

Since we use the “-m” option, this command will also create a home directory for the user. This directory is where we will store the server itself.

sudo useradd -m 7days

3. With the user created, we will want to change the current terminal to the new user by running the following command.

sudo -u 7days -s

4. Now change to the user’s home directory using the cd command followed by the tilde symbol (~) within the terminal.

cd ~

Downloading the Latest Version of the 7 Days to Die Server on Linux

5. At this point, we can finally use the steamcmd tool to download the latest version of the 7 Days to Die dedicated server to our Linux system.

This process can take a few minutes to complete as the server is fairly large and can take a bit to download.

/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/7days/server +login anonymous +app_update 294420 +quit

Configuring the 7 Days to Die Server

6. Before we get your 7 Days to Die server up and running on Linux, you will want to configure the server. This is done through a file called “serverconfig.xml“.

You can edit this file from within the terminal using the nano text editor.

nano /home/7days/server/serverconfig.xml

How to Modify the 7 Days to Die Configuration

7. This configuration file contains numerous options. Before we discuss some options you want to change, let us quickly show you how to change values in this config file.

When changing an option within this file you will see text such as the following.

<property name="ServerName" value="My Game Host"/>

If you want to change this value, you will change the text within the double quotation marks. For example, if we wanted to change the server’s name to “PiMyLifeUp” the line above would become what we have shown below.

<property name="ServerName" value="My Game Host"/>

Quick Overview of Important Server Options

8. Most of the options are fairly self-explanatory, but let’s go over some of the more important ones. There are even comments at the end of each line that tell you what that option is for.

General Server Options

These first set of options control things such as the server’s name and password.

  • ServerName: This option allows you to set a name for your 7 Days to Die Dedicated server. By default, it is set to “My Game Host.”
  • Server Description: This option allows you to control the description that will appear alongside your server name. The default value for this option is “A 7days Days to Die Server“.
  • ServerPassword: The 7 Days to Die Dedicated server on Linux allows you to set a password. Setting a password means that a user must enter it to be able to join.

    If you plan on having this server accessible, we highly recommend that you set a password.
  • ServerVisibility: This option allows you to control whether your Linux dedicated server will be visible through the server browser.

    There are two valid values for this option:
    • 2: Setting this option to 2 will make the server publicly available, which is the default value for a new server.
    • 0: When this is set to 0, a user will only be able to join your game server by manually entering its IP address.
  • ServerMaxPlayerCount: You can change this value to control how many users can play on the server. By default, it is set to 8 slots.

    The more slots you have, the more unstable the server will become. The highest value you can set for your dedicated server is 16 slots.

Game Map Options

Below, you can find some useful options for controlling the map on the server that you will be playing on.

  • GameWorld: 7 Days to Die has several different pre-made maps you can play on and generate your own custom world.

    By default, the game world is set to the “Navezgane” map. This is typically the recommended experience for new players of 7 Days to Die.

    If you want to generate a custom map, then you will want to use the value “RWG“. Please note that the map generation process can take considerable time to complete.
  • WorldGenSeed: If you have set the game world to “RWG” then you will also want to control the map seed. This seed is used during world generation, changing the value here will change the map that is generated.

    By default, the seed is set to “asdf“.
  • WorldGenSize: By setting the map to “RWG“, you will also be able to control how big of a map is generated. This value must be between 6144 and 10240 and also be a multiple of 1024.

    The higher the value, the longer the map will take to generate when you first start up your 7 Days to Die dedicated server on Linux.

    The default value for the world generation size is “6144“.
  • GameName: By default, the game name is set to “My Game” and is what is used for the server’s save file.

    You can change this value to any name you want as long as you avoid using symbols and stick to letters and numbers. Symbols can prevent the saves from working.
Controlling the Day Length

An advantage of hosting your own 7 Days to Die dedicated server on Linux is that you can control the night length.

  • DayNightLength: This option lets you control how long an in-game day will last on your server. By default, this value is set to 60 minutes.
  • DayLightLength: The game server also allows you to set the length of daylight on your 7 Days to Die server. This is expressed as in-game hours. By default, it is set to 18 hours of light per in-game day.

    With the default day-night length, you will have 45 minutes of daylight.
  • LootRespawnDays: The final option we are discussing here is the number of in-game days that must pass before loot respawns in the game world.

    By default, this value is set to 7 in-game days, so with the default day length, it will take 7 hours for loot to respawn.

Saving your Changes

9. After editing the configuration file, you can save and quit by pressing CTRL + X, Y, and then ENTER.

Writing a Service to Manage your 7 Days to Die Server

10. At this point, we no longer need to use the “7days” user that we created. You can simply exit this user using the exit command within the terminal.

After running this command, you should return to using the terminal as your last user.

exit

11. We can now move on and write a service file that will launch and manage our 7 Days to Die Server on our Linux system.

You can begin writing this service file by using the nano text editor.

sudo nano /etc/systemd/system/7daystodie.service 

12. Within this file, fill out the following lines. These lines basically tell the system manager how it should start and stop the 7 Days to Die server.

[Unit]
Description=& Days to Die Dedicated Server
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
Restart=on-failure
RestartSec=10
User=7days
Group=7days
WorkingDirectory=/home/7days/server
ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/7days/server +login anonymous +app_update 294420 +quit
ExecStart=/home/7days/server/startserver.sh -configfile=serverconfig.xml
ExecStop=-/bin/bash -c "echo 'shutdown' | /usr/bin/telnet 127.0.0.1 8081"

[Install]
WantedBy=multi-user.target

13. Once you have finished writing out the service, save and quit by pressing CTRL + X, Y, and then ENTER.

Starting up your 7 Days to Die Server on Linux

14. Now that the service has been written, we want to enable it to start automatically when your Linux system powers on.

You can enable the “7daystodie” service by running the command below.

sudo systemctl enable 7daystodie

15. Now, you can bring your 7 Days to Die server online using the following command.

Please note that this process can take a few minutes to complete as the server does need to run through a few things before it will be fully online.

sudo systemctl start 7daystodie

Conclusion

By this point in the tutorial, you should have got the 7 Days to Die Dedicated server up and running on our Linux system.

Please feel free to leave a comment below if you have had any issues with getting this game server to run.

If you liked this guide, we highly recommend checking out our many other game server tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *

2 Comments

  1. Avatar for Ben
    Ben on

    Hi,
    Thanks for the tutorial.
    Everything worked except for the “sudo apt-add-repository non-free” line in the install steamcmd instructions. I’m running Pop_OS! though which might be why.
    Does the Step 12 set the game to auto start at bootup or do I need to do something else to get that to run?
    I have a mainly headless Pop_OS! server running and would like the game to start at system boot without having to log into the system and manually start it.
    How do I achieve that?
    Kind regards

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Ben,

      Were you still able to install SteamCMD despite running into the error with “apt-add-repository”?

      On to your second question, the steps 12 to 15 involve setting up a Systemd service, this service once enabled will automatically start when your operating system does. You shouldn’t have to manually start it unless something is breaking it at startup.

      Please let me know if you need any more assistance or any clarification.

      Kind regards,
      Emmet