Skip to content
PrivateServers.com
Tutorial

How to Host a Dedicated Terraria Server

Set up a dedicated Terraria server on Windows, Linux or macOS: config file, port 7777, saving safely, and when to pick TShock or tModLoader instead.

PrivateServers.com Editorial Published October 15, 2026 7 min read

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 compared with a dedicated server
Host & PlayDedicated server
Runs insideThe normal game clientTerrariaServer program
World when host leavesShuts downStays online
ConfigurationMenu choices and an optional passwordserverconfig.txt and launch options
Best forSmall LAN or friends sessionsAlways-on worlds, communities
Moderation toolsBasicConsole commands, or TShock for more
“The world shuts down when the player that hosted the world leaves the world.”
— Terraria Wiki, Multiplayer

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. 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. 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. 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. 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. 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.

Common serverconfig.txt options
OptionMeaningValues or default
worldLoad a specific world filePath to a .wld file
autocreateCreate a world if none exists1 small, 2 medium, 3 large
difficultyWorld difficulty0 Classic, 1 Expert, 2 Master, 3 Journey
maxplayersPlayer cap1 to 255; default 16
portListening port7777
passwordJoin passwordBlank for none
secureExtra cheat protectionOff unless enabled
upnpAutomatic port forwardingRouter 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

TCP; cloud hosts also need UDP

Default max players
16

8 before 1.4.0.1

Latest vanilla server on the wiki
1.4.5.8

Many older versions also listed

Platform notes and who can join

Running the dedicated server on each system
SystemHow it startsWatch out for
WindowsRun TerrariaServer.exe from the Terraria folderUse -config with a batch file or shortcut for repeat launches
LinuxMake the launcher executable, run TerrariaServer.bin.x86_64 or the scriptUse tmux or screen; if you see a Magic number error, run export TERM=xterm
macOSRun the launcher after clearing quarantineApple Silicon needs Rosetta 2; fix permissions after each update
Raspberry Pi and othersRun the server with MonoNot 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.

Frequently asked questions

What port does a Terraria server use?

The default is 7777 over TCP. Cloud hosts need TCP and UDP 7777 open, and home setups need a port forwarding rule on the router to the server's internal IP. You can change it with the port option in serverconfig.txt.

How many players can a Terraria server hold?

The default is 16, up from 8 before version 1.4.0.1. The configuration guide lists a maxplayers range from 1 to 255, set either at launch or in the config file. Real capacity depends on your hardware and connection.

How do I stop a Terraria server without losing progress?

Use the exit console command, which saves before shutting down, or run save first. Closing the window is risky because the server only saves at dawn, so recent progress can be lost. The exit-nosave command skips saving.

Do I need TShock to host a server?

No. The vanilla server works for friends. TShock is optional and adds permissions, regions, whitelists, server-side characters and anti-cheat. It is a separate server stack from tModLoader, so you pick one.

Why can't friends join my server?

Check the IP address, the firewall, the port and your router's forwarding. Everyone must run the same game version, and modded servers need identical mods. Players on your home network use the internal IPv4, while everyone else uses your external IP.

Sources and further reading

Top Terraria servers right now

Latest1x EXPOnline

Welcome to Ozzaria, the ultimate Terraria private server where adventure and camaraderie collide! In the vibrant world of Terraria, Ozzaria stands out as a beacon for…

Standard1x EXPOnline

Teeria Legends offers a Free Items server where players can access every item available in Terraria through refillable chests, allowing free building, breaking, and PvP…

TShock-based RPG (version not stated)Online

TerraShine is an Indonesian-language Terraria server documented on a GitBook. It describes itself as the continuation of Terrasi, which has operated since 2020. The docs…

See all Terraria servers →
PE

PrivateServers.com Editorial

Guides written and kept up to date by the PrivateServers.com team, based on how players actually choose, join and stay on private servers.