Terraria serverconfig.txt Explained: Every Key, Grouped by What It Does
Every serverconfig.txt key from the official 1.4.5.8 zip — world, autocreate, difficulty, maxplayers (1–255), port, password, worldrollbackstokeep, secure, npcstream, the fifteen Journey permissions — plus the command-line flags that duplicate them.
October 15, 20267 min read
Share:
Share
On This Page
The whole configuration of a Terraria dedicated server is one file of key=value lines, read once at start. It is short enough to learn in full, and learning it in full is worth it, because three of its keys only do anything the first time a world is created, one of them silently decides which world you are playing, and fifteen of them only matter in Journey Mode. This is every key, grouped by what it does, with the command-line flags that duplicate them.
Keys and ranges are from the config file that ships inside the official 1.4.5.8 server zip and the Terraria wiki's server page.
The example serverconfig.txt ships only in the Windows/ folder of the zip, so Linux users copy it across or write their own. On a Connect Terraria server the file is written for you from the Server Settings tab on every start; the keys the tab manages are listed at the end.
About to spend an evening on this? We do it in 60 seconds.
The same official dedicated server, already installed: port open, password set, world name, size, difficulty and max players editable from the Server Settings tab. From $5.99/mo, online in 60 seconds.
Where worlds are stored. Default on Linux: ~/.local/share/Terraria/Worlds/
worldrollbackstokeep
number
How many .wld.bak rollback copies to keep; the shipped example uses 2
The point that trips people: autocreate, worldname, seed and difficulty are read only when a world is being created. Change difficulty for an existing world and nothing happens. And world is not a label — point it at a path with no file and the server generates a fresh world there, which looks like your old one vanishing. The old file is still where it was.
The special seeds each have a key too: seed_celebration, seed_theconstant, seed_notthebees, seed_notraps, seed_fortheworthy, seed_remix, seed_drunk and seed_zenith. They apply at creation like seed does.
The player keys
Key
Values
What it does
maxplayers
1–255
How many players can be connected at once. The shipped example uses 8
password
text
Players must enter it to join. Empty for an open server
motd
text
The message shown on joining
banlist
path
Where banned players are recorded. Defaults to banlist.txt in the working directory
secure
0, 1
1 adds what the wiki calls "additional cheat protection"
maxplayers is the number people argue about. The game accepts anything from 1 to 255; the wiki quotes a default of 16 and the shipped example says 8; Re-Logic recommends nothing. Any cap a host advertises — sixteen on every Connect plan, for instance — is that host's choice, not a limit of the game.
The network keys
Key
Values
What it does
port
number
The TCP port, 7777 by default. Joining by IP uses TCP only
upnp
0, 1
1 asks your router to forward the port automatically. On a hosted server, 0
npcstream
0–60
Trades bandwidth for smoother enemy movement; the wiki's description is that lower numbers reduce skipping but send more data. 0 is off; 60 is the shipped value
The process keys
Key
Values
What it does
priority
0–5
OS process priority: 0 Realtime, 1 High, 2 Above Normal, 3 Normal, 4 Below Normal, 5 Idle. The example uses 1
language
locale
One of the game's twelve locales, en-US by default. Sets the language of the server's own messages
slowliquids
0, 1
Slows liquid simulation; present in the shipped config
The Journey Mode keys
Fifteen keys, all journeypermission_<power>, each set to 0 (locked), 1 (host only) or 2 (everyone, the default). They only matter on a world created with difficulty=3:
Which ones to lock on a shared server, and why 1 means little on a dedicated server, is the subject of Journey Mode server permissions.
Config keys versus command-line flags
Most keys have a flag twin: -port, -players (or -maxplayers), -pass (or -password), -motd, -world, -autocreate, -worldname, -seed, -banlist, -secure, -noupnp, -ip, -forcepriority, -disableannouncementbox and -announcementboxrange. Two flags have no config equivalent and are not for a dedicated server at all: -steam and -lobby friends|private create a Steam-friends session, which has nothing to do with joining by IP. Flags for difficulty, worldpath and language are not documented; use the file for those.
A file is easier to keep straight than a long command line, and it is what every hosting panel writes, so our advice is to put everything in serverconfig.txt and pass only -config.
Change world, worldname, worldpath and password, pick a size and difficulty, and that is a working server. The install around it is in the setup guide.
What the console changes, and what it does not
A few values can be changed while the server runs, from the console: password, motd and maxplayers are also console commands (the first two set, the third only prints). Those changes last until the next start, when the file is read again. Everything else is file-only and needs a restart. Shutting down with exit saves the world; exit-nosave does not.
On a Connect server
The Server Settings tab manages world, autocreate, worldname, seed, difficulty, maxplayers, password, motd and language, and writes port, worldpath, worldrollbackstokeep=2, secure=1, upnp=0, npcstream and priority=1 for you. The tab also warns when a change to World Name would create a new world — the trap from the first table. Keys the tab does not manage, such as the Journey permissions, can be added on the Files tab and are left in place across restarts. Every setting on the tab is described in server settings.
Frequently Asked Questions
Where is serverconfig.txt?
Wherever you put it: the server reads the file named by -config. The example ships in the Windows/ folder of the official zip.
Why did changing difficulty do nothing?
difficulty, like autocreate, worldname and seed, applies only when the server creates a world. An existing world keeps the difficulty it was made with.
What is the maximum maxplayers?
The minimum is 1. The shipped example uses 8; the wiki quotes 16 as a default. Re-Logic recommends no figure.
Does the server need UDP open?
No. Joining by IP uses TCP on the port set by port, 7777 by default.
What does worldrollbackstokeep do?
It sets how many previous saves are kept as .wld.bak files beside the world, so a bad save can be rolled back. The shipped example keeps 2.
Can I change settings without restarting?
password and motd can be set from the console while the server runs, until the next start. Everything else is read from the file at start.
You've just read the manual. We do it in 60 seconds.
The same official dedicated server, already installed: port open, password set, world name, size, difficulty and max players editable from the Server Settings tab. From $5.99/mo, online in 60 seconds.