KnowledgeTerraria

Terraria serverconfig.txt Explained (Every Setting and Default)

Every Terraria serverconfig.txt key with its default: world, autocreate, difficulty, maxplayers, password, motd, port, secure and Journey permissions.

Updated Oct 1, 2026 · 7 min read

On this page

serverconfig.txt is the settings file for the Terraria dedicated server. Start the server with TerrariaServer -config serverconfig.txt and it loads the world in world=, or creates one with autocreate=, then listens on port=7777 with up to maxplayers=8 players. The keys you will actually change are world, autocreate, worldname, difficulty, maxplayers, password and motd. Without a config file the server asks these questions one by one in the console every time it starts, which is why everyone ends up writing one.

A working serverconfig.txt

world=/home/terraria/Worlds/Friends.wld
autocreate=2
worldname=Friends
difficulty=1
maxplayers=8
port=7777
password=changeme
motd=Welcome! Be nice and don't cut the purple trees.
worldpath=/home/terraria/Worlds/
banlist=banlist.txt
secure=1
language=en-US
upnp=0
npcstream=60
priority=1

Lines starting with # are comments. One key per line, no spaces around the =.

World settings

Key Default What it does
world none Full path to the .wld file to load. The server starts straight into it.
autocreate off Creates the world if the world file does not exist. 1 small, 2 medium, 3 large.
worldname none Name of a world made by autocreate
seed random Seed for autocreate
difficulty 0 For new worlds: 0 Classic, 1 Expert, 2 Master, 3 Journey
worldpath Terraria's Worlds folder Folder where world files live

How they work together: the server looks for the file in world. If it exists, it loads it and ignores autocreate, worldname, seed and difficulty. If it does not exist and autocreate is set, it makes a new world with those settings and saves it at the world path. So set all of them once, start, and from then on the same config just loads your world.

Picking a size. Medium (2) is our default pick for 2 to 8 players. Large (3) gives big groups room to spread out but takes longer to generate, uses more memory and makes boss hunts longer. Small is fine for a quick playthrough with one or two friends.

Difficulty only applies to new worlds. Changing difficulty on an existing world does nothing. Expert and Master are set when the world is created, and Journey worlds only accept Journey characters (and the other way round).

Server settings

Key Default What it does
maxplayers 8 Player limit, 1 to 255
port 7777 TCP port the server listens on
password none Join password. Empty means open to anyone with the address.
motd none Message shown to players when they join
banlist banlist.txt File that stores bans from the ban command
secure off unless set 1 adds extra cheat protection
language en-US Server language: en-US, de-DE, it-IT, fr-FR, es-ES, ru-RU, zh-Hans, pt-BR, pl-PL
upnp on Tries to forward the port on your router automatically
npcstream 60 Lower means less enemy "skipping" but more bandwidth. 0 is off.
priority 1 Process priority: 0 Realtime, 1 High, 2 AboveNormal, 3 Normal, 4 BelowNormal, 5 Idle

What we would set:

  • maxplayers: your group size plus two. Terraria supports up to 255, but most worlds are 4 to 16 players. Our plans are sized for 8, 16 and 32.
  • password: always set one unless the server is meant to be public. Terraria has no allowlist, so the password is your main lock. Use the ban console command for anyone who misbehaves.
  • secure=1: turn it on. It adds cheat protection at almost no cost.
  • upnp=0 on a hosted or properly forwarded server. UPnP is only useful at home with a router that supports it.
  • npcstream: leave it at 60. If enemies teleport around for players far from the server, try 30.
  • priority: leave it. On a dedicated machine it makes no difference, and 0 (Realtime) can starve the rest of the system.

Journey mode permissions

If the world is a Journey world, these keys decide who can use each Journey power. Every key takes 0 (locked for everyone), 1 (host only) or 2 (everyone). They all default to 2.

Key Power
journeypermission_time_setfrozen Freeze time
journeypermission_time_setdawn Set dawn
journeypermission_time_setnoon Set noon
journeypermission_time_setdusk Set dusk
journeypermission_time_setmidnight Set midnight
journeypermission_time_setspeed Time speed
journeypermission_godmode God mode
journeypermission_wind_setstrength Wind strength
journeypermission_wind_setfrozen Freeze wind
journeypermission_rain_setstrength Rain strength
journeypermission_rain_setfrozen Freeze rain
journeypermission_increaseplacementrange Placement range
journeypermission_setdifficulty Enemy difficulty slider
journeypermission_biomespread_setfrozen Stop biome spread
journeypermission_setspawnrate Enemy spawn rate

A dedicated server has no host player in the usual sense, so we stick to 0 and 2. Use 2 for powers your group agrees on and 0 for ones you want gone, for example journeypermission_godmode=0 if you want Journey building with real fights.

Command line options override the file

Most keys have a matching launch option, and options on the command line win over the file: -port 7777, -players 8 (or -maxplayers), -pass (or -password), -motd, -world, -autocreate, -worldname, -seed, -banlist, -secure, -noupnp. A few only exist as options: -ip to bind one address, -steam for Steam support and -lobby friends or -lobby private for Steam lobbies, and -disableannouncementbox with -announcementboxrange for Announcement Boxes.

This matters on hosted servers. If your host passes the port or player count on the command line, editing those lines in the file changes nothing.

Console commands to change things live

Some settings can be changed without a restart in the server console:

password newpassword
motd Welcome back! Boss night is Friday.
maxplayers
port

password and motd with a value change it, without a value they print the current one. maxplayers and port only print. Other useful console commands: playing, save, kick <player>, ban <player>, say <message>, dawn, noon, dusk, midnight, settle and exit. Changes made in the console are not written back to serverconfig.txt, so update the file too.

tModLoader and TShock

tModLoader reads the same serverconfig.txt format and adds two of its own keys: modpath, the folder with your .tmod files, and modpack, a mod pack name to load. Most setups leave both alone and use the Mods folder with enabled.json. See how to make a Calamity mod server.

TShock still accepts the vanilla options, but has its own tshock/config.json for many server settings like ServerPassword, MaxSlots and ServerPort. When both set the same thing, set it in TShock's file. See TShock commands for Terraria servers.

serverconfig.txt on GamezServers

The settings most people change are in Settings in the panel: World name, world size, Difficulty, Join password, Welcome message and the Terraria version, with the player limit set by your plan. The panel applies these when the server starts, so change them there rather than in the file. The rest you edit in the Files tab. Stop the server, edit, start.

Want to bring your own world instead of generating one? Follow how to upload a Terraria world to a server. New to hosting? The Terraria quick start has you online in about a minute.

FAQ

Where is serverconfig.txt?

In the dedicated server folder, next to TerrariaServer.exe (Windows) or TerrariaServer (Linux). The server only uses it when started with -config serverconfig.txt, so add that to your start command or script.

Why does my server keep asking me to choose a world?

It is not reading your config. Either it was started without -config, or the world path is wrong and autocreate is not set. Check the path, including capitals on Linux.

How do I change the difficulty of an existing Terraria world?

You cannot through serverconfig.txt. Difficulty is fixed when the world is made, apart from Journey worlds where the enemy difficulty slider can change it in game.

What port does a Terraria server use?

TCP 7777 by default. If you self host, forward TCP 7777 on your router. On a hosted server, use the port your host gives you, entered on the screen after the IP.

Is the Terraria server password case sensitive?

Treat it as case sensitive and share it exactly as set. Players type it on the screen after the port.

Skip the setup. Your own Terraria server.

$2.49USD first month

Then $4.99/mo. Just trying it? $1.25 for 3 days

Keep reading