← Back to Blog

How to Host a Terraria Server on a VPS (2026)

Published May 4, 2026  ·  6 min read  ·  Galaxy Cloud Solutions

Running a Terraria server on your own PC works until you close the game or your computer goes to sleep. A VPS keeps the world running 24/7 so your friends can dig in whenever they want without waiting for you. The setup takes about 20 minutes and a $5 VPS handles it comfortably.

⚡ Host a Terraria server from $5/mo — Use code LAUNCH2026 for 50% off

What You Need

We will use TShock, which is a Terraria server with built-in admin tools, plugin support, and better performance than the vanilla server.

Step 1: Install Dependencies

sudo apt update
sudo apt install -y wget unzip screen libicu-dev

Step 2: Download TShock

mkdir -p /opt/terraria && cd /opt/terraria
wget https://github.com/Pryaxis/TShock/releases/download/v5.2.0/TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip
unzip TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip
chmod +x TShock.Server

Step 3: Create a Start Script

cat > /opt/terraria/start.sh << 'EOF'
#!/bin/bash
cd /opt/terraria
screen -dmS terraria ./TShock.Server   -maxplayers 16   -port 7777   -world /opt/terraria/world.wld   -autocreate 2   -worldname GalaxyWorld
EOF
chmod +x /opt/terraria/start.sh

Step 4: Open the Firewall Port

sudo ufw allow 7777/tcp
sudo ufw allow 7777/udp

Step 5: Start the Server

/opt/terraria/start.sh

Check if it started:

screen -r terraria

The first time TShock starts, it generates a setup token in the console output. Use that token to set up your admin account in-game. Press Ctrl+A then D to detach from the screen session without stopping the server.

Connect From the Game

In Terraria, go to Multiplayer → Join via IP and enter your VPS IP address with port 7777. Your world will be there waiting.

Auto-Start After Reboot

Add this to your crontab so the server starts automatically if the VPS reboots:

crontab -e
@reboot sleep 15 && /opt/terraria/start.sh

Useful TShock Commands

One-click Terraria server installer included

Galaxy Cloud Solutions Nebula 1 plan ($5/mo) handles a Terraria server easily. One-click TShock installer in the dashboard. Use code LAUNCH2026 for 50% off your first month.

Get Started