Deploy Terraria Dedicated Server

Self-host a persistent Terraria TShock server using Docker Image

Deploy Terraria Dedicated Server

Terraria-Selfhost

XavTo/Terraria-Selfhost

Just deployed

/data

Deploy and Host Terraria Dedicated Server on Railway

Terraria Dedicated Server is the official multiplayer server for the Terraria sandbox game. It allows players to host a persistent world, invite others to join online, and customize gameplay using server configuration and plugins such as TShock.

How to Join the Server

This server is exposed using Railway TCP Proxy.
Players must connect using the public proxy domain and port, not the default Terraria port.

Steps (Terraria PC / Steam)

  1. Launch Terraria.

  2. Click Multiplayer.

  3. Select your character.

  4. Choose Join via IP.

  5. When prompted for the server address, enter:

    Example:

    shortline.proxy.rlwy.net
    
  6. Confirm, then enter the port provided by Railway TCP Proxy:

    Example:

    48187
    
  7. If the server is password-protected, enter the password when asked.

  8. Join the world.

Important Notes

  • Do not use port 7777 when connecting.

    • 7777 is the internal server port.
    • Railway maps it to a different external TCP port.
  • The correct connection format is:

    domain:port
    

    Example:

    shortline.proxy.rlwy.net:48187
    
  • You can find the correct domain and port in: Railway → Service → Networking → TCP Proxy


About Hosting Terraria Dedicated Server

This Railway template deploys a fully functional Terraria Dedicated Server using Docker, with support for persistent storage, configuration files, logs, and plugins. The server runs in headless mode and exposes a TCP endpoint via Railway’s TCP Proxy, allowing players to connect securely from anywhere.

The template is designed to work with a single persistent volume, ensuring that worlds, TShock configuration, plugins, and logs are preserved across restarts and redeployments. No manual server setup is required: worlds can be auto-generated, and common server settings are configurable through environment variables.

Common Use Cases

  • Host a private Terraria multiplayer server for friends or small communities.
  • Run a persistent world with TShock for permissions, commands, and moderation.
  • Test plugins or server configurations in an isolated environment.
  • Deploy an always-on Terraria server without managing your own VPS.

Dependencies for Terraria Dedicated Server Hosting

  • Docker container running Terraria Server with TShock.
  • Persistent volume for worlds, configuration, plugins, and logs.
  • TCP networking for player connections.

Deployment Dependencies

Implementation Details (Optional)

The server runs inside a Docker container based on a prebuilt Terraria/TShock image. A custom startup script prepares a single persistent volume and maps it to the directories used by Terraria and TShock. Environment variables are used to control world generation, player limits, passwords, and startup behavior, avoiding manual command-line configuration.

Why Deploy Terraria Dedicated Server on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you do not have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Terraria Dedicated Server on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

Terraria-Selfhost

XavTo/Terraria-Selfhost

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh