In this guide, you will learn how to set up your own 7 Days to Die server (7D2D) on Ubuntu. Please note that this game is still early access in development and that the installation steps may change without notice as updates are released.
Ensure that you are logged in as the root user. 64-bit Ubuntu Users need to install the 32-bit libraries.
dpkg --add-architecture i386
apt-get update
apt-get install libc6-i386 lib32gcc1 lib32stdc++6 -y7D2D has very little output to the console. The choice is up to you whether to use the screen. If so, then you may need to install it.
apt-get update
apt-get install screen -yNext, we want to create a user account for 7D2D to run under. We will also create a secure password.
adduser <choose a account name>Switch to the newly created user account.
su <new account>Download the SteamCMD utility from the Steam website. This tool is also available on the Steam Wiki.
mkdir ~/steamcmd
cd ~/steamcmd
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar -xf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gzOnce this is done, make the SteamCMD executable, and run it.
chmod +x steamcmd.sh
./steamcmd.shOnce it loads, enter your login credentials. You may receive a Steam Guard warning. You could also log in anonymously using the Log in anonymously option.
login <username> <password>Warning: Your password is visible in plain text.
Set the installation directory and install the application.
force_install_dir ./7D2D
app_update 294420
quitEdit startserver.sh with your favorite text editor.
cd 7D2D
nano startserver.shOnce this is open, replace:
./7DaysToDie.x86_64 -logfile 7DaysToDie_Data/output_log.txt $@with:
./7DaysToDie.x86 -configfile=serverconfig.xml -logfile 7DaysToDie_Data/output_log.txt $@Now, edit the config file:
nano serverconfig.xmlThere are a few key settings in this file that you may want to modify.
ServerName – Public server name.
ServerIsPublic – Will appear on the public list.
ServerPort – Port number.
ServerPassword – Password to join.
ServerMaxPlayerCount – Max players.
GameWorld – Navezgane, MP Wasteland Horde, MP Wasteland Skirmish, MP Wasteland War, Random Gen.
GameName – Game name/seed.
ControlPanelEnabled – Enabled web control console.
ControlPanelPort – Port to connect to the console.
ControlPanelPassword – Password (cannot have special chars).
TelnetEnabled – Enable telnet.
TelnetPort – Telnet port.
TelnetPassword – Telnet password.
Now is a good time to review other settings you may want to modify.
Time to start the server. If you want to use the screen, make sure that you are in the 7D2D directory.
screen -s 7D2D ./startserver.shOtherwise, start the server without the screen.
./startserver.shIf you have enabled telnet, you can type “shutdown” from the telnet window.
If you are running on the screen, press Ctrl+C to break out and shut down.
If you are not running the screen, run these commands.
ps aux | grep -i "7days"
kill <procid returned>
# or (case sensitive)
pkill 7DaysEveryone likes a new 7 Days to Die update. You can set your 7D2D server to auto-update with a few steps. First, create an update file containing the Steam login and update commands. Then, create a cron job to run it.
Start by creating the update file.
nano /home/<account name you name in first section>/serverupdate.txt
@ShutdownOnFailedCommand 1
login steamaccount steampass
force_install_dir ./7D2D
app_update 294420
quitSave the file. Then, the update script.
nano /home/<account name you name in first section>/update.sh
#!/bin/sh
cd /home/<account name you made in the first section>
./steamcmd.sh +runscript updateserver.txtSave the update script. Make the script “executable”.
chmod +x update.shAdd a cron entry.
crontab -e
00 00 * * * /home/<account name you made in the first section>/update.shSave the crontab file.
Using your favorite text editor, create the following file: /usr/lib/systemd/system/7dtd.service Then add the following to it:
[Unit]
Description=7 Days to Die
After=network.target nss-lookup.target
[Service]
Type=simple
PIDFile=/run/7dtd.pid
ExecStart=<path to 7 Days to Die>/startserver.sh -configfile=serverconfig.xml
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
[Install]
WantedBy=multi-user.targetAfter saving the file, you can use the systemctl to start 7dtd as follows:
systemctl start 7dtdYou can also set 7dtd to start automatically when the server (re)starts using the following command:
systemctl enable 7dtdAt this point, you’re all set. Enjoy your 7D2D server!
If you restart your server, the game will reset to day 1.