bolt Valebyte VPS from $4/mo — NVMe, 60s deploy.

Get a VPS arrow_forward

Terraria Dedicated Server on Linux VPS: TShock & Plugins 24/7

calendar_month September 05, 2026 schedule 19 min read visibility 22 views
person
Valebyte Team
Terraria Dedicated Server on Linux VPS: TShock & Plugins 24/7
summarize

TL;DR

  • For a Terraria TShock server on Linux VPS, use at least 2 vCPU, 4 GB RAM, and Ubuntu 22.04 LTS.
  • A VPS provides 24/7 reliability, high performance (NVMe SSDs), and stable low-latency connections.
  • Get full root access on your VPS to configure TShock, install any plugins, and custom scripts.
  • Avoid home PC issues like unstable internet, high electricity, and performance limits by using a VPS.

To set up your own Terraria dedicated server 24/7 with TShock and plugins on a Linux VPS, you'll need a minimum of 2 vCPU, 4 GB RAM, and a distribution like Ubuntu 22.04 LTS for stable performance and low latency for players worldwide.

Dreaming of your own Terraria world where you set the rules, experiment with plugins, and play with friends without limits? Deploying a Terraria server on a VPS is the ideal solution, providing stability, performance, and complete control. In this article, we'll walk you through how to set up your own Terraria server on a VPS, from choosing the optimal configuration to fine-tuning TShock, plugins, automatic backups, and ensuring 24/7 operation.

Why a VPS is the Best Choice for a Terraria Dedicated Server

Many players start with the idea of hosting a Terraria server on their home computer. However, this approach quickly runs into several limitations: unstable internet connection, high electricity bills, the need to keep the PC constantly on, and performance and security issues. This is where a VPS (Virtual Private Server) comes in.

A VPS provides you with an isolated environment with dedicated resources (CPU, RAM, disk, network channel), guaranteeing stable 24/7 operation of your Terraria server, regardless of your home internet or PC status. Here are the key advantages:

  • 24/7 Reliability: The server runs without interruptions, accessible to friends at any time.
  • High Performance: Powerful server components and fast NVMe SSDs ensure smooth gameplay even with many players and complex worlds.
  • Stable Connection: Data centers have high-speed and redundant communication channels, minimizing ping and latency.
  • Full Control: You get root access to the operating system (most often Linux), allowing you to configure the server with maximum flexibility, install TShock, any plugins, and scripts.
  • Scalability: As your player base grows, you can easily upgrade your VPS plan to add more resources.
  • Security: Professional data centers ensure the physical security of hardware, and you control the software protection of the server.

Unlike shared hosting, where resources are shared with many other users, a VPS offers a guaranteed share of resources. This is critically important for dynamic games like Terraria, where stability and response speed play a key role. If you want to delve deeper into the differences between cloud VPS and dedicated servers, we recommend checking out the article Cloud VPS vs Cloud Server: Terminology and Pricing 2026.

Choosing the Best VPS for Terraria: How Many Resources Do You Need?

Choosing the right VPS is the first and one of the most important steps. Terraria, like many other game servers, has its own peculiarities in resource consumption. The main one is a strong dependence on single-core CPU performance.

Terraria Server Performance: Why CPU Clock Speed Matters

The Terraria Dedicated Server, especially the vanilla version, is a single-threaded application. This means it cannot effectively utilize multiple CPU cores. Instead, all the load falls on a single core. Therefore, when choosing a VPS for Terraria, the CPU's clock speed (GHz) and overall per-core performance are more important than the number of vCPUs. Modern processors with high frequencies (3.0-3.5+ GHz) will perform better than multi-core, but lower-frequency alternatives.

RAM also plays a role, but Terraria is not a "RAM hog." For a small server with 5-10 players, 2 GB RAM will be sufficient, but for public servers with TShock and many plugins, as well as for large worlds, it's better to have a reserve.

Disk subsystem: NVMe SSDs significantly outperform regular SSDs and even HDDs in read/write speeds. This accelerates world loading, progress saving, and plugin file operations, directly impacting server responsiveness. Disk space for Terraria is usually not critical – the server itself and the world take up a few gigabytes.

Recommended VPS Configurations for Terraria Servers

For 20-30 concurrent players, a VPS with 4 vCPU, 8 GB RAM, and an 80 GB NVMe disk is sufficient.

Players vCPU (Frequency) RAM (GB) Disk (Type/Size) Port Price (Approx., $/month, Q3 2024)
1-5 (Friends) 2 (2.5+ GHz) 2 40 GB NVMe 1 Gbps $5-10
5-15 (Small Community) 2-3 (3.0+ GHz) 4 60 GB NVMe 1 Gbps $10-20
15-30 (Medium Public) 4 (3.5+ GHz) 8 80 GB NVMe 1 Gbps $20-40
30-50+ (Large Public) 4-6 (3.5+ GHz) 16 120+ GB NVMe 1 Gbps $40-80+

Note: The prices listed are approximate for the VPS provider market and may vary. Valebyte.com offers competitive rates corresponding to these specifications for maximum performance of your Terraria server.

Looking for a reliable server for your projects?

VPS from $10/month and dedicated servers from $9/month with NVMe, DDoS protection, and 24/7 support.

View Offers →

Preparing Your Linux VPS for Terraria Dedicated Server Installation

We will be installing the Terraria Dedicated Server on a Linux operating system. Ubuntu Server LTS (Long Term Support) is an excellent choice due to its stability, extensive community support, and up-to-date packages. This guide uses commands for Ubuntu 22.04 LTS.

Initial Setup and VPS Security

  1. Connect via SSH: Use an SSH client (e.g., PuTTY for Windows, or the built-in terminal for Linux/macOS) to connect to your VPS. You'll need the server's IP address and credentials (usually root and password).
    ssh root@YOUR_IP_ADDRESS
  2. Update the System: Always start by updating packages to get the latest versions and security patches.
    sudo apt update && sudo apt upgrade -y
  3. Create a New User: Working as the root user is insecure. Create a new user for everyday tasks and managing the Terraria server. Replace terrariauser with your desired name.
    sudo adduser terrariauser
    sudo usermod -aG sudo terrariauser

    Now, log out of root and log in as the new user:

    exit
    ssh terrariauser@YOUR_IP_ADDRESS
  4. Configure Firewall (UFW): Enable the firewall and allow SSH connections, as well as the Terraria port (default 7777 UDP/TCP).
    sudo ufw allow OpenSSH
    sudo ufw allow 7777/tcp
    sudo ufw allow 7777/udp
    sudo ufw enable

    Confirm firewall activation by pressing y.

  5. Install Dependencies: The Terraria Dedicated Server is written in .NET (Mono), so we'll need to install Mono. Also, SteamCMD for downloading server files.
    sudo apt install -y steamcmd screen tmux mono-runtime libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-mixer-2.0-0 libsdl2-net-2.0-0 libsdl2-ttf-2.0-0

    For a deeper understanding of security settings and choosing a Linux distribution for your server, refer to the article Linux Dedicated Server: Choosing a Distribution, Setup, and Security.

Quick pick
Need a dedicated server?
Bare metal with NVMe in 70+ locations — configure and order in minutes.
Browse servers

How to Install and Run a Vanilla Terraria Server on Linux

Now that the VPS is prepared, we can proceed with downloading and configuring the Terraria server itself.

Downloading Terraria Dedicated Server via SteamCMD

Navigate to your user's home directory and create a folder for the Terraria server:

cd ~
mkdir terraria_server
cd terraria_server

Launch SteamCMD. It will update on its first run:

steamcmd

After the Steam> prompt appears, execute the following commands:

login anonymous
force_install_dir ./
app_update 246560 validate
quit

The command app_update 246560 validate will download the Terraria Dedicated Server files (App ID 246560) into the current directory.

Generating a World and Basic Server Configuration

After downloading the server files, navigate to the directory containing the executable:

cd ~/terraria_server/TerrariaServer.exe

Run the server for the first time to generate a world and create the configuration file. Use mono to run the .NET application:

mono TerrariaServer.exe

The server will prompt you through a step-by-step setup:

  1. Select World: Choose "n" to create a new world.
  2. World Size: Select world size (1=Small, 2=Medium, 3=Large). Medium or Large is recommended for long-term play.
  3. World Difficulty: Choose difficulty (1=Classic, 2=Expert, 3=Master, 4=Journey).
  4. World Seed (optional): Enter a seed or leave blank for a random one.
  5. World Name: Come up with a name for your world.
  6. Max Players: Specify the maximum number of players (8 to 16 is recommended for comfortable play on a medium VPS).
  7. Server Port: Default is 7777. Leave it unless you have a reason to change it.
  8. Auto-create and enter password: Set a password for administrative commands (not for players to join).
  9. Automatically forward port: Choose "n", as we have already configured the firewall manually.

After world generation, the server will start. You can check its operation by typing help into the server console. To stop the server, type exit.

Configuring serverconfig.txt

After the first launch, a serverconfig.txt file will be created in the server directory. You can edit it for more detailed configuration. Open it with the nano text editor:

nano ~/terraria_server/serverconfig.txt

Examples of useful settings:

# Максимальное количество игроков
maxplayers=16

# Порт сервера
port=7777

# Имя мира, который будет загружаться по умолчанию
world=~/terraria_server/Worlds/MyTerrariaWorld.wld

# Приветственное сообщение
motd=Добро пожаловать на сервер Valebyte Terraria!

# Пароль для входа на сервер (если нужен)
password=

# Пароль для административных команд
serverpassword=youradminpassword

# Автоматическое сохранение мира каждые X минут
autoshutdown=3600
autosave=5

Save changes (Ctrl+O, Enter, Ctrl+X).

Running the Terraria Server in the Background with tmux

To keep the server running after disconnecting from SSH, use the tmux utility (or screen). tmux allows you to create virtual sessions that continue to run in the background.

  1. Create a new tmux session:
    tmux new -s terraria_server_session

    You will be in a new terminal session.

  2. Start the Terraria server:
    mono ~/terraria_server/TerrariaServer.exe -config ~/terraria_server/serverconfig.txt

    The server will start. It will now run in this tmux session.

  3. Detach from the session: Press Ctrl+B, then D.

    You will return to the main terminal, and the server will continue to run in the background.

  4. Reattach to the session: If you want to return to the server console, use:
    tmux attach -t terraria_server_session

Enhancing Your Server: TShock, Plugins, and Administration

A vanilla Terraria server is great for playing with friends, but if you plan a public server or want more control and functionality, you'll need TShock.

What is TShock and Why Do You Need It?

TShock is a modified Terraria server that adds a powerful permission system, administrator commands, anti-cheat functionality, and most importantly, plugin support. With TShock, you can:

  • Manage players (ban, kick, teleport).
  • Create regions to protect builds from griefers.
  • Configure user groups with different permissions.
  • Use plugins for economy, mini-games, custom items, and much more.
  • Protect your server from cheaters and malicious players.

Installing TShock on Your Terraria Server

  1. Stop the current Terraria server: If it's running, attach to the tmux session (tmux attach -t terraria_server_session) and type exit. Then detach (Ctrl+B, D).
  2. Download TShock: Go to the official TShock website (or its GitHub repository) and find the latest stable version. Download the archive for Linux. For example:
    cd ~/terraria_server
    wget https://github.com/Prybar/TShock/releases/download/v4.5.30/TShock_4.5.30_Linux_x64.zip # Specify the actual version
    sudo apt install -y unzip
    unzip TShock_4.5.30_Linux_x64.zip

    Extract the archive into the directory where TerrariaServer.exe is located. TShock will replace some files, including the server executable itself.

  3. Start the TShock server:
    tmux new -s tshock_server_session
    mono ~/terraria_server/TerrariaServer.exe -config ~/terraria_server/serverconfig.txt

    On its first launch, TShock will perform its own initialization and prompt you to create an administrator account. Be sure to create one, remembering the username and password. This will be your main account for managing the server.

    TShock has no administrator accounts registered!
    Please enter a username for the first administrator: admin
    Please enter a password for the first administrator: your_admin_password
    Please re-enter the password to confirm: your_admin_password
    Administrator 'admin' created. Login to your server using '/login admin your_admin_password' to use your admin commands.

    After this, you can detach from the tmux session (Ctrl+B, D).

Configuring TShock: Plugins and Admin Commands

After logging into the Terraria server as an administrator (/login admin your_password), you will have access to many commands. Use /help to view the command list.

Installing Terraria server plugins:

Plugins significantly extend TShock's functionality. You can find them on Terraria forums, GitHub, or specialized websites. Installation usually involves:

  1. Download the plugin file (usually a .dll) to your VPS.
  2. Place it in the ~/terraria_server/ServerPlugins/ directory.
  3. Restart the TShock server or use the /plugin reload command in the server console.

Recommended TShock plugins for a public server:

  • Essentials: A set of basic commands for players and admins (teleports, spawn, inventory).
  • WorldEdit: A tool for quickly modifying terrain and creating structures.
  • Region Protection (based on WorldGuard): Allows you to create protected regions, preventing griefing. This is critically important for any public server.
  • Anti-Cheat/Anti-Grief: Plugins for detecting and preventing cheats and structure destruction.
  • Economy/Shop: For creating in-game economies, shops, and player trading.
  • Kits: Allows you to give players item sets (e.g., starter kits).
  • Greylist/Whitelist: For controlling server access if you don't want to make it fully open.

Each plugin has its own settings, which are usually found in .json or .txt files within the plugin folder or the TShock root directory.

Ensuring Reliability: 24/7 Uptime, Automatic Backups, and Security

To ensure your Terraria server 24/7 runs smoothly and is protected, you need to configure its automatic startup, backups, and security measures.

Automatic Server Startup with Systemd

tmux is good for manual launching, but for full automation and stability, it's better to use systemd – the initialization system and service manager in Linux.

  1. Create a Systemd unit file:
    sudo nano /etc/systemd/system/terraria.service

    Insert the following content, replacing terrariauser with your username and ensuring the paths to TerrariaServer.exe and serverconfig.txt are correct:

    [Unit]
    Description=Terraria Dedicated Server
    After=network.target
    
    [Service]
    WorkingDirectory=/home/terrariauser/terraria_server
    User=terrariauser
    Group=terrariauser
    ExecStart=/usr/bin/mono /home/terrariauser/terraria_server/TerrariaServer.exe -config /home/terrariauser/terraria_server/serverconfig.txt
    Restart=always
    RestartSec=10
    StandardOutput=file:/var/log/terraria/terraria.log
    StandardError=file:/var/log/terraria/terraria_error.log
    
    [Install]
    WantedBy=multi-user.target

    Save and close the file (Ctrl+O, Enter, Ctrl+X).

  2. Create a directory for logs:
    sudo mkdir /var/log/terraria
    sudo chown terrariauser:terrariauser /var/log/terraria
  3. Enable and start the service:
    sudo systemctl daemon-reload
    sudo systemctl enable terraria.service
    sudo systemctl start terraria.service
  4. Check the service status:
    sudo systemctl status terraria.service

    You should see "active (running)" status.

Now your Terraria server will automatically start when the VPS boots and restart in case of failures.

Automatic World Backups (Autobackup)

Regular backups are a lifeline against losing progress due to crashes, errors, or griefers. Let's set up a simple script for automatic world backups.

  1. Create a directory for backups:
    mkdir ~/terraria_backups
  2. Create a backup script:
    nano ~/backup_terraria.sh

    Insert the following code:

    #!/bin/bash
    
    # Путь к директории с мирами Terraria
    WORLD_DIR="/home/terrariauser/terraria_server/Worlds"
    # Путь к директории, куда будут сохраняться бэкапы
    BACKUP_DIR="/home/terrariauser/terraria_backups"
    # Имя файла бэкапа (с датой)
    BACKUP_FILE="terraria_world_$(date +%Y%m%d_%H%M%S).zip"
    # Количество дней, после которых старые бэкапы будут удаляться
    RETENTION_DAYS=7
    
    echo "Starting Terraria world backup at $(date)"
    
    # Создаем архив мира
    zip -r "$BACKUP_DIR/$BACKUP_FILE" "$WORLD_DIR"
    
    # Удаляем старые бэкапы
    find "$BACKUP_DIR" -type f -name "terraria_world_*.zip" -mtime +"$RETENTION_DAYS" -delete
    
    echo "Backup finished. File: $BACKUP_DIR/$BACKUP_FILE"
    echo "Old backups removed."

    Save and close the file. Make the script executable:

    chmod +x ~/backup_terraria.sh
  3. Schedule script execution (Cron):
    crontab -e

    Choose a text editor (e.g., nano). Add a line at the end of the file to execute the script every 6 hours (for example):

    0 */6 * * * /home/terrariauser/backup_terraria.sh >> /home/terrariauser/terraria_backups/backup.log 2>&1

    This line means: at 0 minutes of every 6th hour (0, 6, 12, 18) every day, month, and day of the week, execute the script. You can adjust the schedule as needed. Save and close the file.

Griefing Protection and World Restoration

Griefing Protection: With TShock, you get powerful tools to combat griefing:

  • Regions: Use TShock commands to create protected zones (e.g., /region create ) where only specific players or groups can build/destroy. This is especially important for spawn areas and critical structures.
  • Permission System: Configure user groups (e.g., "Guest", "Member", "Trusted") with different permissions. Give new players minimal rights and trusted players more.
  • Anti-Cheat Plugins: Many TShock plugins include features for detecting cheats and automatically banning offenders.
  • Logs: TShock keeps detailed logs of player actions, allowing you to track down rule-breakers.

Restoring a World from Backup: In case of a critical situation (world corruption, griefing destroying builds), you can restore the world from the latest backup:

  1. Stop the Terraria server:
    sudo systemctl stop terraria.service
  2. Navigate to the worlds directory:
    cd /home/terrariauser/terraria_server/Worlds
  3. Delete the corrupted world (or move it):
    rm MyTerrariaWorld.wld MyTerrariaWorld.wld.bak

    Replace MyTerrariaWorld with your world's name.

  4. Unzip the desired backup:
    unzip /home/terrariauser/terraria_backups/terraria_world_ГГГГММДД_ЧЧММСС.zip -d .

    Ensure that the extraction happens into the current Worlds directory.

  5. Start the server:
    sudo systemctl start terraria.service

Your world will be restored to its state at the time of the backup.

Quick pick
Need a dedicated server?
Bare metal with NVMe in 70+ locations — configure and order in minutes.
Browse servers

Frequently Asked Questions

How many players can a minimum VPS for Terraria support?

A minimum VPS with 2 vCPU (clocked at 2.5+ GHz) and 2-4 GB RAM can comfortably host 5-10 concurrent players. However, for stable operation with TShock and numerous plugins for 15-20 players, a VPS with 4 vCPU and 8 GB RAM is recommended.

Can TShock be used on Windows Server?

Yes, TShock can be installed on Windows Server. The installation process is similar to a vanilla Windows server, but instead of mono TerrariaServer.exe, you simply run TerrariaServer.exe. However, Linux VPS often offers better economics and performance for game servers.

Which ports need to be forwarded for a Terraria server?

By default, the Terraria Dedicated Server uses port 7777. For the server to function correctly, you need to open ports 7777 TCP and 7777 UDP in your VPS firewall. If you use a different port, ensure it is also open.

How do I update my Terraria server on a VPS?

To update a vanilla Terraria server on a VPS, simply stop it, run steamcmd, execute login anonymous, force_install_dir ./ (in the server directory), and app_update 246560 validate, then quit. For TShock, in addition to updating the vanilla server, you'll need to download and extract the new TShock version.

Will installing TShock affect server performance?

The TShock installation itself has a minimal impact on performance. However, using a large number of resource-intensive plugins, especially those that actively interact with the world or process many events, can increase CPU and RAM load. Choose plugins wisely and monitor your VPS resources.

Conclusion

Creating your own Terraria server on a VPS with TShock unlocks unprecedented opportunities for customization, administration, and stable gameplay. By following this step-by-step guide, you can not only launch a Terraria server 24/7 but also ensure its reliability, protection from griefers, and scalability. Valebyte.com offers optimal VPS solutions that are ideally suited for hosting game servers, guaranteeing the high performance and stability needed for thrilling adventures in the world of Terraria.

SSD NVMe
Ready to launch your VPS?

NVMe VPS with 60-second activation: full root access, 20+ locations, pay with card or crypto.

Choose a Plan
support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.