Terraria serverconfig.txt keys explained
Tutorials

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

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.

Where the file is

The server reads the file you name with -config:

./TerrariaServer.bin.x86_64 -config serverconfig.txt

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.

Start a Terraria server

The world keys

KeyValuesWhat it does
worldpath to a .wldThe world to load. If the file does not exist and autocreate is set, the server creates it
autocreate1, 2, 3Create the world if it does not exist, at this size: 1 small (4200×1200 tiles), 2 medium (6400×1800), 3 large (8400×2400)
worldnametextThe name the new world is given
seedtextThe seed used when the world is created
difficulty0, 1, 2, 30 Classic, 1 Expert, 2 Master, 3 Journey. Applies at creation
worldpathfolderWhere worlds are stored. Default on Linux: ~/.local/share/Terraria/Worlds/
worldrollbackstokeepnumberHow 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

KeyValuesWhat it does
maxplayers1–255How many players can be connected at once. The shipped example uses 8
passwordtextPlayers must enter it to join. Empty for an open server
motdtextThe message shown on joining
banlistpathWhere banned players are recorded. Defaults to banlist.txt in the working directory
secure0, 11 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

KeyValuesWhat it does
portnumberThe TCP port, 7777 by default. Joining by IP uses TCP only
upnp0, 11 asks your router to forward the port automatically. On a hosted server, 0
npcstream0–60Trades 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

KeyValuesWhat it does
priority0–5OS process priority: 0 Realtime, 1 High, 2 Above Normal, 3 Normal, 4 Below Normal, 5 Idle. The example uses 1
languagelocaleOne of the game's twelve locales, en-US by default. Sets the language of the server's own messages
slowliquids0, 1Slows 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:

journeypermission_time_setfrozen=2 journeypermission_time_setdawn=2 journeypermission_time_setnoon=2 journeypermission_time_setdusk=2 journeypermission_time_setmidnight=2 journeypermission_godmode=2 journeypermission_wind_setstrength=2 journeypermission_rain_setstrength=2 journeypermission_time_setspeed=2 journeypermission_rain_setfrozen=2 journeypermission_wind_setfrozen=2 journeypermission_increaseplacementrange=2 journeypermission_setdifficulty=2 journeypermission_biomespread_setfrozen=2 journeypermission_setspawnrate=2

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.

A complete example

world=/home/you/terraria/worlds/Dirt Castle.wld autocreate=2 worldname=Dirt Castle seed= difficulty=0 maxplayers=8 port=7777 password=changeme1 motd=Welcome to Dirt Castle worldpath=/home/you/terraria/worlds worldrollbackstokeep=2 secure=1 language=en-US upnp=0 npcstream=60 priority=1

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?

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

Start a Terraria server

Or see plans, specs and regions on Terraria server hosting.

Related Help Articles

Need step-by-step instructions? Check out these guides in our Help Center.