Version 10 (modified by Alloc, 8 years ago) (diff)


The following will guide through the basic setup of the scripts. If explicit commands or filenames are given they can differ if you use a distribution which is not based on Debian.

Table of contents

  1. Automatic installation
    1. Manual steps after running the bootstrapper
      1. Debian based distribution
      2. Other distributions
  2. Manual installation
    1. Prerequisites
      1. 64 Bit host operating system
    2. Installation layout
    3. Useraccount dedicated to running 7dtd
    4. Install the management script files
    5. Secure the files
    6. Bash completion
    7. Install the game
    8. (Optional) Enable cron job for backups
    9. Initial setup done

Automatic installation

For a mostly automatic setup you can get the bootstrapper script and run it. This will do all the steps explained on this page in the section manual installation.

chmod +x

Manual steps after running the bootstrapper

Debian based distribution

If you want bash auto completion you should check if that is enabled for root by default. See section Bash completion.

Other distributions

You should check if all prerequisites are met and if the paths at the end of the file /etc/7dtd.conf point to the correct locations.

Also automatic start of 7dtd on system boot is not automatically setup. Refer to the documentation of your distribution on how to get /etc/init.d/ called on boot with parameter "start" and on shutdown with parameter "stop".

Manual installation


Make sure all required tools are installed.

64 Bit host operating system

SteamCMD requires lib32gcc1 to run:

apt-get install lib32gcc1

Also make sure to install a 32 Bit version of Wine:

dpkg --add-architecture i386
apt-get update
apt-get install wine:i386

Installation layout

This guide will assume that the following paths will be used. You can use different ones but obviously you have to adapt some commands and settings.

home for the user running the server and base path for the server management script system
by default backups of game data files will go here
Management script entry point
Base path of script components
Global configuration options
Bash-completion configuration to auto-complete the commands for the scripts
Cron job for game backups
Init script to start/stop the instances on host boot/shutdown

Useraccount dedicated to running 7dtd

As running the game as root is highly insecure create a new user just for the server.

useradd -d /home/sdtd -m -r -s /bin/bash -U sdtd

This will create a user and group named sdtd (last parameter) with home directory /home/sdtd. Both can be changed but you will also have to adapt the other steps later on.

Install the management script files

  1. Get the script files:
  2. Extract the files to /:
    tar --touch -xvzf management_scripts.tar.gz -C /
    (alternatively you can extract to some temporary path and move files to their respective target folders manually)
  3. Open the file /etc/7dtd.conf in the editor of your choice and edit the values. Edit at least the following variables:
    export STEAM_USER=
    export STEAM_PASS=
    All other values can be kept at their default if you did stick to the paths and names given in this tutorial. If you are not running a Debian based distribution make sure the paths for the commands defined at the end are correct.
  4. Make the server start at system boot:
    update-rc.d defaults
  5. Compile start-stop-daemon from source as detailed in start-stop-daemon?.

Secure the files

As the global config file 7dtd.conf contains your Steam login data make sure it is only accessible to the root user:

chown root.root /etc/7dtd.conf
chmod 0600 /etc/7dtd.conf

Files in the sdtd-user folder owned by sdtd:

chown sdtd.sdtd /home/sdtd -R

Also make all other scripts only writable by root:

chown root.root /etc/init.d/
chown root.root /etc/bash_completion.d/7dtd
chown root.root /usr/local/bin/
chown root.root /usr/local/lib/7dtd -R
chmod 0755 /etc/init.d/
chmod 0755 /etc/bash_completion.d/7dtd
chmod 0755 /usr/local/bin/
chmod 0755 /usr/local/lib/7dtd -R

Bash completion

If you want to use auto completion for the scripts (i.e. pressing <TAB> to complete the current parameter, <TAB><TAB> to get a list of valid things in the current location) you have to enable Bash completion. At least on Debian this was not the default for the user root so the following line has to be added to /root/.bashrc:

. /etc/bash_completion

Install the game

Note: It seems like the 64 bit version of the game does not run nicely on Wine, thus the updater script automatically uses the 32 bit engine.

Run updateengine. To test the auto completion (if enabled) enter and press <TAB> twice. It should show you the allowed commands. Enter an additional up and press <TAB> once again and it should complete to updateengine.

This command will download and install SteamCMD to the SDTD_BASE/steamcmd and afterwards download 7DtD itself. You can later on always run this command again to update the 7DtD files if there is an update on Steam.

(Optional) Enable cron job for backups

If you want the system to automatically backup the instance configurations and game saves edit the file /etc/cron.d/7dtd-backup:

0 *     * * *   root    /usr/local/bin/ backup

(i.e. remove the hash character # from the start of the line).

First two columns specify on which minute (0) and which hour (* = every hour) the backup will be run. Next three specify day, month and day of week (you probably want to keep * here).

Initial setup done

You can now continue and setup instances...