Setting up a Terraria server is very simple and can be done very quickly. First, we need to complete a few steps.
You will need an IP address to play with other players. Follow this guide to purchase one for your Shell.
Update and install tools:
sudo apt update
sudo apt install -y wget tmux unzip
Download the latest version of the Terraria server software at the following link:
Once downloaded, within the downloads folder, run the following command
Unzip <Name of the downloaded server file>
Navigate to the directory:
cd 1412
cd Linux
Add executable permissions
sudo chmod +x TerrariaServer.bin.x86*
Launch the server
./TerrariaServer.bin.x86_64
Finally,
~/.local/share/Terraria/Worlds/
The screenshot above lists the new world I created "Hworld". To create your own type "n" and it will prompt you for a name and difficulty level.
Set the maximum number of players: I set mine to the max of 16
Set the port: Hit enter to use the default, 7777.
Enable port forwarding: type "y"
Set your password: I entered none since I prefer no passwords for my server.
To connect to the server, simply Launch Terraria and select multiplayer > join via IP. Then select a player and when asked for an IP type "localhost"
And that's it, happy gaming!