How to Set Up a Terraria Dedicated Server

Brandon M.
4.9

482+ Satisfied Customers

Running your own Terraria dedicated server gives you full control over the world, the settings, and who gets to join. It also gives you full responsibility for keeping it running, backing it up, and troubleshooting when things break. Here’s what’s actually involved so you can decide if it’s worth your time.

What you need

The good news: Terraria’s server software is lightweight. A vanilla server with a small or medium world uses around 300-500MB of RAM and barely touches the CPU outside of boss fights. You don’t need beefy hardware.

What you do need:

  • A machine that can stay on while people play (your gaming PC works, a spare laptop or desktop is better)
  • A stable internet connection with reasonable upload speed - 5Mbps up handles a small group fine
  • The ability to forward a port on your router (more on this later - it’s the part that trips most people up)
  • Windows, Linux, or macOS - the server runs on all three

If you’re planning to run mods through tModLoader, bump your RAM expectations to 1-2GB depending on your mod list. For a deeper look at RAM sizing, we have a breakdown of Terraria server RAM requirements that covers vanilla through heavy modpacks.

Downloading the server files

You have two options depending on your setup.

Through Steam (easiest): Open your Steam library, check the “Tools” box in the filter dropdown, and look for “Terraria Server.” Install it like any other game. The server files end up in your Steam directory under steamapps/common/Terraria Server/.

Through SteamCMD (for headless/Linux machines): If you’re setting this up on a machine without a full Steam install - a VPS, a headless Linux box, a Raspberry Pi - SteamCMD is the way. Install SteamCMD, then run:

steamcmd +login anonymous +app_update 105600 validate +quit

App ID 105600 is the Terraria dedicated server. It doesn’t require a paid Steam account to download, which is nice.

Basic configuration

The server ships with a serverconfig.txt file that controls everything. You can run the server without it and answer prompts manually every time, but that gets old fast. Here’s a working config with the settings that actually matter:

world=worlds/MyWorld.wld
autocreate=2
worldname=MyWorld
maxplayers=8
port=7777
password=yourpassword
difficulty=0
secure=1
language=en-US

The key settings:

  • autocreate - 1 (small), 2 (medium), or 3 (large). This generates a new world if the file in world doesn’t exist yet. Medium is a safe default for most groups.
  • port - 7777 is the default. Change it if you’re running multiple servers or have a conflict, but 7777 is what people will try first.
  • password - Set one unless you want random people finding your server. Even for private groups, it keeps things clean.
  • difficulty - 0 is Classic, 1 is Expert, 2 is Master, 3 is Journey. This only applies to newly created worlds.
  • maxplayers - Cap this at what you actually expect. More connected players means more overhead.

To start the server with your config:

# Windows
TerrariaServer.exe -config serverconfig.txt

# Linux
./TerrariaServer.bin.x86_64 -config serverconfig.txt

If the world file doesn’t exist and autocreate is set, it’ll generate one on first launch. World generation takes a minute or two depending on size.

Port forwarding

This is where self-hosting gets annoying. Your friends need to reach your server through the internet, which means traffic on port 7777 needs to get from your public IP address to the machine running the server.

The general steps:

  1. Find your server machine’s local IP address (usually something like 192.168.1.x)
  2. Log into your router’s admin panel (typically 192.168.1.1 or 192.168.0.1)
  3. Find the port forwarding section (sometimes called “virtual servers” or “NAT”)
  4. Create a rule forwarding TCP port 7777 to your machine’s local IP

Every router manufacturer puts this in a different place with different terminology, so I can’t give you exact steps. Search “[your router model] port forwarding” and you’ll find a walkthrough.

CGNAT can block you entirely

Some ISPs - especially mobile/wireless providers and some budget plans - use Carrier-Grade NAT (CGNAT), which means you share a public IP with other customers. Port forwarding doesn’t work behind CGNAT because the public IP isn’t yours to control. You can check by comparing the WAN IP on your router’s status page with what a site like whatismyip.com shows. If they don’t match, you’re behind CGNAT and self-hosting gets significantly harder.

Don’t forget your machine’s firewall, either. Windows Firewall or ufw on Linux - both will block incoming connections on 7777 unless you add an exception.

Port forwarding is the single most common reason people give up on self-hosting and switch to managed hosting. It’s not that it’s hard in theory - it’s that every setup is different and debugging “my friend can’t connect” with no error message is miserable.

Running with tModLoader

If you want mods, the dedicated server process is slightly different. tModLoader has its own server binary that wraps around Terraria’s.

Install tModLoader through Steam (it’s a free game in the shop), then use its server files instead. The launch process is similar, but you’ll also need to manage your mod list through the Mods/enabled.json file in the server’s save directory.

The quickest way to build enabled.json without typos: set up tModLoader on your PC, enable the mods you want through the in-game menu, then copy your local enabled.json (found in Documents/My Games/Terraria/tModLoader/Mods/) to the server. Every player needs the exact same mods and versions installed locally, or they’ll get disconnected on join.

For a full walkthrough of tModLoader mod setup, our tModLoader server guide covers the details.

One thing to watch: if you’re self-hosting a 32-bit tModLoader build, you’ll hit a hard 4GB RAM ceiling regardless of how much memory your machine has. The 64-bit builds don’t have this limitation, and most modern mod setups should use them.

Keeping it running

Here’s the part that guides leave out. Once your server is running, there’s no panel, no auto-restart, and no automatic backups. If the process crashes at 3 AM, it stays crashed until you notice.

On Linux, run the server inside a screen or tmux session so it doesn’t die when you close your terminal:

screen -S terraria
./TerrariaServer.bin.x86_64 -config serverconfig.txt
# Detach with Ctrl+A, then D

For proper persistence, set it up as a systemd service that auto-restarts on crash. Plenty of templates exist online for this.

On Windows, the server runs as a console window. Close the window and the server stops. You can use Task Scheduler to relaunch it on crash or on system boot, but it’s clunky.

Backups are on you. The world file is everything - if it corrupts or you lose it, that’s your playthrough gone. At minimum, set up a scheduled task or cron job that copies your world file to another location daily. Something like:

# Linux cron example - daily backup at 4 AM
0 4 * * * cp /path/to/worlds/MyWorld.wld /path/to/backups/MyWorld_$(date +\%Y\%m\%d).wld

This is the ongoing cost of self-hosting that people underestimate. The initial setup takes an evening. The maintenance - checking if it’s still running, managing backups, updating after Terraria patches - is the real time commitment.

When self-hosting makes sense (and when it doesn’t)

Self-hosting is a solid choice if you have a spare machine, you’re playing with a small group on a schedule, and you’re comfortable with basic server administration. It’s free (besides electricity), you learn something, and you have complete control.

It’s a harder sell if you want the server available 24/7, you don’t want to deal with port forwarding, or you’re running a heavy mod list that needs reliable performance. The gap between “I got it working” and “it runs reliably without me babysitting it” is wider than most guides suggest.

For context on multiplayer options beyond self-hosting, we cover the different ways to play Terraria with friends.


We’re obviously biased, but WinterNode exists because we wanted hosting that didn’t nickel-and-dime people. All our game servers are $1.99/GB - a 2GB vanilla Terraria server runs $3.98/month. You get instant setup, automatic backups, and no port forwarding to wrestle with. Compare that to the hour-plus of configuration above and the ongoing maintenance, and you can decide what your time is worth. Get your Terraria server →

Everything’s backed by our 48-hour refund policy, so there’s no risk in trying things out.

Got questions? Our support team responds to tickets with actual humans, and we’re active on Discord if you prefer chatting there. We also have a tModLoader setup guide in our help center if you want to get into the modded side of things.

Frequently Asked Questions

Yes, but you'll share CPU and RAM with both the game client and the server. For a small vanilla world with a few friends, this works fine most of the time. For modded servers or larger groups, the server competes with your game for resources, and you'll notice it during boss fights. A separate machine - even an old laptop - is a better long-term setup.

Only if you want players to connect when you're not around. If everyone plays at the same time, you can start and stop the server as needed. If people want to pop in and build whenever, the machine needs to stay on and the server process needs to keep running.

Port forwarding is the culprit about 90% of the time. Either the port isn't forwarded correctly on your router, your ISP uses CGNAT (which blocks inbound connections entirely), or a firewall is blocking port 7777. Have a friend try connecting to your public IP at port 7777. If it times out, the traffic isn't reaching your machine.