Skip to main content

Need a powerful server for your projects?

Discover our offers

Administration and TShock

How you administer a Terraria server depends on its mode:

  • Vanilla (and tModLoader): there is no in-game admin role. You manage the server from the panel Console.
  • TShock: you create an owner account in game, then manage groups and permissions for your players and moderation team.

Console commands (vanilla)​

In the Game Panel (game.yorkhost.fr), open your server's Console and type commands without /:

CommandEffect
helpList of available commands
playingList of connected players
say <message>Sends a message to all players
kick <player>Kicks a player
ban <player>Bans a player (added to the banlist file)
saveSaves the world
exitSaves the world and stops the server
password / password <pass>Shows / changes the password (current session)
motd / motd <message>Shows / changes the message of the day (current session)
timeShows the in-game time
dawn, noon, dusk, midnightSets the time to dawn, noon, dusk or midnight
settleSettles the world's water
versionServer version
Unbanning a player on vanilla

Bans are stored in the file set by banlist in serverconfig.txt (often banlist.txt). To unban someone, stop the server, remove the player's lines from that file in the Files tab, then restart.

Type save before a risky operation if you are not using the panel's stop button.

TShock: becoming owner with /setup​

TShock replaces the vanilla server with an enhanced version: player accounts, groups, permissions, region protection, moderation tools and plugins. It still works with regular Terraria clients.

TShock and tModLoader cannot be combined

TShock only works with vanilla Terraria. On a tModLoader server, TShock commands and plugins are not available. To switch modes, see Getting started.

The setup code​

On the first start of a TShock server, a setup code is shown in the panel Console. It is also saved to a file in the tshock/ folder (usually setup-code.txt).

  1. Start the server and note the code shown in the console
  2. Join the server in game
  3. In the game chat, type:
/setup 123456

replacing 123456 with your code.

  1. Create your owner account (pick a strong password):
/user add MyName MyPassword owner
  1. Log in with that account:
/login MyName MyPassword
  1. Type /setup one last time (without a code) to disable the setup system

You now have full rights on the server. Log in again with /login each time you join.

Keep the code to yourself

Until the setup system is disabled, anyone who knows the code can take control of the server. Complete the steps above before opening the server to the public.

Player accounts​

Players create their account in game, then log in:

/register Password
/login Password

Depending on your configuration, TShock can require players to be logged in to play (RequireLogin setting in tshock/config.json), which is recommended for a public server.

Groups and permissions​

Each account belongs to a group, and each group has a list of permissions. TShock ships with default groups, from least to most privileged: guest (not logged in), default (registered player), vip, newadmin, admin, trustedadmin and owner. A group can inherit the permissions of a parent group.

CommandEffect
/group listList of groups
/group listperm <group>A group's permissions
/group add <group>Creates a group
/group parent <group> <parent>Makes a group inherit from another
/group addperm <group> <permission>Adds a permission
/group delperm <group> <permission>Removes a permission
/group prefix <group> <prefix>Prefix shown before the name in chat
/user group <account> <group>Puts an account in a group

Example: create a moderator group based on default that can kick and ban:

/group add moderator
/group parent moderator default
/group addperm moderator tshock.admin.kick tshock.admin.ban
/user group ModName moderator

A few common permissions: tshock.admin.kick, tshock.admin.ban, tshock.tp.self (teleport), tshock.item.spawn (/item command), tshock.admin.region (region management). Exact names may vary between TShock versions: check with /group listperm admin or in the official TShock documentation.

Reuse an existing group

To quickly promote a trusted member, just put their account in an existing group, for example /user group ModName admin, rather than building a group from scratch.

Useful TShock commands​

CommandEffect
/helpCommands available to your group
/whoConnected players
/kick <player> [reason]Kicks a player
/ban add <player> [reason] [duration]Bans a player (see /ban help for your version's syntax)
/ban list / /ban del <number>Lists / removes a ban
/mute <player>Mutes a player
/tp <player>Teleports to a player
/time <time>Sets the in-game time (for example /time noon)
/item <item> [amount]Gives yourself an item
/saveSaves the world
/offSaves and stops the server

TShock commands also work from the panel Console: try them with the /, and without it if your version does not recognise it.

Protecting an area (regions)​

To protect the spawn or a base against changes:

  1. /region set 1, then hit the block at the top-left corner of the area
  2. /region set 2, then hit the block at the bottom-right corner
  3. /region define AreaName
  4. Allow a player to build inside: /region allow PlayerName AreaName

/region list and /region info AreaName show existing regions.

TShock configuration​

TShock's files are in the server's tshock/ folder:

FileRole
config.jsonTShock settings: name, password, slots, mandatory login, spawn protection…
sscconfig.jsonServer-Side Characters: inventories stored on the server
tshock.sqliteDatabase: accounts, groups, permissions, bans, regions

Some config.json settings (password, number of slots) take precedence over serverconfig.txt. Do not change the port in this file: the server must stay on the port assigned by the panel.

To edit config.json, stop the server, edit it in the Files tab while keeping valid JSON syntax (quotes, commas), then restart. The /reload command reloads part of the settings without a restart.

Back up the TShock database

tshock/tshock.sqlite holds all your accounts, groups and regions. Include it in your backups, alongside the world: see Importing a world and backups.

Installing TShock plugins​

  1. Download the plugin (.dll file) from a trusted source, in a version compatible with your TShock version
  2. Stop the server
  3. Drop the .dll into the ServerPlugins/ folder using the Files tab or SFTP
  4. Start the server and check in the console that the plugin loads without errors

A plugin written for an older TShock version can prevent the server from starting: remove it if that happens (see Troubleshooting).

See also​