Terraria server with TShock: setup code, superadmin, groups

Use the TShock setup code to make yourself superadmin, give players groups and permissions, and upload your own world to a Torchlite Terraria server.

5 min readBy Torchlite teamUpdated

Terraria server with TShock: setup code, superadmin, groups
On this page

TShock is a server mod for Terraria. Players join with the normal game, but the server gains accounts, groups, permissions, bans and protected areas, plus support for server plugins. If you want to run a public world or keep a few friends from blowing up your base, it is the type to pick.

This guide walks through the first start, making yourself superadmin, and the basics of groups. It also covers the world settings the egg gives you, and how TShock compares with the other two Terraria types on Torchlite.

Vanilla, TShock or tModLoader

Torchlite offers three Terraria server types. You pick one when you create the server.

TypePlayers needGood forStorage
Terraria (vanilla)The normal gamePlaying with friends, no extrasHDD
Terraria (TShock)The normal gamePublic or semi-public worlds, admin tools, server pluginsHDD
Terraria (tModLoader)tModLoader and the same mods as the serverContent mods such as new bosses, items and classesHDD

The vanilla server has the most settings on Startup: world size, difficulty, seed, password, MOTD and the Terraria version. TShock gives you fewer startup settings but far more control once the server runs. tModLoader is the one to choose if you want mods that change the game itself, because TShock plugins only run on the server and cannot add new items or enemies. TShock plugins are .dll files that go in the ServerPlugins folder.

All three use the same .wld world format, so a world can move between vanilla and TShock as long as both run the same Terraria version.

What the TShock egg sets up

These are the variables on Startup. Some are visible but locked.

VariableDefaultCan you change it?
World NameworldYes, up to 20 characters
World Size1 (1 small, 2 medium, 3 large)No
Max Players8No
Tshock VersionlatestNo

On each start, TShock opens <World Name>.wld in the server's main folder, so world.wld by default. If that file does not exist, it generates a new small world and saves it under that name. The installer downloads the newest stable TShock release at the time the server was installed.

There is no difficulty setting in this egg, so a world it creates on its own is a normal (Classic) world. For Expert, Master or Journey, or for a medium or large world, create the world in your own game and upload it.

Upload your own world

Your local worlds are .wld files. On Windows they are in Documents\My Games\Terraria\Worlds. On macOS look in ~/Library/Application Support/Terraria/Worlds, and on Linux in ~/.local/share/Terraria/Worlds. If the world is saved in Steam Cloud, turn cloud saving off for it in the world list first, so a normal file appears in that folder.

  1. Stop the server.
  2. Upload the .wld file to the server's main folder, through Files or SFTP.
  3. Set World Name to the file name without .wld. For Hallow Base.wld, rename the file to something like hallow-base.wld first, because the startup command breaks on spaces.
  4. Start the server.

Names are case-sensitive on the server, so Myworld and myworld are different files. If the name does not match, TShock quietly generates a fresh small world instead of loading yours.

First start: the setup code

The first time TShock starts, it has no admin at all. To fix that, it prints a notice in the console with a one-time setup code, a number to use with the /setup command. It also saves the code in tshock/setup-code.txt.

The code appears at every start until you finish the setup below, so if it has scrolled away, restart the server or open that file. Do not share it: whoever uses it first can make themselves superadmin.

Become superadmin

Join the server from the game, open chat and type these one at a time, using your own code, name and password:

text
/setup 1234567
/user add YourName YourPassword superadmin
/login YourName YourPassword
/setup

The first line gives you temporary admin rights. The second creates a permanent account in the superadmin group. The third logs you in to that account. The last one, with no code, switches the setup system off so the code stops working.

Pick a password you do not use anywhere else. From now on, log in with /login each time you join.

The panel console counts as the server itself and has every permission, so you can run the same commands there without the slash, for example user add YourName YourPassword superadmin.

Groups and permissions

Everything in TShock is decided by groups. Players who are not logged in are in guest. A player who registers with /register <password> and logs in moves to default. Above that, TShock creates a ladder of groups, each inheriting everything from the one before: vip, newadmin, admin, trustedadmin and owner. superadmin sits outside the ladder and has every permission.

The commands you will use most:

CommandWhat it does
/user group Name adminMove an account to another group
/group listShow all groups
/group listperm adminShow what a group may do
/group add buildersCreate a new group
/group parent builders defaultMake builders inherit from default
/group addperm builders tshock.item.spawnGive a group a permission
/group delperm builders tshock.item.spawnTake it away again

Permissions are dotted names, such as tshock.admin.kick, tshock.admin.ban, tshock.tp.self and tshock.world.modify. The safest way to make a moderator is to put their account in newadmin or admin rather than handing them superadmin. Give each person the lowest group that does the job.

Settings that are not commands, such as the server password or spawn protection, live in tshock/config.json. Stop the server before editing it, then start it again to apply your changes.

Common problems

The setup code is no longer in the console

Restart the server and the notice appears again, as long as setup is not finished. You can also read the code from tshock/setup-code.txt in Files.

Nobody but me can build near spawn

That is TShock's spawn protection, which is on by default. Players need the tshock.world.editspawn permission to build there. To turn it off or shrink it, change SpawnProtection or SpawnProtectionRadius in tshock/config.json and restart.

Players get a version error when joining

The game and the server must run the same Terraria version, and TShock is built for one specific version. After a Terraria update, players on the new version cannot join until a TShock release for it exists. Once it does, take a copy of your world, then use Reinstall Server in Settings to download the newest TShock.

My uploaded world did not load and I got a new one

World Name does not match the file name exactly, so TShock generated a fresh world. Check spelling and capitals, fix the name and restart. Your uploaded file is still there.

The server stopped by itself

Free servers need renewing while they run. Keep the panel open and press Renew when it asks; the renewal guide explains how often.

Stuck on a step?

Ask on the forum. Your question links back to this guide, so whoever answers knows where you are.

Ask about this guide

About the author

Torchlite team

The people who run Torchlite

We build and run the Torchlite panel and the nodes. Every guide is checked on our own servers before it goes up, and updated when the panel changes.

Found a mistake? Tell us on Discord

Related guides

All guides →