Terraria Server Setup: Dedicated Server Guide
Terraria dedicated server setup, tShock mod framework, world configuration, permission system, port forwarding and automatic backup.
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
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 Cores | 4+ Cores |
| RAM | 2 GB | 4+ GB |
| Disk | 5 GB SSD | 10+ GB NVMe |
| OS | Ubuntu 22.04+ | Ubuntu 22.04 LTS |
| Bandwidth | 3 Mbps | 5+ Mbps |
Terraria server uses relatively low resources compared to other games. Even a small VDS can be sufficient.
Prerequisites
sudo apt update && sudo apt upgrade -y
sudo apt install -y wget unzip screen mono-complete
Create a server user:
sudo adduser terraria --disabled-login --gecos ""
sudo su - terraria
Vanilla Terraria Server Setup
Download Server Files
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
nano ~/terraria-server/serverconfig.txt
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
| Parameter | Description | Values |
|---|---|---|
| autocreate | World size | 1=Small, 2=Medium, 3=Large |
| difficulty | Difficulty | 0=Normal, 1=Expert, 2=Master, 3=Journey |
| maxplayers | Max players | 1-255 |
| port | Game port | 7777 (default) |
| secure | Anti-cheat | 1=Enabled |
tShock Setup (Recommended)
tShock is the most popular mod framework for Terraria servers, offering plugin support, permissions, and advanced management tools.
tShock Download and Installation
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:
nano ~/tshock-server/tshock/config.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
| Port | Protocol | Usage |
|---|---|---|
| 7777 | TCP | Terraria game port |
| 7878 | TCP | tShock REST API (optional) |
Firewall Rules
sudo ufw allow 7777/tcp comment "Terraria Game"
sudo ufw allow 7878/tcp comment "tShock REST API"
Auto-Start with systemd
sudo nano /etc/systemd/system/terraria.service
[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
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
Popular tShock Commands
| Command | Description |
|---|---|
| /kick player | Kick a player |
| /ban player | Ban a player |
| /tp player | Teleport to player |
| /item id amount | Give item |
| /time day | Set daytime |
| /godmode | God mode |
| /butcher | Kill all enemies |
| /save | Save world |
Plugin Installation
tShock plugins are copied to the ServerPlugins folder:
cp PluginName.dll ~/tshock-server/ServerPlugins/
sudo systemctl restart terraria
Popular plugins:
| Plugin | Description |
|---|---|
| InfiniteChests | Unlimited chests |
| Regions | Region protection system |
| WorldEdit | World editing tools |
| SEconomy | Economy system |
| AutoBroadcast | Automatic message broadcast |
Automatic Backup
nano ~/tshock-server/backup.sh
#!/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"
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.
Related Articles
How to Set Up a FiveM Server: Step-by-Step Guide
Complete FiveM server setup guide on REXE VDS: installation, txAdmin configuration, port settings, and performance optimization tips for GTA V roleplay servers.
How to Set Up a Minecraft Server: Paper Installation Guide
Complete Minecraft server setup guide on REXE VDS: Paper/Spigot installation, Java configuration, plugin management, and performance optimization for stable gameplay.
How to Set Up a CS2 Dedicated Server: Complete Guide
Complete CS2 dedicated server setup guide on REXE VDS: SteamCMD installation, GSLT token, server configuration, game modes, and DDoS protection with Path Panel.