TShock Guide: Setup, Commands and Permissions
On this page
TShock turns a plain Terraria server into one you can actually run as an admin: accounts and groups, bans, protected regions, item and mob commands, server-side characters and anti-cheat. It is the standard choice for public Terraria servers.
This guide covers the first setup, groups and permissions, the commands you will use daily, regions, server-side characters, the REST API and the main config settings.
TShock and Terraria versions
TShock is built for one exact Terraria version at a time. The current release, TShock 6.2.1, runs Terraria 1.4.5.8. Players must use the same Terraria version as the server.
When Terraria updates, wait for the matching TShock release before updating the server. Before upgrading TShock, back up tshock.sqlite and the whole tshock folder: they hold your accounts, groups, bans and regions.
Setting up the server itself, with ports and worlds, is covered in how to make a Terraria server.
First setup: create the owner account
On first start, TShock prints a setup code in the console and saves it to tshock/setup-code.txt. Join the server and type:
/setup 123456 /user add YourName YourPassword owner /login YourName YourPassword /setup
The first line unlocks setup with the code, the second creates your account in the owner group, the third logs you in, and the last one turns setup mode off. Once an account exists, setup cannot be used again.
Play from the owner group. TShock also has a built-in superadmin, but its developers advise against playing as it: it bypasses everything, including server-side characters.
Pick TShock at checkout or switch to it later in the panel: HytHost Terraria hosting starts at €2.59/mo.
See Terraria plansGroups and permissions
Every player belongs to a group, and groups hold permissions. TShock creates these by default: guest (not logged in), default (registered players), vip, newadmin, admin, trustedadmin and owner.
| Command | What it does |
|---|---|
/group add builder | Creates a group |
/group parent builder default | Makes it inherit another group's permissions |
/group addperm builder tshock.world.editregion | Adds a permission |
/group delperm builder tshock.world.editregion | Removes a permission |
/group listperm builder | Lists the group's permissions |
/user group Alex builder | Moves a player's account into a group |
Players create their own accounts with /register password and log in with /login. To keep unregistered players from building, set RequireLogin to true in the config.
TShock commands (Terraria server commands)
| Command | What it does |
|---|---|
/kick Name reason | Kicks a player |
/ban add Name reason 7d | Bans a player, here for 7 days; without a duration the ban is permanent |
/ban list / /ban del 3 | Lists bans, or removes ban number 3 |
/mute Name | Mutes a player in chat |
/tp Name / /tphere Name | Teleports to a player, or brings them to you |
/item "Iron Pickaxe" 1 | Gives you an item |
/give "Healing Potion" Name 10 | Gives another player an item |
/butcher | Kills all hostile NPCs |
/time day | Sets the time: day, night, noon, midnight |
/spawnmob Zombie 5 | Spawns mobs near you |
/save / /off | Saves the world, or saves and shuts down |
/reload | Reloads the config and permissions |
Commands start with /; starting one with ! instead runs it silently, without announcing it to other players. Names with spaces go in quotes.
Protect builds with regions
Regions stop other players from changing an area, such as spawn or a town.
/region set 1 /region set 2 /region define spawn /region protect spawn true /region allow Alex spawn /region allowg builder spawn
After /region set 1, hit a block to mark the first corner; do the same for corner 2. Then name the region and protect it. allow lets one player build inside, allowg a whole group. /region list and /region info spawn show what exists.
Note that since TShock 6, the automatic spawn protection is off by default (SpawnProtection in the config). A region around spawn gives you finer control anyway.
Server-side characters
Normally each player's character, with its inventory, lives on their own computer, so players can bring in items from other worlds or edited characters. Server-side characters (SSC) store characters on the server instead, so everyone progresses fairly.
- Turn it on in
tshock/sscconfig.jsonwith"Enabled": true, and restart. - Set what new characters start with:
StartingHealth,StartingManaandStartingInventory. - Admins with the
tshock.ignore.sscpermission are not saved to SSC.
Decide early: once SSC is on, players start from the starting inventory, and an admin has to import an existing character with /uploadssc. Turning it on later surprises regulars.
The config file and the REST API
TShock's settings live in tshock/config.json. The ones most servers change:
ServerPassword: a password to join;MaxSlots: the player limit (8 by default);RequireLogin: players must log in before they can play;EnableWhitelist: only allowed addresses can join;BackupInterval: how often TShock saves a world backup.
Apply changes with /reload, or restart for settings that need it.
The REST API lets websites and tools control the server over HTTP, on port 7878 by default. It is off by default (RestApiEnabled), and you should leave it off unless you need it: a REST token can run any server command with the permissions of the account it belongs to. If you use it, give the token's account only the permissions the tool needs, and never publish the token.
TShock on HytHost
On HytHost Terraria hosting, TShock is one click away: choose it at checkout, or switch to it later in the panel's Software tab, which keeps your world, password, MOTD and slots. The server runs TShock 6.2.1 for Terraria 1.4.5.8, with the REST API off by default.
The setup code appears in the panel console on first start, and you edit config.json and sscconfig.json in the file manager.
Frequently asked questions
On first start, use the setup code from the console: /setup code, then /user add Name Password owner, /login Name Password, and /setup again to close setup.
TShock prints it in the server console on first start and saves it to tshock/setup-code.txt. It only works until the first account exists.
TShock 6.2.1 supports Terraria 1.4.5.8. Each TShock release targets one Terraria version, and players must use the same version as the server.
Protect it with a region: /region set 1 and /region set 2 to mark the corners, /region define spawn, then /region protect spawn true.
Only if a tool needs it. The REST API can run any server command, so keep it off by default, give its token an account with minimal permissions, and never share the token.
Run a TShock server
HytHost Terraria hosting includes TShock, Vanilla and tModLoader, switchable from the panel, from €2.59/mo.
Live chat 8 AM – 11 PM (Chișinău time) · tickets answered during business hoursWas this guide helpful?