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 ensure our operating system is up-to-date.

Using the following two commands within the terminal, you can update the package list cache and upgrade any out-of-date packages.

sudo apt update
sudo apt upgrade -y

2. After updating your operating system, your next stop is installing a package called “software-properties-common“.

This package will allow you to easily add additional architectures for the “apt” package manager to use. We require the ability to do this as SteamCMD is only available as a 32-bit application.

sudo apt install software-properties-common

Setting up SteamCMD on your Linux Machine

3. To install and run SteamCMD on Linux, you will need to add the “i386” architecture to your system. SteamCMD is the tool we will use to download the latest version of the 7 Days to Die dedicated server on Linux.

You can achieve this by running the following command within the terminal.

sudo dpkg --add-architecture i386

4. Once you have added the “i386” architecture, you must add the “multiverse” repository to the package manager.

We must do this as SteamCMD is not a free or open-source software, meaning it isn’t included in the standard Ubuntu package repository. Luckily, adding the multiverse repository is super easy.

sudo apt-add-repository multiverse

If you are running a different operating system that isn’t Ubuntu, you may need to add the “non-free” repository instead by running the following command.

sudo apt-add-repository non-free

5. As we changed the available repositories, we must update the package list cache again. If we don’t do this, the system will be unaware of the new packages it can install.

sudo apt update

6. All we need to do to install the SteamCMD client on your Linux machine is run the following command.

sudo apt install steamcmd

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

7. 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

8. 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

9. 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

10. 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

11. 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

12. 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

13. 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

14. 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

15. 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

16. 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 

17. 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

18. 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

19. 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

20. 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 *