Ubuntu / Raspbian TShock Server

December 13, 2020

I recently purchased an Intel NUC10i3FNK to use as a home server. I loaded it up with Ubuntu and have been working on a variety of projects (which I plan to post about soon). I decided to make use of my spare processing power to run a Terraria server for my friends and I.

Most of the tutorials I found online for running a Terraria server on Linux were pretty dated, so I decided to write some bash scripts to wrap everything together. I used James Chamber’s Minecraft scripts as a starting point and expanded upon them to make everything work with Terraria. I went with TShock to run the server, which provides a host of different tools. I have tested my scripts on both Ubuntu Server 20.04.1 and Raspbian Lite Buster.

To get started, all you need is to open a terminal and type:

wget https://raw.githubusercontent.com/jacob-eaton/TShock-Bash-Scripts/main/setupTerraria.sh

chmod +x setupTerraria.sh

./setupTerraria.sh

The script will walk you through the process of setting up the server and will save your inputs for the future. The server can be started and stopped using the following commands:

cd ~/terraria
./start.sh
./stop.sh

-- or --

sudo systemctl start terraria
sudo systemctl stop terraia

You can find your world files with the following command:

cd ~/.local/share/Terraria/Worlds/

Don’t forget to port forward your server! Terraria will run on TCP port 7777 by default.

I am still relatively new to writing bash scripts, so this was a great experience to learn more. I’ve always found that I learn the most when I shoot for a project that is out of my wheelhouse. I plan to update these scripts as new versions of TShock are released. Everything can be found at my repository here.

~ JHE

Return

About Me

Me!

  I am a Mechanical Engineering graduate of the University of Cincinnati. I enjoy working with my hands and programming. I am currently working on a variety of projects that you will find here.

Jacob H. Eaton

Research Engineer