Setting up a 7 Days to Die server under Linux isn’t as difficulty as you may think. The Steam developer Valve is providing a tool which makes it easier, even for people who aren’t that familiar with the Linux command line. This article is covering how you setup your own 7 Days to Die server under a Ubuntu or Debian installation.
About 7 Days to Die
7 Days to Die is a zombie apocalypse survival crafting game which has been initially released in December 2013. The game is still in a “Early Access” stage. 7 Days to Die is similar to Minecraft in the way it is played, but provides better graphics and a different scenario. There are also some quests included like treasure hunting. In the latest version (as of written in June 2018) the developer The Fun Pimps also integrated vehicles into the game. Like in Minecraft, the real fun with 7 Days to Die starts when you start playing with friends. Surviving, building and creating in a random generated world can bring you hours of fun and a long lasting motivation to go on in the things you wanna achieve.
On a freshly Debian or Ubuntu installation, we need to install some requirements in the first place. With the following command we will update the package repositories and install the necessary requirements:
user@machine:~$ sudo apt-get update && sudo apt-get install screen wget
Adding 32-Bit libraries
The Steam command line tool is only available as a 32-Bit program. As of today most of the systems are 64-Bit based. Ubuntu for e.g. isn’t even supporting 32-Bit anymore. If you’re running an 32-Bit system, you can skip this part. To find out if you have a 32-Bit system installed, just issue the following command on your system:
If the output of this command is i386 or i586, you have a 32-Bit system. If it’s x86_64 you’re using a 64-Bit system. In this case you have to issue the following two commands as well:
user@machine:~$ sudo dpkg --add-architecture i386 user@machine:~$ sudo apt-get update && sudo apt-get install lib32gcc1
This installs the lib32gcc1 file which is a 32-Bit library. This library is needed by the Steam command line tool. If this library isn’t installed, the following commands will fail.
Download and extract Steam
As next, we acquire the Steam command line tool for Linux machines in order to download the server files via the Steam network. Before that we create a separate folder (which is called steamcmd) were we are going to download the Steam command line tool to:
user@machine:~$ mkdir steamcmd user@machine:~$ cd steamcmd user@machine:~/steamcmd$ wget http://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
The wget command is now downloading the Steam Linux command line tool. After the download is finished, we can extract this tool (it is compressed right now) like this:
user@machine:~/steamcmd$ tar -xvzf steamcmd_linux.tar.gz
Updating the Steam tool
You can now start updating the Steam tool. Execute the following command to start the update:
This process will take some time. In the meanwhile, you will see a lot of output on the console like this:
Redirecting stderr to '/home/user/.steam/logs/stderr.txt' ILocalize::AddFile() failed to load file "public/steambootstrapper_english.txt". [ 0%] Checking for available update... [----] Downloading update (0 of 13.028 KB)... [ 0%] Downloading update (38 of 13.028 KB)... [ 0%] Downloading update (38 of 13.028 KB)... [ 0%] Downloading update (38 of 13.028 KB)... [ 0%] Downloading update (38 of 13.028 KB)... [...]
When the process is finished you will see a output which looks like this:
Steam Console Client (c) Valve Corporation -- type 'quit' to exit -- Loading Steam API...OK. Steam>
The last line Steam> tells you that the Steam command line tool is actually opened and Steam waits for you to enter a command.
Login into Steam
When using the Steam command line tool, you have to login just like with the graphical desktop version. Enter the command login followed by your Steam username to login. Steam will then ask you for your password and Two Factor Authentication (if enabled). When you enter your password there will be no input shown. But this is normal, just like in almost every Linux / UNIX software:
Steam> login <USERNAME> Logging in user '<USERNAME>' to Steam Public... password: Enter the current code from your Steam Guard Mobile Authenticator app Two-factor code:XXXXX Logged in OK Waiting for user info...OK
Download and install the 7 Days to Die server files
Now that you’re logged in, you can finally start downloading and installing your 7 Days to Die server. With the first of the following two commands we enforce Steam to install the 7 Days to Die server files into the directory 7dtd_server. The second one is starting the actual installation process of the server files. The number 294420 is the ID for the 7 Days to Die server files:
Steam> force_install_dir 7dtd_server Steam> app_update 294420
You can see again an output which will show you the actual progress:
Update state (0x5) validating, progress: 2.19 (75656327 / 3459239207) Update state (0x61) downloading, progress: 0.21 (7340032 / 3459239207) Update state (0x61) downloading, progress: 1.02 (35228112 / 3459239207) Update state (0x61) downloading, progress: 2.75 (95064875 / 3459239207) [...]
This command can take even longer than the Steam update process. It basically depends on your internet connection speed. After this command was successful, you will get yet again another message about it:
Success! App '294420' fully installed.
You can now quit the Steam command line tools by simply entering quit. Congratulations, you successfully downloaded and installed a 7 Days to Die server under Linux.
Configuring your server
You have a lot of options to configure your 7 Days to Die server to your wishes. The file to do so is the serverconfig.xml which is in the same directory as your 7 Days to Die server files. So change into the 7 Day to Die server directory:
user@machine:~/steamcmd$ cd 7dtd_server
Within this directory, there is already an example serverconfig.xml. While this file should work already, you should take at least some tweaks. To edit this file you can use the editor nano:
user@machine:~/steamcmd/7dtd_server$ nano serverconfig.xml
With CTRL+W you can search for a string. With CTRL+O you can save the file. And with CTRL+X you close the editor. The following parameters are a suggestion how you should modify your serverconfig.xml.
|ServerPassword||If you want a private server, you can set a password which everyone who wants to connect to the server has to enter. If you leave this value empty, no password is set and everyone can connect to your server.|
|ServerName||Here you can set your server name to your wishes.|
|ServerMaxPlayerCount||This is the maximum amount of players which can play simultaneously on your server. The more player the more power your server needs.|
|ServerIsPublic||If this is set to 'true' your server will be registered with the Masterserver and therefore will show up when someone is searching or scrolling through the server browser.|
|GameDifficulty||Represents the difficulty of the server and therefore the strength of your enemies (the Zombies). 2 is the standard and could be called out as "medium". Possible range is from 0 to 5 while 0 is the easiest and 5 the hardest difficulty.|
|DayLightLength||The value given here states how long a day in game is in hours. I recommend at least 18. Personally I feel much more comfortable with 20.|
|AirDropMarker||From time to time there will be airplanes which are doing an airdrop. If you set this value to 'true' the airdrop will be marked on your map. It's up to you if you want to use this feature. I for myself enabled it.|
You can always come back and change the parameters to your desire. However, you always have to restart the server after each change. For a full list of all possible values, check out this list.
Starting the server
Puh, lot of stuff right? But now the time has come to start your server. In order to have your server running constantly, you have to use screen. screen is a tool which runs programs even while you logged out. But first, ensure that you’re still in the 7dtd_server directory and enter the following commands:
user@machine:~/steamcmd/7dtd_server$ screen -S 7dtd user@machine:~/steamcmd/7dtd_server$ ./7DaysToDieServer.x86_64 -logfile output.log -configfile=$HOME/steamcmd/7dtd/serverconfig.xml -dedicated
Your server will now start. This can take up to 5 minutes. You get no output when the server is ready. If you want to know more about what is hapenning, take a look at the output.log file within your 7dtd_server directory. To close the screen session (and therefore let the server run in the background), press CTRL+A followed by the D key for detaching. You can now close your remote session to your server without shutting down your 7 Days to Die server itself. If you want to attach to the screen session again, simply enter this command:
user@machine:~$ screen -r 7dtd
You can now start 7 Days to Die on your desktop / gaming machine, click on Connect To Server and enter either die IP address / name of your server (FQDN) and click on the connect symbol or search for your server name in the upper left (if you set your server to public at the step before):
If you can’t connect at this point, you may have to check your firewall or the firewall on your server (if you use one). On default, the 7 Days to Die server listens on port 26900. This port has to be accessible from the internet.
Stopping the server
To stop your server, simply resume your screen session like this:
user@machine:~$ screen -r 7dtd
And press CTRL+C afterwards. It can take a few seconds up to a minute before the server shuts down.
How to become an admin?
In order to become an admin, you have to tell your server your Steam ID. Otherwise the server can’t decide which player really should get admin rights. To get your Steam ID, simply open Steam, click on your profile and copy the long number within the URL:
On your server, change into the following directory and create a file called serveradmin.xml. Open it afterwards with an text editor (we use nano again in this case):
user@machine:~$ cd $HOME/.local/share/7DaysToDie/Saves/ user@machine:~/.local/share/7DaysToDie/Saves$ touch serveradmin.xml user@machine:~/.local/share/7DaysToDie/Saves$ nano serveradmin.xml
Enter at least the following lines:
<adminTools> <admins> <admin steamID="12345YourSteamID" permission_level="0" /> </admins> </adminTools>
Don’t forget to change the value 12345YourSteamID to your Steam ID! Press CTRL+O to save and CTRL+X to close the file. Afterwards, stop and start the 7 Days to Die server and that’s it. You could even create moderators and give each of them specific rights. However, this would definitely burst this article. If you want to know more about the possible rights management on a 7 Days to Die server, check out this link.
Last words …
As you can see, with a little bit of work you can setup your own 7 Days to Die server on a cheap Linux VPS for example. Of course you could also go with a hosted one and don’t bother about all the setup stuff, but this is way more costly. And if you’re interested in working with Linux machines, this is a good way to learn a little bit about how to maintain and setup server software under Linux in general. If you have any comments, wishes or notes, please let me know down below in the comments.