Prepay & save up to 40% · 3 months −20% · 6 months −30% · 12 months −40% Client Area
Guide

How to Set Up a Terraria Server

Terraria··9 min read

Terraria is the 2D action-sandbox of digging, building and boss fights. A dedicated server (vanilla or TShock) keeps your world live for the whole group, with plugins and tModLoader for deeper mods. This step-by-step guide shows you how to set up a Terraria server in minutes — no manual install, no command line.

What you need

  • A Terraria plan with around 1–3 GB of RAM — Terraria is a Light-class game.
  • Support for TShock and tModLoader, included on every GGameHost Terraria plan.
  • Your friends or community to play with (1–16 slots (255 max)).

Step 1 — Choose your plan

Pick a plan sized for your Terraria community. We recommend about 1–3 GB of RAM; start smaller and upgrade in one click as you add players or mods. Terraria plans start at $3.99/mo.

Step 2 — Deploy your server

Check out and your Terraria server provisions automatically in under 60 seconds, with console access right away — no manual install, no command line.

Step 3 — Connect & invite players

Once your Terraria server is online, share its address (IP and port) with your friends so they can join. Start, stop and restart it anytime from the control panel.

Step 4 — Install mods & configure

Your Terraria server supports TShock, Plugins, tModLoader, Config, FTP/SFTP. Install TShock and tModLoader straight from the one-click installer, or upload your own from the control panel — then tweak settings in the visual config editor.

Step 5 — Keep it running smoothly

Enable scheduled automatic backups, set restart timers, and monitor CPU, RAM and player counts from the dashboard. Always-on DDoS protection and 24/7 support keep your Terraria server stable.

Server softwareTShock and tModLoader
Recommended RAM1–3 GB
Player slots1–16 slots (255 max)
Performance classLight

Terraria server FAQ

How much RAM does a Terraria server need?
We recommend 1–3 GB for Terraria. Start smaller and upgrade in one click as your player count or mod list grows.
How many players can a Terraria server hold?
Typical Terraria servers run 1–16 slots (255 max). Slots scale with your plan, so you can raise them at any time.
Can I install mods on a Terraria server?
Yes — Terraria supports TShock and tModLoader. Install them from the one-click installer or upload your own over FTP/SFTP.

Ready to start? Deploy your Terraria server in under 60 seconds — 7-day money-back guarantee.

Related guides

Share:Twitter / XFacebookRedditWhatsApp

Ready to play?

Deploy your server in under 60 seconds — 7-day money-back guarantee.

Browse games
Reference

Ports, config and common failures

Ports a Terraria server listens on

The dedicated server listens on TCP port 7777 by default. The official wiki adds two situational notes. On a cloud provider such as AWS or GCP, port 7777 has to be open on both TCP and UDP. Non-NAT connections, such as a business or data centre host, usually do not need port forwarding, but may need the port allowed through a firewall.

PortProtocolUsed by
7777TCP, plus UDP on cloud providers, per the wikiVanilla and tModLoader game traffic; also TShock's ServerPort default
7878HTTPTShock REST API, only while RestApiEnabled is true

Change the listening port with the port= line in serverconfig.txt, or -port at launch. The server can map the port itself: upnp=1 enables UPnP port forwarding and -noupnp disables it.

With the REST API switched on, request a token at http://IP:7878/v2/token/create?username={username}&password={password}, then call endpoints as http://IP:7878/endpoint?token={token}/v2/players/read, for instance, takes a token and a player name. Tokens generated this way do not persist across sessions; for tokens that survive a restart, TShock documents Application REST Tokens inside config.json.

What is inside the server archive and how to launch it

Unpack the dedicated-server archive (terraria-server-1456.zip for Terraria 1.4.5.6) and you get one directory per platform.

  • Windows: TerrariaServer.exe plus two helper scripts. start-server.bat starts the server using serverconfig.txt and includes a loop that restarts it after a crash. start-server-steam-friends.bat behaves like Host & Play but runs in the console, so Steam friends can join.
  • Linux: TerrariaServer.bin.x86_64, with a 32-bit TerrariaServer.bin.x86 beside it. Make them executable first with chmod +x TerrariaServer.bin.x86*, then run ./TerrariaServer.bin.x86_64.
  • macOS: a Terraria Server.app bundle. Remove the quarantine attribute with xattr -d com.apple.quarantine Terraria\ Server.app; the binary itself sits at Terraria Server.app/Contents/MacOS/TerrariaServer.

For sizing, the wiki gives 500 MB of free RAM for the server itself on a small world, and notes that RAM use depends on world size and player count. Those world sizes are 4200×1200 tiles for small, 6400×1800 for medium and 8400×2400 for large, so the world you generate is the main lever on memory.

serverconfig.txt keys worth setting

serverconfig.txt sits in the server installation directory. Every line of the shipped file begins with a #, which comments the line out so the server ignores it; delete the # to apply that setting. The file is passed in with -config and can have any name; relative paths resolve against the folder containing TerrariaServer.exe.

KeyWhat it does
worldLoads a world and auto-starts the server
worldpathFolder the server keeps world files in
autocreateCreates a world: 1 small, 2 medium, 3 large
worldnameName for an autocreated world
seedSeed used by autocreate
difficulty0 Normal, 1 Expert, 2 Master, 3 Journey
maxplayers1 to 255; default 16, or 8 before 1.4.0.1
portPort number
passwordPassword required to join
motdMessage of the day
secure1 enables cheat protection
banlistBanlist file location
languageLanguage code: en-US, de-DE, fr-FR, zh-Hans and others
upnp1 enables UPnP port forwarding
npcstreamEnemy skipping reduction; 0 turns it off
priorityProcess priority: 0 Realtime through 5 Idle
journeypermission_*One key per Journey Mode power: 0 locked, 1 host only, 2 everyone

Several of these settings can also be supplied as launch parameters.

Launch parameters and console commands

Launch parameters documented on the wiki:

  • Worlds and files: -config <file>, -world <path>, -worldname <name>, -autocreate 1|2|3, -seed <seed>, -banlist <path>
  • Network and access: -port <number>, -maxplayers <number> (also -players), -password <password> (also -pass), -motd <text>, -ip <address>, -noupnp
  • -secure enables cheat protection, and -forcepriority overrides the settings file's process priority
  • -steam enables Steam support; with it, -lobby friends or -lobby private narrows who may join
  • -disableannouncementbox disables announcement box pulses, and -announcementboxrange <pixels> sets their range, where -1 covers the whole server

The running console has its own command set: help, playing, clear, version, time, port, maxplayers and say <message>. Two pairs print or change a value: motd and motd <message> for the message of the day, password and password <pass> for the password. Moderation runs through kick <player> and ban <player>. The time jumps are dawn (4:30 AM), noon, dusk (7:30 PM) and midnight, with settle to settle all water. The counters are death, pvpdeath, alldeath and allpvpdeath. Finally, save saves the world, exit shuts down with a save and exit-nosave shuts down without one.

Loading tModLoader mods on the server

tModLoader is a separate Steam application (app ID 1281930) and relies on the .NET 8 runtime. It ships with its own scripts: start-tModLoaderServer.bat on Windows, start-tModLoaderServer.sh on Linux and macOS, and manage-tModLoaderServer.sh for installing and updating.

./manage-tModLoaderServer.sh install-tml --username your_steam_username
./manage-tModLoaderServer.sh install-tml --github
./manage-tModLoaderServer.sh install-mods
./manage-tModLoaderServer.sh start

The mod list comes from two files exported by the tModLoader client: open Workshop, then Mod Packs, click Save Enabled as New Mod Pack, then Open Mod Pack Folder.

  • install.txt lists the Workshop mods to fetch; without it, nothing is installed.
  • enabled.json lists the mods to switch on; without it, nothing is enabled.

In serverconfig.txt, modpack= takes the path to an enabled.json inside a mod pack folder, and modpath= points at the Mods folder:

modpack=/home/<user>/.local/share/Terraria/ModLoader/Mods/ModPacks/<modpack name>/mods/enabled.json
modpath=/home/<user>/.local/share/Terraria/ModLoader/Mods

On the client, Mods is a subfolder of the tModLoader saves folder — on Windows, %UserProfile%\Documents\My Games\Terraria\ followed by the save folder name matching your tModLoader version, such as ModLoader or tModLoader.

Running TShock and adding plugins

Builds come from the project's GitHub releases, and a container image is published as ghcr.io/pryaxis/tshock:stable. Match the release to the Terraria version you intend to run. Install .NET Runtime 9.x first — the project states it runs on any system .NET 9 supports — then start TShock.Server.exe on Windows or ./TShock.Server elsewhere.

The first run creates a tshock folder holding config.json, the server-side characters file sscconfig.json and the tshock.sqlite database. Defaults in config.json worth knowing:

SettingDefaultEffect
ServerPort7777The port the server listens on
MaxSlots8Maximum clients connected at once
ReservedSlots20Slots beyond MaxSlots that reserved players can join
ServerPasswordemptyPassword required to join
EnableWhitelistfalseWhitelist based on the IP addresses in whitelist.txt
AutoSavetrueTerraria's built-in world auto-save
BackupInterval0Minutes between backups, which are stored in tshock/backups
RestApiEnabled / RestApiPortfalse / 7878The REST API and the port it uses

Plugins are compiled assemblies. ServerPlugins already holds TShockAPI.dll; drop a plugin .dll into the same folder and it loads at startup.

Upgrading means replacing every file in the server installation with the files from the release zip, overwriting everything — hence the project's instruction to back up the existing server and all its files and folders first, tshock.sqlite and the tshock folder included.

Errors you are likely to hit

“You are not using the same version as this server.” The client and server builds differ. tModLoader's troubleshooting page notes that this also appears when the target is an unmodded server or an outdated tModLoader server, so check that the versions match exactly on both sides.

Nobody outside the local network can connect. Work through it in order. An address beginning with 192.168 is local and only works for players on the same router, so remote players need the internet-facing address. The firewall must not block the server executable or port 7777. The router needs 7777 forwarded, with UPnP as the automatic alternative. Check reachability by entering 7777 at an external port checker such as canyouseeme.org, and rule out a dynamic public address that has since changed.

World progress is lost, or chest items disappear after the server closes. The world saves automatically only at dawn, once every 24 minutes. Enter save and then exit instead of closing the console window; the case the guide singles out for lost items is moving items between chests and closing straight afterwards.

A tModLoader server starts with no mods. Look for a missing install.txt or enabled.json, or a Mods path the server was never given. If mods load but become disabled when a player joins, server.log holds the exception naming the mod — often code touching client-only fields that are null on a server, or initialising UI that does not exist server-side.