Skip to main content
Back to Category

Terraria Server Setup: Dedicated Server Guide

Terraria dedicated server setup, tShock mod framework, world configuration, permission system, port forwarding and automatic backup.

Read time: 13 min Game Server Setup
terrariagame servertshockdedicated serverlinux

Table of Contents

Introduction

Terraria is a 2D sandbox action-adventure game combining exploration, building, combat, and crafting mechanics. By setting up your own dedicated server, you can play together with friends. This guide covers Terraria dedicated server and tShock mod framework setup on your REXE VDS.

System Requirements

ResourceMinimumRecommended
CPU2 Cores4+ Cores
RAM2 GB4+ GB
Disk5 GB SSD10+ GB NVMe
OSUbuntu 22.04+Ubuntu 22.04 LTS
Bandwidth3 Mbps5+ Mbps

Terraria server uses relatively low resources compared to other games. Even a small VDS can be sufficient.

Prerequisites

hljs bash
sudo apt update && sudo apt upgrade -y
sudo apt install -y wget unzip screen mono-complete

Create a server user:

hljs bash
sudo adduser terraria --disabled-login --gecos ""
sudo su - terraria

Vanilla Terraria Server Setup

Download Server Files

hljs bash
mkdir -p ~/terraria-server && cd ~/terraria-server
wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1449.zip
unzip terraria-server-1449.zip
mv */Linux/* .
chmod +x TerrariaServer.bin.x86_64

Server Configuration

hljs bash
nano ~/terraria-server/serverconfig.txt
hljs ini
world=/home/terraria/terraria-server/worlds/myworld.wld
autocreate=3
worldname=REXE_Terraria
difficulty=0
maxplayers=16
port=7777
password=
motd=Welcome to REXE Terraria Server!
worldpath=/home/terraria/terraria-server/worlds/
secure=1
language=en-US
npcstream=60
priority=1

Configuration Parameters

ParameterDescriptionValues
autocreateWorld size1=Small, 2=Medium, 3=Large
difficultyDifficulty0=Normal, 1=Expert, 2=Master, 3=Journey
maxplayersMax players1-255
portGame port7777 (default)
secureAnti-cheat1=Enabled

tShock is the most popular mod framework for Terraria servers, offering plugin support, permissions, and advanced management tools.

tShock Download and Installation

hljs bash
mkdir -p ~/tshock-server && cd ~/tshock-server
wget https://github.com/Pryaxis/TShock/releases/latest/download/TShock-5-2-0-for-Terraria-1-4-4-9-linux-x64-Release.zip
unzip TShock-*.zip
chmod +x TShock.Server

The tShock version must be compatible with your Terraria version. Check the GitHub releases page for the latest version.

tShock Configuration

Start the server once and stop it, then edit the configuration:

hljs bash
nano ~/tshock-server/tshock/config.json
hljs json
{
  "Settings": {
    "ServerPassword": "",
    "ServerPort": 7777,
    "MaxSlots": 16,
    "ServerName": "REXE Terraria Server",
    "SpawnProtection": true,
    "SpawnProtectionRadius": 10,
    "AntiCheat": true,
    "BackupInterval": 10,
    "BackupKeepFor": 240,
    "AutoSave": true,
    "RESTApiEnabled": true,
    "RESTApiPort": 7878
  }
}

Port Configuration

PortProtocolUsage
7777TCPTerraria game port
7878TCPtShock REST API (optional)

Firewall Rules

hljs bash
sudo ufw allow 7777/tcp comment "Terraria Game"
sudo ufw allow 7878/tcp comment "tShock REST API"

Auto-Start with systemd

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

[Service]
Type=simple
User=terraria
Group=terraria
WorkingDirectory=/home/terraria/tshock-server
ExecStart=/home/terraria/tshock-server/TShock.Server -port 7777 -maxplayers 16 -world /home/terraria/tshock-server/worlds/myworld.wld -autocreate 3
Restart=on-failure
RestartSec=10

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

tShock Permission System

Creating Super Admin

tShock displays a setup code on first start:

/setup SETUP_CODE
/user add USERNAME PASSWORD superadmin

Group Management

/group add moderator
/group addperm moderator tshock.admin.kick
/group addperm moderator tshock.admin.ban
/user group USERNAME moderator
CommandDescription
/kick playerKick a player
/ban playerBan a player
/tp playerTeleport to player
/item id amountGive item
/time daySet daytime
/godmodeGod mode
/butcherKill all enemies
/saveSave world

Plugin Installation

tShock plugins are copied to the ServerPlugins folder:

hljs bash
cp PluginName.dll ~/tshock-server/ServerPlugins/
sudo systemctl restart terraria

Popular plugins:

PluginDescription
InfiniteChestsUnlimited chests
RegionsRegion protection system
WorldEditWorld editing tools
SEconomyEconomy system
AutoBroadcastAutomatic message broadcast

Automatic Backup

hljs bash
nano ~/tshock-server/backup.sh
hljs bash
#!/bin/bash
BACKUP_DIR="/home/terraria/backups"
WORLD_DIR="/home/terraria/tshock-server/worlds"
DATE=$(date +%Y%m%d_%H%M%S)

mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/terraria_$DATE.tar.gz -C $WORLD_DIR .
find $BACKUP_DIR -name "terraria_*.tar.gz" -mtime +7 -delete
echo "$(date): Backup completed"
hljs bash
chmod +x ~/tshock-server/backup.sh
crontab -e
0 */4 * * * /home/terraria/tshock-server/backup.sh >> /home/terraria/backup.log 2>&1

Conclusion

Terraria dedicated server setup is simple and fast. With tShock mod framework for plugin support, permission system, and advanced management tools, you can provide a professional server experience. REXE VDS reliable infrastructure provides ideal performance for your Terraria server.