Tutorials

Terraria Server

Terraria is a classic 2D sandbox game with lightweight server requirements. This guide uses tShock, the most popular Terraria server wrapper that adds permissions, anti-cheat, and plugin support.

Requirements

  • A VPS running Ubuntu 20.04+ or Debian 11+
  • Root or sudo access
  • At least 1 GB RAM
  • At least 1 GB free disk space

1. Connect to Your Server

ssh root@YOUR_SERVER_IP

Or use the web terminal in the Sitequest dashboard.

2. Create a Terraria User

useradd -m -s /bin/bash terraria

3. Install tShock

Switch to the terraria user and download the latest tShock release:

su - terraria
mkdir -p ~/server && cd ~/server
curl -LO https://github.com/Pryaxis/TShock/releases/latest/download/TShock-5-for-Terraria-1.4.4.9-linux-x64-Release.zip
apt install -y unzip
unzip TShock-*.zip -d .
chmod +x TShock.Server

Check the tShock releases page for the latest download URL.

4. First Run

./TShock.Server -autocreate 3 -worldname "MyWorld" -port 7777

This creates a large world. Use -autocreate 1 for small or -autocreate 2 for medium. Press Ctrl+C to stop after the world generates.

5. Create a systemd Service

Exit back to root:

nano /etc/systemd/system/terraria.service
[Unit]
Description=Terraria tShock Server
After=network.target

[Service]
User=terraria
WorkingDirectory=/home/terraria/server
ExecStart=/home/terraria/server/TShock.Server -autocreate 3 -worldname "MyWorld" -port 7777
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable terraria
systemctl start terraria

6. Open Firewall Ports

Open TCP port 7777 in the Sitequest firewall.

With ufw:

ufw allow 7777/tcp

7. Connect

Open Terraria, go to Multiplayer > Join via IP, enter your server's IP and port 7777.

Next Steps

  • Set up tShock user groups and permissions via the in-game /setup command
  • Install tShock plugins from the official repository
  • Configure serverconfig.txt for detailed server settings
  • Set up automatic backups of ~/server/tshock/ and world files