Hosting Terraria servers on bare metal
A Terraria world needs little: one core and a gigabyte or two of memory. That makes a single dedicated machine a home for a whole network of worlds, vanilla, plugin and modded side by side.
Which Terraria server should I run?
That depends on the community, and all three options run on Linux. The official server comes as a zip from the game's website and includes a Linux binary. TShock wraps the official server with permissions, regions, anti-cheat checks and a plugin system. tModLoader runs content mods and has its own dedicated server, which is also installable with SteamCMD as app 1281930.
| Server | Best for | Clients need |
|---|---|---|
| Official server | Small vanilla groups | The game only |
| TShock | Public servers, admins, regions | The game only |
| tModLoader | Content mods such as new bosses | tModLoader with matching mods |
How do I start the official server?
Unzip the release, mark the Linux binary as executable and hand it a configuration file. The binary lives in the Linux folder of the download.
unzip terraria-server-1449.zip -d /opt/terraria chmod +x /opt/terraria/1449/Linux/TerrariaServer.bin.x86_64 runuser -u terra -- /opt/terraria/1449/Linux/TerrariaServer.bin.x86_64 -config /home/terra/world1.txt
Replace 1449 with the version you downloaded. Running inside tmux or screen, or as a systemd service with standard input attached, keeps the console available for commands such as save, kick and exit.
What belongs in serverconfig.txt?
Plain key=value lines that answer the questions the server would otherwise ask at start.
world=andworldpath=: the world file and its folder.autocreate=: 1, 2 or 3 for a small, medium or large world when the file does not exist yet.difficulty=: 0 classic, 1 expert, 2 master, 3 journey.maxplayers=: eight by default, up to 255 in theory; 16 to 32 is typical.port=: 7777 by default, a different TCP port for each extra world.password=andmotd=: the join password and the greeting.secure=1: turns on the built-in cheat protection.
Which port does Terraria use?
TCP 7777, unlike most game servers, which use UDP. Each further world takes its own TCP port, so worlds two to ten might use 7778 to 7786. Open exactly the ports you assign and nothing more.
for p in $(seq 7777 7786); do ufw allow proto tcp to any port $p comment terraria; done
How many worlds fit on one machine?
Dozens. A large vanilla world with a dozen players uses around 1 to 1.5 GB of memory and most of one core during busy events. tModLoader worlds with large content packs can need 3 to 6 GB each. The arithmetic for ESSENTIAL-3, with 12 cores and 32 GB DDR4, works out like this:
| World type | Memory each | Worlds that fit comfortably |
|---|---|---|
| Vanilla or TShock | 1 to 1.5 GB | About 20, limited by cores during events |
| tModLoader, light mods | 2 to 3 GB | About 10 |
| tModLoader, large packs | 4 to 6 GB | About 5 |
At $61.20 a month that is a very low cost per world. For the strongest single-core speed, ESSENTIAL-S reaches 5.5 GHz with 64 GB DDR5.
How do I set up TShock?
Download the release built for your operating system, extract it, and start the server once to create the tshock folder with its config.json and database. The first start prints a one-time setup code; enter /setup with that code in game to claim superadmin rights, then create your own account with /user add. Groups and permissions live in the database, so back it up with the world files. Plugins go into ServerPlugins.
What should I back up?
The .wld files and the rolling .bak copy next to each, plus the TShock or tModLoader folders. Worlds are small, often under 50 MB, so hourly copies to another machine cost almost nothing. A journey of two hundred hours can be ruined by one bad wiring experiment; hourly archives make that a five minute fix.
rsync -a --delete /home/terra/.local/share/Terraria/Worlds/ backup@vault.example.net:terraria/$(date +%H)/
Is the network side a concern?
Traffic is tiny, a few kilobits per player, so even a busy network of worlds barely touches the port. What matters is steady latency and filtering of floods aimed at the game ports, both included on every model. Our Firewall for game servers guide covers firewall rules for game hosts.
Machines for Terraria networks
Lowest monthly price of each model across its data centres; the model page shows the price in every location.
| Model | Processor | Cores | Memory | Drives | Port | Per month |
|---|---|---|---|---|---|---|
| ESSENTIAL-GAME-1 | AMD Ryzen 5 5600X | 6 | 32 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $43.20 |
| ESSENTIAL-3 | AMD Ryzen 9 5900X | 12 | 32 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $61.20 |
| ESSENTIAL-S | AMD Ryzen 7 9700X | 8 | 64 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $46.20 |
| ESSENTIAL-GAME-2 | AMD Ryzen 7 5800X | 8 | 64 GB | 2x 960 GB SSD NVMe | 1 Gbps unmetered | $60.00 |
| ESSENTIAL-M | AMD Ryzen 9 9900X | 12 | 64 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $70.80 |
One Ryzen machine can host a whole network of vanilla, TShock and modded worlds.
Related pages
Game server hosting
Ryzen X3D and Ryzen 5000 machines for Minecraft, Rust, CS2 and FiveM worlds that need steady tick rates.
Read moreMinecraft Java server
Run a Minecraft Java server or a whole network: Java 21, Paper, a Velocity proxy, JVM flags, pre-generated worlds and the right machine.
Read moreFirewall for game servers
Open exactly the UDP and TCP ports a game needs, protect query ports from reflection abuse and keep lag low under load.
Read moreEssential servers
Affordable bare metal for websites, development and first production apps.
Read moreQuestions and answers
Does the official Terraria server run on Linux?
Yes. The server download from the game website includes TerrariaServer.bin.x86_64 in its Linux folder.
Which port does a Terraria server use?
TCP 7777 by default. Each extra world on the same machine needs its own TCP port, such as 7778, 7779 and so on.
How much memory does a Terraria world need?
A vanilla or TShock world uses about 1 to 1.5 GB. Modded tModLoader worlds with large content packs can use 3 to 6 GB.
What is the difference between TShock and tModLoader?
TShock adds admin tools, permissions and plugins while players keep the normal game. tModLoader adds new content, so players must run tModLoader with the same mods.
How many players can join a Terraria server?
The maxplayers setting defaults to eight and accepts up to 255; most communities run 16 to 32 per world.