Private customers Business customers

Terraria serverconfig.txt explainedWorld, difficulty, port & slots

The serverconfig.txt controls your Terraria server: world, world size, difficulty, port, player count and password. This guide explains the most important entries - identical for Vanilla and tModLoader.

serverconfig.txtdifficultyautocreatePort 7777

Published on · last updated on

Structure of the serverconfig.txt

The file consists of key=value lines and sits in the server directory. You edit it via the config editor in the web interface or via WebFTP/SFTP. tModLoader uses exactly the same format as Vanilla.

worldname=My World
maxplayers=8
port=7777
password=

Terraria server hosting from €3.99 / month

Prepaid without a contract, DDoS protection up to 250 Gbit/⁠s.

View plans & prices

Load a world or generate one automatically

There are two ways: load an existing world or have a new one generated. For an existing world, set world= to the path of the .wld file (see upload a world). For a new world, use autocreate:

autocreate=3     # 1=small, 2=medium, 3=large
seed=myseed      # optional world seed
worldname=My World

Set the difficulty

The difficulty value determines the world mode:

  • difficulty=0 - Classic (normal)
  • difficulty=1 - Expert
  • difficulty=2 - Master
  • difficulty=3 - Journey mode

The value applies when a new world is created automatically. Existing worlds keep the mode they were created with.

Port, slots & password

With port (default 7777), you set the game port - what counts is the port shown in the panel. maxplayers sets the number of slots, password protects joining and motd defines the welcome message. After changes, a server restart is required.

A word about the port, because it regularly causes confusion: 7777 is only Terraria's default. Your server has a fixed address made up of IP and port, both shown in the web interface. Enter the port shown there in the configuration - and give your fellow players both together, in the form 123.123.123.123:7777. Details under join a server.

An empty password= means: anyone who knows the address can join. Terraria has no whitelist in the proper sense; the password is the only built-in protection. How to lock the server down beyond that is explained under make your server private.

All important values at a glance

KeyExampleEffect
worldMy World.wldPath to the existing world. If set, autocreate is ignored.
autocreate3Generates a new world if there is none under world. 1=small, 2=medium, 3=large.
worldnameMy WorldName of the newly generated world. Does not change an existing world.
difficulty1World mode, only effective at generation.
seedmyseedOptional seed. Secret seeds such as for the worthy work here too.
maxplayers8Simultaneous players. Takes effect right after a restart, on existing worlds too.
port7777Game port. Has to match the port from the web interface.
passwordsecretJoin password. Empty = open to everyone.
motdWelcome!Message on joining.
secure1Activates Terraria's own anti-cheat.
upnp0Not needed on a rented server - the panel takes care of port forwarding.

Why do my changes not take effect?

Almost always, one of three reasons is behind it, and all three are quickly checked:

  1. No restart. Terraria only reads the file at startup. As long as the server is running, nothing changes - no matter how often you save.
  2. The value only applies at world generation. difficulty, seed and the world size from autocreate are fixed once when the world is created. On an existing world, they have no effect. If you really want to change the mode, you need a new world - see Journey mode.
  3. world overrides autocreate. If there is a world under the given path, the server loads it and ignores all generation parameters. That is the most common case when a new world simply refuses to appear.

A fourth, rarer case: spaces around the equals sign. maxplayers = 8 is not read reliably, maxplayers=8 is. Write the lines without spaces and do not put comments after the value - the # for comments belongs at the start of the line.

Frequently asked questions

When creating automatically, via difficulty=3 in the serverconfig.txt. difficulty 0=Classic, 1=Expert, 2=Master, 3=Journey. Existing worlds keep their original mode.

Via autocreate: 1=small, 2=medium, 3=large, plus worldname and optionally seed. Alternatively, upload an existing .wld and set world= to its path.

Yes. tModLoader uses exactly the same config format as Vanilla Terraria, but additionally loads mods from the mods folder.

Rent your own Terraria server

Vanilla, TShock or tModLoader with Calamity & co., mods & plugins of your choice, your own worlds & config editor - prepaid, made in Germany.

View plans & prices