wiki:Installation

Version 2 (modified by Christian Illy, 11 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.

Prerequisites

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/sdtd
home for the user running the server and base path for the server management script system
/home/sdtd/backup
by default backups of game data files will go here
/usr/local/bin/7dtd.sh
Management script entry point
/usr/local/lib/7dtd/
Base path of script components
/etc/7dtd.conf
Global configuration options
/etc/bash_completion.d/7dtd
Bash-completion configuration to auto-complete the commands for the scripts
/etc/cron.d/7dtd-backup
Cron job for game backups
/etc/init.d/7dtd.sh
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:
    wget http://illy.bz/fi/7dtd/management_scripts.tar.gz
    
  2. Extract the files to /:
    tar -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 7dtd.sh defaults
    

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 7dtd.sh updateengine. To test the auto completion (if enabled) enter 7dtd.sh 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/7dtd.sh 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...

Note: See TracWiki for help on using the wiki.