Running Server76 on Debian

A simple step-by-step guide for setting up Server76 on Debian

Preparing the server

This guide presumes that we’re starting from a minimalist Debian LXC container, setting up the username server76 and the installation path /opt/server76/. From within a root shell simply run the following commands to create the user and the directory.

useradd -m -d /opt/server76/ -G sudo -s /sbin/nologin server76 && mkdir /opt/server76 && chown -R server76:server76 /opt/server76

By adding the user to the group sudo the user will be able to run commands as root later which will ease up the installation process.

The user needs a password so supply one with the passwd command. If you’re feeling lucky, you can also delete the randomized password by running passwd with the parameter -d. Be aware that deleting the password will lead to security nightmares if there is ever an RCE exploit for Server76.

passwd server76

Installing components

Install necessary packages and add support for i386 packages (needed for steamcmd). Make sure to have Debian’s non-free component activated in your sources.list if you want to install steamcmd.

dpkg --add-architecture i386
apt update
apt install wget p7zip sudo nano anacron steamcmd:i386

Server76 currently needs Microsoft .NET 8 to run, so get it from the official sources by adding their repository.

wget https://packages.microsoft.com/config/debian/$(cut -d. -f1 /etc/debian_version)/packages-microsoft-prod.deb && apt install ./packages-microsoft-prod.deb && rm packages-microsoft-prod.deb

Update Debian’s package archive and install the Microsoft .NET runtime.

apt update && apt install dotnet-runtime-8.0

Now change the directory to /opt/server76 and run a shell you like as server76.

cd /opt/server76 && su -s /bin/bash server76

Installing Server76

Fetch the latest version of Server76 with the following command.

wget https://myfo.online/releases/linuxrelease_$(date -I).7z

If wget returns a 404, check out the project’s discord for a new download URL. At the time of writing they were storing their releases with a simple ISO formatted date suffix.

Extract the archive’s content to the subdirectory bin with p7zip. The directory doesn’t have to exist, it will be created automatically if needed.

7zr x -obin linuxrelease_$(date -I).7z

Remove the archive if you don’t like to waste space and make the binary executable with chmod.

rm linuxrelease_$(date -I).7z && chmod +x bin/Server76.Server

Placing data files for Server76

Now dump your Fallout76 1.4.1.6 ESM and BA2 files into the ServerData directory /opt/server76/bin/ServerData. If you need to upload them from a remote location, keep in mind that you might have to enable login for the user if you want to use rsync or scp/sftp.

If you want to use steamcmd, modify the following script to represent your login data and save it as ~/download_f76:

login <user> <password>
download_depot 1151340 1151343 9006394379407093964
download_depot 1151340 1151342 1065890720657377764

Launch the script with /usr/games/steamcmd +runscript ~/download_f76. If you’ve activated 2FA for your Steam account, you’ll be asked for your Steam Guard code. It’ll take a while until everything’s downloaded.

Once the downloads have finished, you may move the files to the directory mentioned above and tidy up your downloads. Don’t forget to remove or protect the above script because you probably don’t want to have your Steam account’s credentials lying around in plain text.

find ~/.local/share/Steam/steamcmd/linux32/steamapps/content/app_1151340/ -type f -iname *.esm -exec mv {}  ~/bin/ServerData/ \; -o -iname *.ba2 -exec mv {} ~/bin/ServerData/ \;
rm -r ~/.local/share/Steam/steamcmd

First run and bug hunt

Run the server ~/bin/Server76.Server once to let it build initial structures. This will take a while. If it fails with an error message suggesting that CSV files could not be found because the devs once forgot that Linux is case-sensitive, add a symlink with ln -s /opt/server76/bin/ServerData/CSV /opt/server76/bin/ServerData/csv. It also may fail because of a missing override directory so create one with mkdir -p /opt/server76/bin/ServerData/overrides. You may stop the process when you spot Verbose: World State Service ready....

Creating a service

Now add a systemd service for Server76. This allows us to start/stop/restart Server76 without lousy tricks like screen or tmux and adds a nice way of logging. Additionally, it automatically restarts Server76 if something went wrong.

sudo nano /etc/systemd/system/server76.service

Add the following contents to the newly created service file:

[Unit]
Description=Server76 - a stand-alone private Fallout76 server
After=network.target

[Service]
ExecStart=/opt/server76/bin/Server76.Server
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
User=server76
#Nice=-5

[Install]
WantedBy=multi-user.target

The process’s priority can be elevated by lowering the niceness. A niceness of -5 might be a good start, so you might try to remove the # when Server76 runs choppy.

Now it’s time to reload systemd, enable our new service and start it.

sudo systemctl daemon-reload
sudo systemctl enable server76
sudo systemctl start server76

Server76 will now automatically start when Debian boots up. You can check it’s status with sudo systemctl status server76 or it’s stdout log with sudo journalctl -u server76.service. Add the user server76 to the group adm if you want to omit sudo for journalctl.

Add auto-update (not tested yet!)

While not necessary, one might find joy in having a fresh copy of Server76 delivered on a daily or weekly basis. To simplify the process we’ve already installed anacron above. Just throw the below script in one of the /etc/cron.*-directories (e. g. /etc/cron.daily or /etc/cron.weekly).

#!/bin/bash
SRVDIR="/opt/server76/bin"
ZIPFILE=$(mktemp --suffix .7z)
systemctl stop server76
wget https://myfo.online/releases/linuxrelease_$(date -I).7z -O $ZIPFILE
7zr x -o$SRVDIR -aoa $ZIPFILE
rm $ZIPFILE
chown -R server76:server76 $SRVDIR
chmod +x $SRVDIR/Server76.Server
systemctl start server76

Don’t forget to make the script executable. To disable auto-updating again, just remove the executable bit of the file.

This guide also seem to work on free tier Oracle cloud servers with Ubuntu, so go for it if you’re feeling lucky. Be sure to add at least 2 GB of swap space if you choose the VM.Standard.E2.1.Micro shape.