7 Days to Die logo

Running a 7 Days to Die server on CentOS 7

A brief guide on setting up a dedicated 7D2D server, complete with a dynamic browser map of the world.

Requirements:

  • Working CentOS install
  • Steam account with 7 Days 2 Die

Setup the account:

The first few steps need to be done with an account that has sudo privelidges on the server. Info on this can be found in the EC2 Series guide.

  1. Using Virtualmin, create a new virtual server. This guide will assume the following:

    • user is called 7d2d
    • home directory is /home/7d2d
    • domain is 7d2d.example.com
    • quota is 10GB
  2. Install the required libraries from yum:
    sudo yum install -y glibc.i686 libstdc++.i686 screen

  3. Open the necessary firewall ports for Steam, the game server, and the webmap with the following commands:
    sudo firewall-cmd --zone=public --add-port=26900/tcp --permanent
    sudo firewall-cmd --zone=public --add-port=26900/udp --permanent
    sudo firewall-cmd --zone=public --add-port=8082/tcp --permanent
    sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
    sudo firewall-cmd --reload

  4. Increase the open file limits for the 7d2d user.
    sudo vi /etc/security/limits.conf
    Append the following to the bottom of the file:
    7d2d       hard       nofile       100000
    7d2d       soft       nofile       100000

    You must restart your session for the changes to take effect.

Switch to the new account

Now we've got the account setup we can install the actual game.

  1. Switch to the new account and navigate to it's home directory with:
    cd /home/7d2d

  2. Make a directory to install Steam
    mkdir steam

  3. Move into the directory
    cd steam

  4. Get and extract SteamCMD
    wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
    tar xvf steamcmd_linux.tar.gz
    rm steamcmd_linux.tar.gz

  5. Run SteamCMD:
    ./steamcmd.sh

  6. When Steam has loaded we need to login. If you use Steam Authenticator (as you should) get your 2FA code ready and do the following:
    login steamUsername
    *enter password*
    *enter 2fa code*
    force_install_dir ./7d2d
    app_update 294420 validate
    This can take a while. If you forgot to increase the user quote when creating the account you may receive an error about reaching the block limit. When it has finished, exit SteamCMD by typing:
    quit

  7. When it's finished installing we'll create a script to launch the game and bind it to a screen session. Use your favourite method (vi, FTP, etc) to create the file:
    /home/7d2d/launch.sh
    Insert the following into the file:

    #!/bin/sh
    screen -S 7d2d steam/7d2d/7DaysToDieServer.x86_64 -logfile output_log.txt -quit -batchmode -nographics -dedicated -configfile=serverconfig.xml

    Make it executable:
    chmod +x launch.sh

  8. Setup the /home/7d2d/steam/7d2d/serverconfig.xml file with your server settings. Some notes on the settings to change: Property Values Note
    ServerIsPublic true/false
    ServerPassword (optional)
    ServerMaxPlayerCount Adjust according to server resources and playerbase.
    ServerWebsiteURL Put your website URL here if you have one
    ServerDescription A description of your server goes here
    GameWorld Navezgame, Random Gen Must be one or the other. To make a random world choose "Random Gen" and set the GameName property to something unique.
    GameName Control the random seed when using "Random Gen" GameWorld type.