Terraria serverconfig.txt Explained: Every Setting and Value
Terraria's dedicated server reads serverconfig.txt at startup. The keys that matter most are world (which world file to load), autocreate and worldname (to generate a new one), difficulty, maxplayers, port (7777 by default) and password. A line that starts with # is a comment and is ignored, so remove the # to enable a setting.
Everything here was checked against the Terraria Wiki's server page, which documents Desktop 1.4.5 (released 27 January 2026), on 2026-11-01. Terraria's server is simple, but a few values are easy to get wrong, and those are called out below.
world=loads an existing world file;autocreate=(1 small, 2 medium, 3 large) only creates one if none is found.difficulty=,seed=andworldname=only apply when a world is being auto-created. Values: 0 Classic, 1 Expert, 2 Master, 3 Journey.maxplayersmust be between 1 and 255; the port defaults to TCP 7777.- Anything starting with
#is a comment, and a commented line does nothing. - Stop the server with the
exitcommand so the world is saved.
On this page
Where serverconfig.txt is used
On Windows, start-server.bat starts the server using serverconfig.txt. On Linux you run ./TerrariaServer.bin.x86_64 (the x86 binary on 32-bit) and can point at your file with -config. Many of the same options can also be passed as command-line parameters; the table below lists both forms where the wiki documents one.
# serverconfig.txt - a lightly annotated working example
world=/home/terraria/.local/share/Terraria/Worlds/MyWorld.wld
autocreate=2
worldname=MyWorld
difficulty=0
maxplayers=16
port=7777
password=ChangeThis
motd=Welcome to the server
secure=1
language=en-USAll serverconfig.txt keys
| Key | What it does | Command-line form |
|---|---|---|
world= | Path to a world file to load. The server starts straight into it. | -world |
autocreate= | Creates a world if none is found at that path. 1 = small, 2 = medium, 3 = large. | -autocreate |
seed= | Seed for the auto-created world. | -seed |
worldname= | Name of the auto-created world. | -worldname |
difficulty= | Difficulty of the auto-created world: 0 Classic, 1 Expert, 2 Master, 3 Journey. | none listed |
maxplayers= | Player limit, 1 to 255. The wiki gives 16 as the default (8 before 1.4.0.1). | -maxplayers or -players |
port= | Listening port. Default 7777 (TCP). | -port |
password= | Server password. Leave empty for none. | -password or -pass |
motd= | Message of the day shown on join. | -motd |
worldpath= | Folder where world files are stored. | none listed |
banlist= | Path of the ban list. Defaults to banlist.txt in the working directory. | -banlist |
secure= | 1 adds additional cheat protection. | -secure |
language= | Server language code (see below). | none listed |
upnp= | 1 forwards ports automatically with UPnP. Irrelevant on a hosted server. | -noupnp disables it |
npcstream= | Reduces enemy skipping at the cost of more bandwidth. 0 turns it off; the wiki's example is 60. | none listed |
priority= | Process priority: 0 Realtime, 1 High, 2 AboveNormal, 3 Normal, 4 BelowNormal, 5 Idle. | -forcepriority |
Other command-line options from the wiki include -ip (address to listen on), -steam and -lobby friends|private (Steam join support), -disableannouncementbox, and -announcementboxrange (use -1 for server-wide messages).
How world, autocreate and difficulty interact
This is where most confusion comes from. There are two ways to give the server a world, and they behave differently:
- Existing world: set
world=to the file. The server loads it and keeps its type.difficulty,seedandworldnameare ignored. - New world: set
autocreate=and letworld=point to a file that does not exist yet. The server generates a world usingworldname,seedanddifficulty, and saves it to that path.
That means changing difficulty= on a server that already has a world does nothing. You would need to point at a new file name or remove the old world (take a backup first). World size values are 1 for small, 2 for medium and 3 for large.
Journey is difficulty=3, which the wiki notes was added alongside Master in Desktop 1.4.0.1. Journey worlds have their own per-power permission keys, covered in the difficulty and Journey guide.
Three common setups
These put the rules above together. All values are examples.
# 1. Load an existing world, no auto-creation
world=/home/terraria/.local/share/Terraria/Worlds/MyWorld.wld
maxplayers=16
port=7777
password=ChangeThis
motd=Welcome back# 2. Create a new large Expert world the first time, then reuse it
autocreate=3
worldname=Expert1
difficulty=1
seed=hello
world=/home/terraria/.local/share/Terraria/Worlds/Expert1.wld
maxplayers=10
port=7777# 3. Public server with extra cheat protection and more bandwidth for smoother enemies
world=/home/terraria/.local/share/Terraria/Worlds/MyWorld.wld
secure=1
npcstream=60
maxplayers=16
language=en-USIn setup 2 the world is created once. On later starts the file exists, so the server loads it and difficulty, seed and worldname are not used again. Higher npcstream values reduce enemy skipping but cost bandwidth, so raise it only if players actually see skipping.
Language codes
The wiki lists these supported values for language=. Use them exactly:
| Code | Language |
|---|---|
en-US | English |
de-DE | German |
it-IT | Italian |
fr-FR | French |
es-ES | Spanish |
ru-RU | Russian |
zh-Hans | Chinese |
pt-BR | Portuguese |
pl-PL | Polish |
Ports, saving and stopping the server
- Port. The wiki says the server runs on TCP 7777 by default, and the port must be forwarded if you host from behind a router. Change it with
port=or-port. - Autosave. The wiki says the world is saved automatically at dawn, about every 24 minutes. Since Desktop 1.4.5.0 the server also saves when the last player leaves.
- Stopping. Use
exitin the console so the world saves;exit-nosavediscards recent changes. Closing the window is risky for the same reason.
Hosting with ChicagoServers? The Terraria server hosting page lists what is included, such as free server backups and SFTP file access. Free server backups cover you if a bad edit corrupts something.
Common mistakes
- Leaving the
#in front of a key. The line is a comment and the server uses its default instead. - Expecting
difficultyto change an existing world. It only applies at creation. - Setting
maxplayersabove 255 or below 1, or assuming the example values in a sample file are defaults. They are examples. - Typing a language name ("English") instead of a code (
en-US). - Windows paths on Linux. Sample files often use Windows-style folders. Replace them with real paths on your machine.
- Forgetting the version match. Players need a client on the same Terraria version as the server.
Frequently asked questions
What is the default port for a Terraria server?
7777. The Terraria Wiki says the server runs on TCP port 7777 by default; change it with port= in serverconfig.txt or -port on the command line.
Why does my Terraria server ignore the difficulty setting?
The difficulty key only applies when the server is creating a world with autocreate. If a world file already exists at the world path, it keeps the difficulty it was created with.
What are the world size and difficulty values in serverconfig.txt?
autocreate: 1 small, 2 medium, 3 large. difficulty: 0 Classic, 1 Expert, 2 Master, 3 Journey.
How many players can a Terraria server hold?
The maxplayers setting accepts 1 to 255. The Terraria Wiki lists 16 as the default (it was 8 before 1.4.0.1), but actual capacity depends on the server's resources.