Dedicated server or Host & Play?
Terraria gives you two ways to run a multiplayer world. Host & Play starts a world inside the normal game, while a dedicated server is a separate program that runs the world on its own. The dedicated route keeps the world online when you quit the game, which matters for friends in other time zones and for any community server.
This guide covers the vanilla server that ships with the game, then explains when to add TShock or tModLoader. If you would rather join an existing world, the Terraria server directory lists community servers by style, and the free items and survival pages narrow it down.
| Host & Play | Dedicated server | |
|---|---|---|
| Runs inside | The normal game client | TerrariaServer program |
| World when host leaves | Shuts down | Stays online |
| Configuration | Menu choices and an optional password | serverconfig.txt and launch options |
| Best for | Small LAN or friends sessions | Always-on worlds, communities |
| Moderation tools | Basic | Console commands, or TShock for more |
“The world shuts down when the player that hosted the world leaves the world.”
What you need before you start
- A computer or VPS that can stay on. A static internal IP stops the router from reassigning your host.
- The same game version on the server and every client. The latest vanilla server listed on the Terraria Wiki is 1.4.5.8.
- Port 7777 open for TCP. Cloud hosts also need UDP 7777, and home routers need port forwarding.
- A world file, or permission for the server to create one.
Windows includes the server executable with the game, so run TerrariaServer.exe from the Terraria folder. On Linux you download the server zip, make the launcher executable and run it, ideally inside tmux or screen so it survives logout. macOS on Apple Silicon needs Rosetta 2, and the wiki notes that Gatekeeper quarantine and permissions must be fixed after each update.
Set it up step by step
- 1
Start the server once
Run TerrariaServer.exe, or the Linux or macOS launcher. With no configuration it opens a console and a wizard where you choose or create a world.
- 2
Copy and edit serverconfig.txt
Keep the original file and edit a copy. Lines starting with # are disabled, so remove the # to enable an option. Launch with -config pointing to your file.
- 3
Set the essentials
Choose world, autocreate size, difficulty, maxplayers, port, password and motd. Enable secure for extra cheat protection if you want it.
- 4
Forward the port
Find the server's internal IP with ipconfig on Windows or ip addr on Linux, then forward port 7777 on your router to it. Look up your external IP with any what-is-my-IP site.
- 5
Connect from the game
Players choose Multiplayer, then Join via IP, pick a character and type the address. Friends on your network use the internal IPv4, everyone else uses your external IP.
| Option | Meaning | Values or default |
|---|---|---|
| world | Load a specific world file | Path to a .wld file |
| autocreate | Create a world if none exists | 1 small, 2 medium, 3 large |
| difficulty | World difficulty | 0 Classic, 1 Expert, 2 Master, 3 Journey |
| maxplayers | Player cap | 1 to 255; default 16 |
| port | Listening port | 7777 |
| password | Join password | Blank for none |
| secure | Extra cheat protection | Off unless enabled |
| upnp | Automatic port forwarding | Router must support it |
Keep it running and keep your world safe
The most common loss comes from closing the window. The Terraria Wiki guide warns that the server saves at dawn, so quitting by clicking the X can lose recent progress. Type exit in the console, which saves first, or save before you stop for the day. The command exit-nosave exists, so be careful which one you type.
When friends cannot connect, work through the checklist from the same guide: confirm the IP address, the firewall rule, the port number and the router's port forwarding. A dynamic home IP can change, so recheck it if a server that worked yesterday has gone quiet.
- Default port
- 7777
- Default max players
- 16
- Latest vanilla server on the wiki
- 1.4.5.8
TCP; cloud hosts also need UDP
8 before 1.4.0.1
Many older versions also listed
Platform notes and who can join
| System | How it starts | Watch out for |
|---|---|---|
| Windows | Run TerrariaServer.exe from the Terraria folder | Use -config with a batch file or shortcut for repeat launches |
| Linux | Make the launcher executable, run TerrariaServer.bin.x86_64 or the script | Use tmux or screen; if you see a Magic number error, run export TERM=xterm |
| macOS | Run the launcher after clearing quarantine | Apple Silicon needs Rosetta 2; fix permissions after each update |
| Raspberry Pi and others | Run the server with Mono | Not an official platform, so expect to troubleshoot yourself |
Several servers on one machine are possible, but each needs its own config file, world and port. Worlds are saved in a Worlds folder, for example ~/.local/share/Terraria/Worlds on Linux, so back that folder up before every game update.
Who can join is also limited by platform. The Terraria Wiki says desktop, console and mobile players generally cannot play together, and only Android and iOS cross-play with each other. It adds that desktop and mobile can meet on dedicated servers, which it suggests is probably unintentional, so do not plan around it. Check the free items servers and survival servers pages if your friends use different devices and you want a ready-made option.
Vanilla, TShock or tModLoader?
Which server software fits
Vanilla server
- Ships with the game, simple console
- Kick, ban, password, save and time commands
- Fine for friends and small groups
- Match the exact game version
TShock or tModLoader
- TShock adds permissions, regions, server-side characters and anti-cheat
- tModLoader runs mods; every player needs the same mods
- The two are separate stacks, not combined
- Both can trail the newest vanilla patch
The TShock project describes itself as "a toolbox for Terraria servers and communities", with anti-cheat tools, server-side characters, groups, permissions and many commands. Its GitHub release page lists a build supporting Terraria 1.4.5.8. The Terraria Wiki describes tModLoader as a standalone program for playing with mods and says the current stable release is based on 1.4.4.9, so a mod server can sit one version behind vanilla.
That version gap is the most common reason a friend cannot join a modded world. Compare what each side runs before blaming the network, and see the glossary for terms like SSC and region, and how to choose a private server if you decide to join someone else's world instead. If you later grow into a public community, building a server community covers rules and staff, and understanding wipes explains reset policies.
Where to go next
