Some material for a Linux tutorial. You can copy and edit it if you want @Zak
Setting up SteamCMD:
If you are running a 64-bit operating system, install glibc-32bit:
On Ubuntu / Debian 64-bit:
sudo apt-get install lib32gcc1
On Archlinux 64-bit:
pacman -S lib32-gcc-libs
On Fedora / CentOS / RHEL etc.:
yum install glibc.i686 libstdc++.i686
On openSUSE:
zypper in glibc-32bit
It is a got idea to create a separate user for your steam applications. Do not run steam as a root due to Steam potentially having security issues that could harm your system.
useradd -m steam
Then login as your steam user:
sudo su - steam
Navigate to steam’s home folder and create a directory for SteamCMD:
cd ~
mkdir steamcmd
cd steamcmd
Download SteamCMD:
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
Extract the archive:
tar xzvf steamcmd_linux.tar.gz
Installing Tower Unite:
To make updating the game easier we will create a script that will update the game every time we run it. But first we need to create a dummy account for downloading the Tower Unite dedicated server.
- Open the steam homepage in a Private / Incognito Tab with your favourite web browser.
- Create a new steam account with a random name and password.
- Deactivate Steam Guard for convenience.
- Navigate to Tower Unite Dedicated Server on Steam in your private browser tab and click on Play Now
Back in your terminal create a directory for Tower Unite. (You still should be logged in as your steam User):
mkdir tu
Now we can create our update script:
Navigate to your home directory and create a new file with nano.:
cd ~
nano update_tu.sh
Type in the following. Make sure to edit your login data aswell as your paths:
#!/bin/bash
/path/to/your/steamcmd-folder/steamcmd.sh +login your_dummy_username your_dummy_password +force_install_dir /your/tu/directory + app_update 439660 validate +quit
Save your script by hitting Ctrl+O, then enter, followed by Ctrl+X.
Make your script executable:
chmod +x update_tu.sh
Finally run your script:
./update_tu.sh
Running Tower Unite Dedicated Server
For even more convenience we will create a script for the running Tower Unite server. To make things even easier I will make sure that the script always runs as the user Steam. But first we need to copy a file to make the server work:
cd yourTowerUniteFolder
cp linux64/steamclient.so Tower/Binaries/Linux/
Create your script using nano:
cd ~
nano run_tu.sh
Add the following to your script:
#!/bin/bash
/path/to/your/TU-folder/Tower/Binaries/Linux/TowerServer-Linux-Shipping -log
Save your script by hitting Ctrl+O, then enter, followed by Ctrl+X.
Again make your script executable:
chmod +x run_tu.sh
We just created the script for actually running the script. However you shouldn’t run it directly as this would mean that the server is not running as the Steam server. Therefore we have to create another script that you can run as any user.
First logout of the steam user:
exit
Then create a new script for running TU as any user:
nano run_tu_as_steam.sh
Add the following:
#!/bin/bash
su steam --shell /path/to/your/runscript-as-steam.sh
Now you can start your server:
sudo ./run_tu_as_steam.sh
Running the server 24/7
You can start your server using screen to keep it running all the time. First you have to ensure that screen is installed:
On Ubuntu / Debiant:
sudo apt-get install screen
On Archlinux:
pacman -S screen
On Fedora / CentOS / RHEL etc.:
yum install screen
On openSUSE:
zypper in screen
Create a new screen with:
screen -R tu
Then start your server:
sudo ./run_tu_as_steam.sh
Exit your screen by pressing Ctrl+A followed by Ctrl+D.
Check if the server is running using top.
Automatically rebooting and updating the server
You can set up cronjobs to handle automatic updates and regular server reboots.
- Log in as root using su or sudo -i.
- Enter crontab -e to edit your cronjobs.
- Navigate to the bottom of the configuration file
- Add _0 4 * * * killall TowerServer-Lin && /path/to/update-script/update_tu.sh && /path/to/run-script/run_tu_as_steam.sh
This will stop the server every day at 4 am, check for updates and start it again.