Desert Forge IT — Game Hosting from $2/weekGet a Server →

How to Self-Host a Terraria Server on Proxmox LXC

Intermediate 30 min — Run a persistent TShock Terraria server in a lightweight container.

Prerequisites

  • Proxmox VE 7+ installed and accessible via web UI
  • A Debian 12 (Bookworm) LXC template downloaded in Proxmox
  • Basic Linux command-line knowledge
  • Network access to port 7777 from player clients

1. Create the LXC Container

From the Proxmox shell (or SSH into your host), create a new container. Adjust the storage and ID as needed:

pct create 200 local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst \
  --hostname terraria \
  --cores 1 \
  --memory 1024 \
  --swap 512 \
  --rootfs local-lvm:8 \
  --net0 name=eth0,bridge=vmbr0,ip=dhcp \
  --unprivileged 1 \
  --start 1

This creates a container with 1 CPU core, 1GB RAM, and 8GB disk. Terraria servers are single-threaded, so 1 core is fine. For large worlds or many players, bump memory to 2GB.

2. Install Dependencies

Enter the container and install the required packages:

pct enter 200
apt update && apt upgrade -y
apt install -y unzip wget screen libicu72

libicu72 is required by TShock's .NET runtime. screen is optional but useful for attaching to the server console.

3. Download TShock

TShock is the most popular Terraria server wrapper. It adds permissions, anti-cheat, and server management commands. Download the latest release:

mkdir -p /opt/terraria && cd /opt/terraria

# Check https://github.com/Pryaxis/TShock/releases for latest version
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-*.zip
rm TShock-*.zip
chmod +x TShock.Server

Verify it runs:

./TShock.Server -h

4. Configure the Server

Create a server config file:

cat > /opt/terraria/serverconfig.txt << 'EOF'
world=/opt/terraria/worlds/world1.wld
worldname=world1
autocreate=2
worldpath=/opt/terraria/worlds
port=7777
maxplayers=8
password=
difficulty=0
motd=Welcome to the server! Hosted with TShock.
language=en-US
npcstream=15
secure=1
EOF

mkdir -p /opt/terraria/worlds

Key settings:

  • autocreate=2 — creates a Medium world if the world file doesn't exist (1=Small, 2=Medium, 3=Large)
  • difficulty=0 — 0=Classic, 1=Expert, 2=Master, 3=Journey
  • password — leave blank for no password, or set one for private servers
  • maxplayers — Terraria supports up to 255, but 8-16 is typical for LXC

5. Create a systemd Service

Create a systemd unit so the server starts on boot and restarts on crash:

cat > /etc/systemd/system/terraria.service << 'EOF'
[Unit]
Description=TShock Terraria Server
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/terraria
ExecStart=/opt/terraria/TShock.Server -config /opt/terraria/serverconfig.txt -logpath /opt/terraria/logs
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

mkdir -p /opt/terraria/logs
systemctl daemon-reload
systemctl enable terraria

6. Start and Test

systemctl start terraria
systemctl status terraria

Check the logs:

journalctl -u terraria -f

On first start, TShock will generate the world (this takes 30-60 seconds). You'll see Server started when it's ready. Open Terraria, go to Multiplayer > Join via IP, and enter your server's IP address with port 7777.

7. Firewall Rules

If you're using Proxmox's built-in firewall or ufw, allow port 7777:

# On the Proxmox host (if using host firewall)
iptables -A INPUT -p tcp --dport 7777 -j ACCEPT

# Or if using ufw inside the container
ufw allow 7777/tcp

If your server is behind a NAT router, forward port 7777 TCP to the container's IP address.

8. Backups

Your world files live in /opt/terraria/worlds/. Back these up regularly. A simple cron job:

crontab -e
# Add this line to back up every 6 hours:
0 */6 * * * tar czf /opt/terraria/backups/world-$(date +\%Y\%m\%d-\%H\%M).tar.gz /opt/terraria/worlds/
Want automatic backups?

Desert Forge Backup handles world file backups automatically with AES-256 encryption and zero egress fees.

Set up Backup

9. Troubleshooting

  • Can't connect: Check the firewall, verify the container has network access (ping 8.8.8.8), and confirm the server is listening (ss -tlnp | grep 7777).
  • World corruption: If the world file gets corrupted, TShock keeps backups in the worlds directory with .bak extensions. Rename one to restore.
  • Out of memory: If the server crashes with OOM errors, increase the container memory to 2GB in Proxmox (shutdown first: pct set 200 --memory 2048).
  • libicu missing: If TShock fails with a globalization error, install the correct libicu version for your Debian release: apt install libicu72 (Bookworm) or libicu67 (Bullseye).
  • Permission denied: Make sure TShock.Server is executable: chmod +x /opt/terraria/TShock.Server.
Don't want to manage all this?

Desert Forge Game Hosting gives you a Terraria server with one click — from $2/week, no Linux required.

Get a server

← Back to all guides