Terraria.tools

Home / Guides

Server

ServerSystems

when a dedicated server is the right call

A dedicated server runs the world as its own process, with no rendering and nobody attached. The world exists whether or not any particular person is online, the host can close their client without dropping everybody, and the machine doing the work can be a spare desktop or something rented by the month.

It is worth running for one player too. The console gives you time commands that jump straight to dawn, noon, dusk or midnight, so anything gated on time of day stops being a waiting game.

the network part

The server listens on TCP port 7777 unless told otherwise. Behind a home router that port has to be forwarded before anyone outside the house can reach it. The server offers to arrange this itself using UPnP when it starts, and that offer works often enough to be worth taking and fails often enough that you should not build a plan around it.

If forwarding is genuinely unavailable, a VPN service sidesteps it by putting everyone on one virtual network, at the cost of every player installing the same software. On a rented cloud machine you are not behind NAT, but the port still has to be opened on both TCP and UDP in the provider's own firewall rules, which is separate from the system firewall.

On a home network everyone connects to the server machine's local address, the one beginning 192.168 or 10 or 172. Those addresses change when a router reboots, so when a setup that worked last week stops working, check it first.

getting it running

On Windows the server executable ships with the game and sits in the install folder beside the client. A batch file next to it starts the server from a config file and relaunches it if it crashes, which is the sensible way in.

On Linux the server package is a separate download. Unzip it, mark the binary executable, and run it. Worlds have to sit in the Terraria worlds folder under your home directory or the server will not find them. On a Mac you are launching an unsigned application, so you have to clear the quarantine attribute and mark the binaries executable after every single update, which is why a short start script beats typing it each time.

On hardware that is not x86, a Raspberry Pi being the usual case, there is no prebuilt binary and Mono runs the Windows executable instead. If it complains that its runtime and class libraries disagree, delete the bundled Mono and System files.

the config file is the real interface

Started bare, the server asks the same short list of questions every time. Pointing it at a config file answers all of them in advance, and after the first evening that is how you should run it. The file is plain text, one setting per line, and any line beginning with a hash is skipped, so you can leave notes in it.

The settings that matter are the world path, the difficulty, the player cap, the port, the password and the message of the day. Difficulty runs 0 through 3 for classic, expert, master and journey, with mobile servers offset by one for reasons nobody enjoys explaining. The cap accepts 1 to 255, though the default of 16 is already more than most worlds are pleasant with.

Autocreate catches people out. It only generates a world when nothing is found at the world path, so it is a first run convenience rather than a reset button. Pair it with the seed and world name settings for a specific world.

Journey worlds add a block of their own, one line per power, each set to locked, host only, or open to everyone. Time control, godmode, spawn rate, difficulty and biome spread freezing are switched separately, which is the difference between a shared creative world and one person quietly rewriting it.

running it day to day

The console takes commands bare, with no slash in front: the player roster, save, kick and ban, the two that change password and message of the day without a restart, and the four time commands.

Shutdown has two forms and they are not interchangeable: one saves and exits, the other exits without saving. The automatic save runs on its own schedule and only the first form writes on the way out, so save manually before shutting down either way.

With nobody connected the server hibernates and world time stops, which costs nothing while idle but means crops and the day cycle only advance while somebody is playing. To keep a Linux server alive after you close the terminal, start it inside a multiplexer such as tmux and detach, then reattach when you need the console again.

bans, and what vanilla does not do

Banning writes the player's name and address into a plain text list in the server folder. There is no unban command: open that file, delete the line, and the ban is gone. The banned player is shown the reason and duration when they next try to connect.

Past that the stock server is deliberately thin: no whitelist, no accounts, no permissions, no plugins. Third party packages add all of it plus in game commands, which is why most public servers ask you to register and log in.

More on systems