
How to Set Up a Terraria Server: Vanilla, TShock and tModLoader
Set up a Terraria server on a Linux VDS: vanilla server, TShock and tModLoader installs, moving an existing world, autostart and mod management.
How to Set Up a Terraria Server
There are three ways to run a Terraria server: the vanilla server, TShock with its administration plugins, and tModLoader for modded play. This guide covers all three, plus moving your existing world onto the server.
1. Preparing the System
sudo apt update && sudo apt upgrade -y
sudo apt install -y unzip screen curl
sudo useradd -m -s /bin/bash terraria
sudo su - terraria2. Vanilla Server Installation
Download and extract the Terraria server package:
mkdir -p ~/terraria && cd ~/terraria
# extract the official server package into this directory
chmod +x TerrariaServer.bin.x86_64Create a configuration file (serverconfig.txt):
world=/home/terraria/.local/share/Terraria/Worlds/world.wld
autocreate=2
worldname=MyServer
difficulty=1
maxplayers=16
port=7777
password=
motd=Welcome to our server
| Setting | Values |
|---|---|
| autocreate | 1 = small, 2 = medium, 3 = large world |
| difficulty | 0 = classic, 1 = expert, 2 = master |
Starting the server:
./TerrariaServer.bin.x86_64 -config serverconfig.txt3. TShock: Administration and Plugins
TShock replaces the vanilla server and brings administration commands, a permission system and database support. Creating an admin account:
/user add username password owner
Ban management, region protection and automatic backups are far easier on a TShock server.
4. tModLoader: a Modded Server
tModLoader is a separate server package (App ID 1281930):
./steamcmd.sh +force_install_dir ~/tmodloader-server +login anonymous +app_update 1281930 validate +quitMods go into ~/.local/share/Terraria/tModLoader/Mods and get enabled in enabled.json.
⚠️ Large mod packs such as Calamity push world generation into the minutes range and multiply memory usage several times over. For a modded server, budget at least twice what you calculated for vanilla.
5. Moving an Existing World to the Server
Your local world file lives here:
- Windows:
Documents\My Games\Terraria\Worlds - Linux:
~/.local/share/Terraria/Worlds
Copy the .wld file into the same directory on the server and update the world line in serverconfig.txt. Make sure the server is stopped while you copy.
6. Ports
| Port | Protocol | Purpose |
|---|---|---|
| 7777 | TCP | Game traffic |
sudo ufw allow 7777/tcp7. Autostart
[Unit]
Description=Terraria Server
After=network.target
[Service]
Type=simple
User=terraria
WorkingDirectory=/home/terraria/terraria
ExecStart=/home/terraria/terraria/TerrariaServer.bin.x86_64 -config serverconfig.txt
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target8. Backups
tar czf /backup/terraria_$(date +%F).tar.gz ~/.local/share/Terraria/WorldsTaking a manual backup before a boss fight makes it easy to roll back after an attempt that goes badly.
Conclusion
Setting up a Terraria server is light and fast. An economical game server package is more than enough for vanilla. The real resource demand only shows up with tModLoader and large mod packs.
👉 See our Terraria server hosting page to match a package.