Editing serverconfig.txt: world, players, password and difficulty

A plain-English guide to the serverconfig.txt file that controls your Terraria or tModLoader dedicated server, including which world loads, max players, the join password, and difficulty.

A plain-English guide to the serverconfig.txt file that controls your Terraria or tModLoader dedicated server, including which world loads, max players, the join password, and difficulty.

A Terraria dedicated server reads its settings from a file called serverconfig.txt. The same file works for tModLoader. You will find it on the Files tab, and editing it lets you set exactly which world loads, how many people can join, the password, and the world difficulty.

Open the file

  • Open your server on the Game Panel and go to the Files tab.
  • Find serverconfig.txt in the main server folder and open it.
  • Each setting is one line in the form name=value. A line starting with # is a comment and is ignored.

Before a big change, take a snapshot on the Backups tab so you can roll back if a value is wrong.

The settings you will actually use

  • world= The full path to the .wld world file you want to load, for example world=/home/container/.local/share/Terraria/Worlds/Main.wld. When this points at a real file, the server loads that world every time.
  • autocreate= Only used when the world above does not exist yet. 1 makes a small world, 2 medium, 3 large.
  • worldname= The name given to a newly created world.
  • seed= An optional world seed for a new world, the same kind of seed you would type in single player.
  • difficulty= The difficulty of a newly created world: 0 for Classic (Normal), 1 for Expert, 2 for Master, 3 for Journey.
  • maxplayers= How many players can be connected at once, for example maxplayers=8.
  • password= The join password. Leave it blank for an open server, or set password=yoursecret to lock it down.
  • port= The port the server listens on. Leave this matching the port shown at the top of your server view and on the Network tab.
  • motd= A short message shown to players when they join.

Important: difficulty and seed only apply to new worlds

Changing difficulty or seed does nothing to a world that already exists. Those values are only read when the server creates a brand new world. To use them, point world= at a file that does not exist yet (or move your old world aside), and let the server generate a fresh one.

Startup tab versus the file

Many GuavaHost setups expose the common options, like world name, max players, and password, as fields on the Startup tab. If yours does, prefer setting them there, because the panel can rewrite serverconfig.txt from those fields each time the server boots and overwrite hand edits. If a setting is not offered on the Startup tab, edit serverconfig.txt directly.

Apply your changes

The server only reads serverconfig.txt when it starts. After you save the file, restart from the Console tab, then watch the log to confirm the world loads and the settings took effect.

Troubleshooting

  • Server made a new empty world instead of loading yours: the world= path is wrong or the file is not there. Copy the exact path from the Files tab and paste it into world=.
  • Password not working: check password= for stray spaces, and remember the server must be restarted after a change.
  • Difficulty did not change: the world already existed. Difficulty only applies when a world is first created.
  • Players cannot connect after editing port: put it back to match the port shown at the top of the server view.

Still stuck? Jump into our Discord at discord.gg/GuavaHost and the team will help you out.