Setting Up a Terraria Server with TShock
TShock is the most popular Terraria server mod, adding player management, permissions, and many admin tools.
Step 1 — Install .NET Runtime
wget https://dot.net/v1/dotnet-install.sh
bash dotnet-install.sh --channel 6.0
echo 'export PATH="$HOME/.dotnet:$PATH"' >> ~/.bashrc
source ~/.bashrc
Step 2 — Download TShock
mkdir ~/terraria && cd ~/terraria
wget https://github.com/Pryaxis/TShock/releases/download/v5.2.0/TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip
unzip TShock-*.zip
chmod +x TShock.Server
Step 3 — Create a Startup Script
nano ~/start-terraria.sh
#!/bin/bash
cd ~/terraria
./TShock.Server -world ~/terraria/worlds/MyWorld.wld -autocreate 2 -worldname MyWorld -port 7777 -maxplayers 16
chmod +x ~/start-terraria.sh
Step 4 — Open Firewall Port
ufw allow 7777/tcp
Step 5 — Start the Server
screen -S terraria ~/start-terraria.sh
On first start, TShock will generate the world and display a setup token — use it to set up the admin account.
Key TShock Admin Commands (in-game console)
/login adminpassword # Login as admin
/ban add PlayerName # Ban a player
/kick PlayerName Reason # Kick a player
/give PlayerName 75 999 # Give items
/tp PlayerName # Teleport to player