How to Set Up a Terraria Dedicated Server
Keep your Terraria world online for friends around the clock. Install the dedicated server on Linux, configure serverconfig.txt and open port 7777.
Terraria is light to host but so much better with a persistent world โ friends can build and explore whenever they like, without waiting for a host to be online. A small VPS handles it comfortably. Here's the setup.
How much power you need
Terraria is one of the least demanding games to host:
- 2โ4 players: 1 GB RAM, 1 vCPU is plenty.
- 8+ players or heavily modded (tModLoader): 2โ4 GB RAM.
The world file is small and CPU load is modest, which makes Terraria a great first game server.
Step 1: Prepare the system
sudo apt update && sudo apt install unzip screen -y
sudo adduser --disabled-password terraria
sudo su - terraria
Step 2: Download the dedicated server
Terraria's official dedicated server is a free download from terraria.org. Copy the current Linux ZIP URL, then:
wget -O terraria.zip "PASTE_TERRARIA_SERVER_URL"
unzip terraria.zip
cd */Linux
chmod +x TerrariaServer.bin.x86_64
Step 3: Create a config file
Running interactively is fine, but a config file makes restarts painless. Create serverconfig.txt:
world=/home/terraria/.local/share/Terraria/Worlds/myworld.wld
autocreate=3
worldname=MyWorld
difficulty=1
maxplayers=8
port=7777
password=changeme
autocreate=3 generates a large world if one doesn't exist; difficulty=1 is Expert. Remove autocreate once your world exists so it just loads.
Step 4: Start the server
screen -S terraria
./TerrariaServer.bin.x86_64 -config serverconfig.txt
Detach with Ctrl+A then D. The console accepts commands like say, kick and save if you reattach.
Step 5: Open the port
Terraria uses TCP port 7777:
sudo ufw allow 7777/tcp
Step 6: Join
In game, choose Multiplayer โ Join via IP, enter your VPS IP and port 7777, and the password if you set one.
Modded servers with tModLoader
For mods, run tModLoader instead of the vanilla server โ it's a separate free download (also on Steam) with its own Linux server binary. Every player must have the same tModLoader version and enabled mods, so share your mod list. Modded worlds use more RAM, so bump to 2โ4 GB.
Backing up your world
Worlds live in ~/.local/share/Terraria/Worlds/. Because they're tiny, back them up often โ a simple daily copy costs nothing:
cp ~/.local/share/Terraria/Worlds/myworld.wld ~/backups/myworld-$(date +%F).wld
Use the server's save command or stop it first for a clean copy.
Admin commands and moderation
The Terraria server console accepts commands directly โ reattach to your screen session and type them. The most useful:
say Hello everyone
kick PlayerName
ban PlayerName
password newpassword
save
exit
exit saves and shuts down cleanly, which is the right way to stop the server rather than killing the process. You can change the join password live without a restart, handy if it leaks.
Journey vs Classic worlds
When you set autocreate, the world's difficulty is fixed at creation. difficulty=0 is Classic, 1 is Expert, 2 is Master, and 3 is Journey โ Journey mode lets players adjust settings like enemy difficulty and time on the fly, which is great for a relaxed co-op server. Pick this deliberately, because you can't change a world's mode after it's generated.
Common issues
- Players can't connect: confirm TCP 7777 is open and you're sharing the right IP.
- World resets each restart: remove the
autocreateline once the world exists so it loads instead of regenerating. - Modded players rejected: everyone must run the same tModLoader version and enabled mod set.
The easy way
Because Terraria is so light, it's an ideal candidate for a small, affordable VPS slice โ and Nxeon's NVMe storage means world saves and player joins are instant even on the smallest plan. Full root lets you swap in tModLoader whenever you want to go modded, and a one-click Terraria deploy gets a vanilla world online in about a minute.