Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Install Guides
  6. /
  7. How To Install Terraria Server Ubuntu
GUIDEInstall Guides

How to Install Terraria Dedicated Server on Ubuntu 24.04 VPS: TShock & Vanilla Setup

25 min read

How to Install Terraria Dedicated Server on Ubuntu 24.04 VPS: TShock & Vanilla Setup

Running your own Terraria dedicated server gives you a persistent world that stays online even when you log off, lets you invite friends without forwarding ports on your home router, and unlocks community features like admin commands, anti-grief protection, and custom plugins. This guide walks you through installing both the vanilla Re-Logic server and the popular TShock replacement on an Ubuntu 24.04 VPS, from first SSH connection to a production-hardened deployment with automatic backups.

Want to launch faster? Deploy on the CloudCore Starter plan and follow along -- the whole setup takes under 30 minutes end to end.

Table of Contents

  • Why Self-Host a Terraria Server?
  • Vanilla vs. TShock: Which Should You Choose?
  • Prerequisites
  • Step 1: Update System Packages
  • Step 2: Create a Dedicated terraria User
  • Step 3: Install Dependencies
  • Step 4A: Install Vanilla Terraria Server
  • Step 4B: Install TShock Server
  • Step 5: Configure serverconfig.txt
  • Step 6: Generate a World
  • Step 7: Run Persistently with systemd
  • Step 8: Open Port 7777 in UFW
  • Step 9: Connect from the Game Client
  • Step 10: Install TShock Plugins
  • Step 11: Configure Daily World Backups
  • Upgrading the Server
  • Troubleshooting
  • FAQ
  • Next Steps
  • Why Self-Host a Terraria Server?

    Terraria ships with a peer-hosted multiplayer mode where one player's game acts as the server. That works for a quick session, but it has real limitations: the world only exists while the host is online, the host's upload bandwidth becomes the bottleneck for everyone else, and any crash or power cut ends the session. A dedicated VPS server solves all of these in one move.

    • Always-on world -- The world runs 24/7. Players can log in and build whenever they want, and progress continues even when everyone is offline. Farms, NPC shops, and traps keep working.
    • Symmetric, stable bandwidth -- Datacenter networking delivers predictable latency. No more lag spikes when the host's partner starts a video call. Most VPS plans include a gigabit uplink with unmetered bandwidth.
    • Admin control with TShock -- Run commands like /ban, /protect, or /kick against griefers. Define regions that only trusted players can edit. Automate rules with plugins.
    • Privacy and control -- No third-party game host has admin credentials to your world. You decide who has access, what plugins are installed, and when updates roll out.
    • Mod and plugin flexibility -- TShock supports dozens of community plugins, and the same server directory layout drops in for tModLoader if you want to run modded content later.
    • Cost stability -- A CloudCore Starter VPS costs a flat monthly fee regardless of how many hours players spend online. Commercial Terraria hosts charge per player slot or per gigabyte of RAM and scale up fast.
    • Learning value -- Running a game server is an approachable way to pick up Linux fundamentals: SSH, systemd, firewalls, cron, and log analysis. Every skill transfers to other self-hosted projects.

    Vanilla vs. TShock: Which Should You Choose?

    Terraria has two mainstream Linux server builds. Both run on the same port and accept connections from the same vanilla game client, so players do not need to install anything special to join.

    FeatureVanilla (Re-Logic)TShock
    Official buildYes -- published by Re-LogicCommunity, actively maintained
    Admin commands in-gameLimitedExtensive (/ban, /kick, /tp, /region)
    Plugin supportNonePlugin DLLs in ServerPlugins/
    Anti-grief regionsNoBuilt-in
    Permission groupsNoBuilt-in with SQLite backend
    REST APINoYes
    Game version parityImmediateUsually 1-2 weeks behind
    Best forSmall friend groups, immediate updatesPublic servers, communities, anti-grief
    If you are running a private world for 2 to 4 friends, vanilla is simpler and always current with the client. If you plan to host anyone outside your trust circle or want plugins, TShock is the right pick. This guide covers both -- pick Step 4A or Step 4B depending on your preference.

    Prerequisites

    Before you begin, make sure you have:

    • A VPS running Ubuntu 24.04 LTS with root or sudo access
    • SSH access to your server (PuTTY on Windows, or the built-in terminal on macOS/Linux)
    • At least 2 GB of RAM (4 GB recommended for TShock with plugins or 8+ players)
    • 2 GB of free disk space for the binaries, world file, and backup rotation
    • A Terraria game client on your PC/Mac/console to test the connection
    Recommended Plan: CloudCore Starter
    >
    For a private Terraria server with up to 8 players on a medium world, the CloudCore Starter plan has everything you need:
    >
    - 2 vCPU cores
    - 4 GB RAM
    - 50 GB NVMe SSD
    - Unmetered bandwidth
    - Starting from EUR 7.99/month
    >
    This leaves plenty of headroom for TShock, plugins, and backup snapshots. Larger servers with 16+ players or modded worlds benefit from stepping up to CloudCore Professional.

    Connect to your server via SSH to get started:

    bash
    ssh root@your-server-ip

    Step 1: Update System Packages

    Start by updating the package index and applying security patches. Ubuntu 24.04 ships with a recent kernel and a modern glibc, both of which Terraria and TShock rely on.

    bash
    sudo apt update && sudo apt upgrade -y

    Expected output (abbreviated):

    text
    Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
    Reading package lists... Done
    Building dependency tree... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    If the kernel was updated, reboot before continuing:

    bash
    sudo reboot

    Reconnect over SSH after about a minute.

    Step 2: Create a Dedicated terraria User

    Running game servers as root is a bad idea -- a vulnerability in the server or a plugin would give an attacker full system control. Create an unprivileged system user that will own the install and run the process.

    bash
    sudo adduser --system --group --home /opt/terraria --shell /bin/bash terraria

    Verify the user was created:

    bash
    id terraria

    Expected output:

    text
    uid=998(terraria) gid=998(terraria) groups=998(terraria)

    The --system flag creates a user without a login password, which is fine because we will run commands as this user via sudo -u terraria.

    Step 3: Install Dependencies

    Terraria ships with its own bundled Mono runtime for the vanilla build, but TShock requires the .NET 6 runtime. Install the common tools you will need for both paths plus the .NET runtime for TShock users.

    bash
    sudo apt install -y unzip wget curl tmux ufw cron

    If you plan to run TShock (Step 4B), also install the .NET 6 runtime:

    bash
    sudo apt install -y libicu-dev
    wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
    sudo dpkg -i packages-microsoft-prod.deb
    rm packages-microsoft-prod.deb
    sudo apt update
    sudo apt install -y dotnet-runtime-6.0

    Verify the .NET install:

    bash
    dotnet --list-runtimes

    Expected output:

    text
    Microsoft.NETCore.App 6.0.x [/usr/share/dotnet/shared/Microsoft.NETCore.App]

    Step 4A: Install Vanilla Terraria Server

    The official Terraria server binary is distributed from the Re-Logic website. Find the current version number on the Terraria server page -- the filename encodes the version (1449 means 1.4.4.9). Substitute the latest version in the URL below.

    bash
    sudo -u terraria mkdir -p /opt/terraria
    cd /tmp
    wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1449.zip
    unzip -q terraria-server-1449.zip -d /tmp/terraria-extract

    The archive contains Windows/, Mac/, and Linux/ directories. Copy the Linux build into /opt/terraria.

    bash
    sudo cp -r /tmp/terraria-extract/1449/Linux/* /opt/terraria/
    sudo chown -R terraria:terraria /opt/terraria
    sudo chmod +x /opt/terraria/TerrariaServer.bin.x86_64

    Verify the binary runs:

    bash
    sudo -u terraria /opt/terraria/TerrariaServer.bin.x86_64 -help 2>&1 | head -20

    Expected output (abbreviated):

    text
    Terraria Server v1.4.4.9
    Usage:
      -config <config>    Specifies the configuration file to use
      -port <port>        Specifies the port to listen on
      -world <world>      Specifies the world file to load
      -autocreate <size>  1: small, 2: medium, 3: large
      ...

    Clean up the extraction directory:

    bash
    rm -rf /tmp/terraria-extract /tmp/terraria-server-1449.zip

    Skip to Step 5.

    Step 4B: Install TShock Server

    TShock releases are published on GitHub at github.com/Pryaxis/TShock. Download the latest TShock-for-Terraria-vX.X.X-linux-x64-Release.zip asset. As of writing, the latest stable release is v5.2, which matches Terraria 1.4.4.9.

    bash
    sudo -u terraria mkdir -p /opt/terraria
    cd /tmp
    wget https://github.com/Pryaxis/TShock/releases/download/v5.2.0/TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip -O tshock.zip
    unzip -q tshock.zip -d /tmp/tshock-extract
    sudo cp -r /tmp/tshock-extract/* /opt/terraria/
    sudo chown -R terraria:terraria /opt/terraria
    sudo chmod +x /opt/terraria/TShock.Server

    Verify the TShock binary runs:

    bash
    sudo -u terraria /opt/terraria/TShock.Server -help 2>&1 | head -20

    Expected output (abbreviated):

    text
    TShock 5.2.0 (Terraria 1.4.4.9) Linux
    Server started...
      -configpath <path>  Path to TShock config directory
      -world <world>      World file to load
      -port <port>        Port to listen on
      ...

    Clean up:

    bash
    rm -rf /tmp/tshock-extract /tmp/tshock.zip

    TShock automatically creates a tshock/ subdirectory with its own configuration (separate from serverconfig.txt), a SQLite user database, and a ServerPlugins/ folder for DLL plugins.

    Step 5: Configure serverconfig.txt

    Both vanilla and TShock read a plain-text configuration file called serverconfig.txt. Create it at the root of the install directory.

    bash
    sudo -u terraria tee /opt/terraria/serverconfig.txt > /dev/null <<'EOF'
    

    Terraria Dedicated Server Configuration

    World file path (will be created on first run if missing)

    world=/opt/terraria/worlds/world1.wld

    Auto-create world on first launch: 1=small, 2=medium, 3=large

    autocreate=2

    World seed (leave blank for random)

    seed=

    World name (shown in the server list)

    worldname=MyVPSWorld

    World difficulty: 0=classic, 1=expert, 2=master, 3=journey

    difficulty=1

    Network port (TCP)

    port=7777

    Maximum concurrent players (1-255)

    maxplayers=8

    Server password (leave blank for no password)

    password=changeme

    Message of the day

    motd=Welcome to my Terraria server!

    Listen on all interfaces

    ip=0.0.0.0

    Enable UPnP (set to 0 on a VPS; port is opened explicitly via UFW)

    upnp=0

    Auto-save interval (seconds)

    autosave=300

    Secure mode (disables console commands from remote sources)

    secure=1 EOF

    Create the worlds directory:

    bash
    sudo -u terraria mkdir -p /opt/terraria/worlds

    Security note: Change the password=changeme line to a real password before starting the server, especially if you will not enable TShock's stricter authentication. Pick a password of at least 12 characters.

    Difficulty Levels

    ValueNameDescription
    0ClassicStandard Terraria experience
    1ExpertHarder enemies, better loot (recommended for groups)
    2MasterMuch harder, exotic drops
    3JourneyCreative mode with research and power controls

    World Sizes

    autocreateSizeDimensionsTypical DiskPlaytime
    1Small4200x1200~5 MB40-60 hours
    2Medium6400x1800~10 MB80-120 hours
    3Large8400x2400~20 MB150+ hours

    Step 6: Generate a World

    Start the server once manually to generate the world. This also verifies everything is wired up before we hand control to systemd.

    For vanilla:

    bash
    sudo -u terraria /opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt

    For TShock:

    bash
    sudo -u terraria /opt/terraria/TShock.Server -config /opt/terraria/serverconfig.txt

    Expected output on first launch:

    text
    Terraria Server v1.4.4.9
    Listening on port 7777
    Type 'help' for a list of commands.
    Creating world - world1
    0% - Resetting game objects
    10% - Generating terrain
    ...
    100% - Hang on just a moment!
    Loading world data: 100%
    : Server started

    World generation takes 1 to 3 minutes on a CloudCore Starter, longer for a large world. Once you see Server started, stop it cleanly so we can set up systemd.

    At the server prompt, type:

    text
    exit

    This saves the world and shuts down the server gracefully. Confirm the world file exists:

    bash
    ls -lh /opt/terraria/worlds/

    Expected output:

    text
    -rw-r--r-- 1 terraria terraria 9.8M Apr 16 12:00 world1.wld
    -rw-r--r-- 1 terraria terraria 3.2M Apr 16 12:00 world1.wld.bak

    Step 7: Run Persistently with systemd

    A systemd unit starts the server on boot, restarts it if it crashes, and lets you use journalctl to view logs. This is the production-grade way to run a game server -- far cleaner than tmux or screen, which we will only use for interactive console access when needed.

    Create the service file:

    bash
    sudo tee /etc/systemd/system/terraria.service > /dev/null <<'EOF'
    [Unit]
    Description=Terraria Dedicated Server
    After=network.target

    [Service] Type=simple User=terraria Group=terraria WorkingDirectory=/opt/terraria ExecStart=/opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt Restart=on-failure RestartSec=10 StandardInput=null StandardOutput=journal StandardError=journal SyslogIdentifier=terraria

    Hardening

    NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ReadWritePaths=/opt/terraria ProtectHome=true

    [Install] WantedBy=multi-user.target EOF

    If you installed TShock in Step 4B instead, change the ExecStart line to:

    text
    ExecStart=/opt/terraria/TShock.Server -config /opt/terraria/serverconfig.txt

    Enable and start the service:

    bash
    sudo systemctl daemon-reload
    sudo systemctl enable --now terraria

    Verify it is running:

    bash
    sudo systemctl status terraria

    Expected output:

    text
    ● terraria.service - Terraria Dedicated Server
         Loaded: loaded (/etc/systemd/system/terraria.service; enabled; preset: enabled)
         Active: active (running) since Wed 2026-04-16 12:05:00 UTC; 30s ago
       Main PID: 12345 (TerrariaServer.)
          Tasks: 9 (limit: 4608)
         Memory: 180.4M
            CPU: 2.3s
         CGroup: /system.slice/terraria.service
                 └─12345 /opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt

    Stream the live log:

    bash
    sudo journalctl -u terraria -f

    Optional: Interactive Console via tmux

    The systemd unit above sends stdin to /dev/null, so you cannot type commands into the live server. For occasional admin use (broadcasting a message, saving the world manually), run the server inside a tmux session instead:

    bash
    sudo systemctl stop terraria
    sudo -u terraria tmux new -d -s terraria '/opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt'

    Attach to the session to type commands:

    bash
    sudo -u terraria tmux attach -t terraria

    Detach without stopping the server by pressing Ctrl+B, then D. In practice, most operators use systemd as the persistent runner and rely on TShock's in-game admin commands or REST API for live administration, falling back to tmux only when troubleshooting.

    Step 8: Open Port 7777 in UFW

    UFW (Uncomplicated Firewall) is the easiest way to manage iptables rules on Ubuntu. If it is not already enabled, configure it now -- but be careful to allow SSH first so you do not lock yourself out.

    bash
    sudo ufw allow OpenSSH
    sudo ufw allow 7777/tcp
    sudo ufw enable

    Confirm:

    bash
    sudo ufw status

    Expected output:

    text
    Status: active

    To Action From -- ------ ---- OpenSSH ALLOW Anywhere 7777/tcp ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6) 7777/tcp (v6) ALLOW Anywhere (v6)

    If you want to restrict access to specific friends' IP addresses (a good practice for small private servers), replace the allow 7777/tcp rule with:

    bash
    sudo ufw delete allow 7777/tcp
    sudo ufw allow from 203.0.113.50 to any port 7777 proto tcp
    sudo ufw allow from 198.51.100.22 to any port 7777 proto tcp

    For a deeper UFW tutorial, see the companion guide How to Install and Configure UFW on Ubuntu.

    Step 9: Connect from the Game Client

    Launch Terraria on your PC or Mac. From the main menu:

  • Click Multiplayer
  • Click Join via IP
  • Select a character (create one first if needed)
  • Enter your VPS IP address: 203.0.113.10
  • Enter the port: 7777
  • Enter the password you set in serverconfig.txt
  • You should connect within 2 to 4 seconds. Other players can now join using the same IP, port, and password.

    If the connection fails, see Troubleshooting below.

    Step 10: Install TShock Plugins

    This step only applies if you installed TShock in Step 4B. Plugins extend TShock with features like region protection, economy systems, in-game voting, custom chat commands, and more.

    Browse plugins at github.com/Pryaxis/TShock and the community plugins list. Popular plugins include:

    • CreativePowers -- Grants per-group access to journey-mode creative controls
    • Rests -- REST API server for programmatic administration
    • HousingRegions -- Protect player housing plots
    • AutoBroadcast -- Scheduled in-game announcements
    • CustomNpcNames -- Override NPC display names per server
    Plugins are distributed as .dll files. Drop them into the ServerPlugins/ directory and restart the server.

    bash
    cd /opt/terraria/ServerPlugins
    sudo -u terraria wget https://example.com/plugins/AutoBroadcast.dll
    sudo systemctl restart terraria

    Verify the plugin loaded:

    bash
    sudo journalctl -u terraria -n 100 --no-pager | grep -i plugin

    Expected output:

    text
    Plugins loaded: AutoBroadcast v1.2, HousingRegions v2.0, ...

    TShock Admin Setup

    On first launch, TShock prints a setup code to the log. Retrieve it:

    bash
    sudo journalctl -u terraria --no-pager | grep -i setup

    Expected output:

    text
    To become SuperAdmin, join the game and type /setup 12345678

    Join the server in-game, then type the command in the chat box. You will gain full admin rights. Once you are promoted, disable the setup code:

    text
    /setup-disable

    From there, use /user add, /group add, and /group addperm to build out your permission model.

    Step 11: Configure Daily World Backups

    The world file is the only piece of state you truly cannot rebuild. Back it up daily. A simple cron job that copies the .wld file to a snapshot directory is more than enough for most servers.

    Create the backup script:

    bash
    sudo tee /opt/terraria/backup.sh > /dev/null <<'EOF'
    #!/bin/bash
    set -euo pipefail

    BACKUP_DIR=/opt/terraria/backups WORLD_DIR=/opt/terraria/worlds RETAIN_DAYS=14 TIMESTAMP=$(date +%Y%m%d-%H%M%S)

    mkdir -p "$BACKUP_DIR"

    Copy every world file into a timestamped archive

    tar -czf "$BACKUP_DIR/worlds-$TIMESTAMP.tar.gz" -C "$WORLD_DIR" .

    Prune snapshots older than retention window

    find "$BACKUP_DIR" -name 'worlds-*.tar.gz' -mtime +$RETAIN_DAYS -delete

    echo "Backup complete: worlds-$TIMESTAMP.tar.gz" EOF

    sudo chmod +x /opt/terraria/backup.sh sudo chown terraria:terraria /opt/terraria/backup.sh

    Test it manually:

    bash
    sudo -u terraria /opt/terraria/backup.sh
    ls -lh /opt/terraria/backups/

    Expected output:

    text
    Backup complete: worlds-20260416-120500.tar.gz
    -rw-r--r-- 1 terraria terraria 3.1M Apr 16 12:05 worlds-20260416-120500.tar.gz

    Schedule the backup to run daily at 04:00:

    bash
    sudo -u terraria crontab -e

    Add the line:

    text
    0 4   * /opt/terraria/backup.sh >> /opt/terraria/backups/backup.log 2>&1

    Save and exit. Verify the cron entry:

    bash
    sudo -u terraria crontab -l

    Off-Site Backups

    Local backups protect against accidental deletion and grief events but not VPS-level loss. For true disaster recovery, sync the backup directory to a remote location. Rclone is the cleanest tool for this:

    bash
    sudo apt install -y rclone
    sudo -u terraria rclone config

    Configure a remote (S3, Backblaze B2, Google Drive, etc.) and then extend the backup script with:

    bash
    rclone copy "$BACKUP_DIR" myremote:terraria-backups --max-age 2d

    Manual Save from In-Game

    TShock admins can force an immediate save without waiting for autosave:

    text
    /save

    Upgrading the Server

    Terraria receives periodic content updates from Re-Logic, and TShock releases follow within 1 to 2 weeks to stay compatible. Always upgrade both the client and server together -- clients cannot connect to a server running a different major version.

    Upgrade Checklist

  • Announce the upgrade in-game so players can log off cleanly
  • Stop the service
  • Take a pre-upgrade backup
  • Replace the binaries with the new release
  • Restart and verify
  • bash
    # Step 1: Announce (for TShock users)
    

    In-game: /broadcast Server restarting for update in 2 minutes

    Step 2: Stop

    sudo systemctl stop terraria

    Step 3: Pre-upgrade backup

    sudo -u terraria /opt/terraria/backup.sh

    Step 4a: Vanilla upgrade

    cd /tmp wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-NEWVERSION.zip unzip -q terraria-server-NEWVERSION.zip -d /tmp/terraria-new sudo cp -r /tmp/terraria-new/NEWVERSION/Linux/* /opt/terraria/ sudo chown -R terraria:terraria /opt/terraria sudo chmod +x /opt/terraria/TerrariaServer.bin.x86_64

    Step 4b: TShock upgrade

    cd /tmp wget https://github.com/Pryaxis/TShock/releases/download/vNEWVERSION/TShock-NEWVERSION-linux-x64-Release.zip -O tshock-new.zip unzip -q tshock-new.zip -d /tmp/tshock-new sudo cp -r /tmp/tshock-new/* /opt/terraria/ sudo chown -R terraria:terraria /opt/terraria sudo chmod +x /opt/terraria/TShock.Server

    Step 5: Start

    sudo systemctl start terraria sudo systemctl status terraria

    Your serverconfig.txt, tshock/ config directory, ServerPlugins/, and worlds/ all survive the upgrade because we are only overwriting binaries.

    If something breaks, roll back by extracting the previous backup:

    bash
    sudo systemctl stop terraria
    sudo -u terraria tar -xzf /opt/terraria/backups/worlds-PREVIOUS.tar.gz -C /opt/terraria/worlds/
    

    Reinstall the previous binary release, then restart

    sudo systemctl start terraria

    Troubleshooting

    ProblemCauseSolution
    Clients see "Unable to connect"Firewall blocking 7777 or server not bound to 0.0.0.0Check sudo ufw status and ip=0.0.0.0 in serverconfig.txt. Verify with sudo ss -tlnp \</td><td>grep 7777
    TerrariaServer.bin.x86_64: not foundWrong binary extracted or missing execute bitRe-run chmod +x and confirm you copied the Linux/ directory (not Windows/)
    TShock exits immediately with .NET errordotnet-runtime-6.0 missingInstall the Microsoft repo and run sudo apt install dotnet-runtime-6.0
    World corruption on power lossAutosave in progress during crashRestore from the most recent /opt/terraria/backups/*.tar.gz
    Players kicked with "Server is using a different version"Client and server version mismatchUpgrade whichever side is older; they must match exactly
    High CPU usage with few playersWorld too large or too many AFK farmsReduce world size or limit NPC spawners. Check with htop
    Port 7777 already in usePrevious process did not exitsudo systemctl restart terraria or sudo pkill -f TerrariaServer
    TShock setup code expiredSetup code is one-timeJoin the game, then run /setup-new from the server console (tmux) to generate a fresh code

    Viewing Logs

    bash
    sudo journalctl -u terraria -f            # Live stream
    sudo journalctl -u terraria -n 200        # Last 200 lines
    sudo journalctl -u terraria --since today # Today's logs

    FAQ

    What are the minimum VPS specs for a Terraria dedicated server?

    A Terraria dedicated server runs comfortably on 2 GB of RAM and 2 vCPU for up to 8 players on a medium world. TShock with plugins and larger worlds benefit from 4 GB of RAM. Disk usage stays under 2 GB including the binaries, world file, and backup snapshots. The CloudCore Starter plan comfortably handles small to medium private servers, and CloudCore Professional is the sweet spot for busy public communities.

    Should I run vanilla Terraria or TShock?

    Vanilla Terraria -- Re-Logic's official build -- is the right choice if you want a pure multiplayer experience that matches single-player exactly and do not need admin tools. TShock is a drop-in server replacement that adds admin commands (/ban, /kick, /tp, /region), permission groups, anti-grief protection, and a plugin ecosystem. Most public servers and established communities use TShock because it makes moderation practical at scale.

    Which port does Terraria use, and do I need UDP?

    Terraria uses TCP port 7777 by default. You must open this port in UFW and in any cloud provider firewall (most VPS hosts leave all ports open on the provider side by default, but check). Terraria does not require UDP for normal gameplay -- only TCP. If you change the port= line in serverconfig.txt, remember to update both your UFW rule and the port your players enter when joining.

    How do I back up a Terraria world?

    Copy the .wld file from /opt/terraria/worlds to a backup location. The server writes the world to disk every autosave interval (default 300 seconds) and on clean shutdown, so a nightly cron job is sufficient for most servers. The script in Step 11 creates a timestamped tarball and retains 14 days of snapshots. For truly critical worlds, sync backups off-site with rclone to object storage.

    Can I add mods like tModLoader on this setup?

    Yes. tModLoader is a separate server build that replaces the vanilla binary. The directory layout, systemd unit, UFW rule, and backup strategy in this guide all apply to tModLoader without changes. Download the Linux server build from the tModLoader GitHub releases, extract it over /opt/terraria, and update the ExecStart= line in /etc/systemd/system/terraria.service to point at the new binary (start-tModLoaderServer.sh is the usual entry point).

    How do I give a friend admin access on TShock?

    Inside the game, as an existing SuperAdmin, run:

    text
    /user add FriendName password superadmin

    Tell your friend to connect to the server, then type /login password in the chat. They now have full admin rights. For more granular control, create custom groups: /group add moderator followed by /group addperm moderator tshock.kick.

    Next Steps

    Your Terraria server is live, persistent, and backed up. Here are recommended follow-ups to build on this foundation:

    • Install UFW properly -- Harden the firewall with rate limiting and geo-IP rules: How to Install and Configure UFW on Ubuntu.
    • Run more game servers on the same VPS -- The Minecraft server install guide uses a similar systemd pattern and can share the same VPS if you have enough RAM.
    • Host a factory game alongside Terraria -- See How to Install Factorio Server on Ubuntu for another multiplayer server that pairs well with Terraria communities.
    • Automate backup rotation to cloud storage -- Extend the backup script with rclone to push snapshots to S3 or Backblaze B2 for true off-site disaster recovery.
    • Set up Uptime Kuma -- Monitor your Terraria server's TCP 7777 port and alert on Discord or email when it goes down.
    • Build a Discord bot -- Use the TShock REST API to pipe player joins, deaths, and chat into a Discord channel for a community hub.

    Launch Your Terraria Server on CloudCore Starter
    >
    Spin up a 2 vCPU / 4 GB / 50 GB NVMe VPS in under 60 seconds and follow this guide end to end. Unmetered bandwidth, gigabit uplink, and snapshot backups included.
    >
    Deploy CloudCore Starter Now -- plans start at EUR 7.99/month.

    Was this article helpful?

    ← Back to Install GuidesBrowse all categories →

    Still have questions?

    Contact Support →Submit a Ticket