In this project we will be walking you through all the steps to set up your very own Raspberry Pi Terraria server, allowing you to set up a low cost and energy efficient Terraria server.
This project is made possible thanks to two open source initiatives, the first of those being the tShock Terraria server.
This project implements everything you need to set up your own dedicated Terraria server and is the main piece of software we will be utilizing on the Raspberry Pi.
The second piece of software that we will be using is Mono, this is an open source implementation of the .net framework and allows us to run applications such as tShock on the Raspberry Pi.
Below are all the bits and pieces that I used for this Raspberry Pi Terraria Server tutorial.
Raspberry Pi 2 or 3
Setting up Mono for the Terraria Server
In this tutorial, we will be setting up a Terraria Server on the Raspberry Pi. We achieve this by utilizing the Tshock server software.
This software normally wouldn’t run without Microsoft’s .net framework but thanks to the Mono project we can bypass that by using their open source implementation of the framework.
1. Now before we get started with setting up the Terraria server software on our Raspberry Pi, we will need to ensure our Raspberry Pi is entirely up to date by running the following command.
sudo apt-get update sudo apt-get upgrade
2. With the Raspberry Pi up to date, we will now need to setup and install the Mono software. For those who don’t know Mono is open source implementation of Microsoft’s .NET Framework which is what the TShock server software relies on. Thanks to Mono we can get it running on the Raspbian operating system.
Now to install Mono, we must first add the Ubuntu key server, without this key server we can’t grab Mono from the Mono Project repository. To add this keyserver, we need to utilize the following command.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
3. With the key server now added to our package manager, we need to grab the Mono Projects repository.
We can do this by running the following command on our Raspberry Pi. This command will add the package to a particular list that will be automatically loaded in by the package manager.
echo "deb http://download.mono-project.com/repo/debian stretch main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
4. Now that we have added this additional repository to our sources list we need to run another update and upgrade.
We do this so that the Mono software package will become available to us in our packages list. Run the following two commands on the Raspberry Pi to do this.
sudo apt-get update sudo apt-get upgrade
5. Once the update has completed, we can finally install the Mono software by running the following command in our Raspberry Pi’s terminal.
sudo apt-get install mono-complete
Setting up a Raspberry Pi Terraria Server
1. Now that we have Mono installed onto our Raspberry Pi we can proceed with actually setting up the Raspberry Pi Terraria server. For this, we will be utilizing the TShock server software.
In this tutorial we will be doing this entirely on the command line, however, to ensure you get the latest release of the TShock software we recommend going to TShocks Github page and grabbing the most recent download link.
Before we download the Terraria server software to our Raspberry Pi, we will first make a folder to keep it in and then change directory into it. We can just do that by running the following two commands.
mkdir ~/tshock cd ~/tshock
2. Now that we are in our newly created folder let’s download the Terraria server software to our Raspberry Pi by running the following command. The version we are downloading is 4.3.25 for Terraria 126.96.36.199
We can download the software by running the following command on our Raspberry Pi.
3. We can now extract the zip file by running the following command on our Raspberry Pi. While unzip comes by default on the base Raspbian installation you may have to install it on slimmer installations.
4. With the TShock server extracted we can finally run the server using Mono. To do this, we need to run the following command on the Raspberry Pi while we are in our tshock folder.
5. You will be taken through several steps to set up your Terraria world on the Raspberry Pi. We recommend starting with a small world as larger worlds can cause the Raspberry Pi to freeze up during the generation process. Take note of the name of your world
After the generation has completed, you will go back to the main menu of the command line, simply enter the number the name of your world is next to and press enter. You will again be asked for a few more details but, it is usually safe to just press Enter to go past them.
You should now have a fully working Terraria server and be able to successfully connect to it from your device. If you have run into any issues or want to leave some feedback on this tutorial, then feel free to drop us a comment on our forums.