# How to Install TShock on a Terraria Server (TShock 6)

Install TShock on a Terraria server: run TShock 6 for 1.4.5.8, keep your world, claim owner with the setup code, and set groups, regions and config.json.

Updated 2026-10-03. https://gamezservers.com/guides/how-to-install-tshock-on-a-terraria-server

To install TShock, run the TShock 6 server (6.2.1 supports Terraria 1.4.5.8) in place of the vanilla server, put your world's `.wld` file where TShock loads it, and start it. The console prints a setup code: join, type `/setup <code>`, then `/user add YourName YourPassword owner` and `/login`. Settings live in `tshock/config.json`, but launch options such as `-port`, `-maxplayers` and `-password` override that file, so set those where the server is started.

## What you are working with

| File or folder | What it holds |
| --- | --- |
| `TShock.Server` | The server program. Replaces `TerrariaServer` |
| `tshock/config.json` | TShock settings: password, slots, login rules, spawn protection |
| `tshock/tshock.sqlite` | The database: accounts, groups, bans, regions, warps |
| `tshock/setup-code.txt` | The one time owner code, until setup is finished |
| `ServerPlugins/` | Plugin `.dll` files |
| `<world>.wld` | Your world, the same file vanilla uses |

TShock is a server mod for vanilla clients: players join with normal, unmodded Terraria on the same version as the server. TShock 6 moved to .NET 9 and the Terraria 1.4.5 series, and 6.2.1 from September 27, 2026 supports Terraria 1.4.5.8 ([TShock releases on GitHub](https://github.com/Pryaxis/TShock/releases)). It cannot load tModLoader mods or tModLoader worlds.

![A Terraria world running on a TShock server, with accounts, groups and protected regions](https://gamezservers.com/games/terraria/shot-3.jpg)

## What carries over from vanilla

| Thing | Moves to TShock? |
| --- | --- |
| Vanilla world `.wld` | Yes, the same file loads |
| Player characters | Yes. They stay on each player's PC, as with vanilla |
| Vanilla `serverconfig.txt` | No. Set the same values in TShock's launch options and `config.json` |
| tModLoader world or mods | No. TShock runs vanilla content only |

## Before you start

- **Back up the world.** Download the `.wld` file (and its `.wld.bak`) before switching anything.
- **Match the version.** Players must run the Terraria version TShock supports, 1.4.5.8 for TShock 6.2.1.
- **Note your world's file name.** You will need it to point TShock at the old world.

## Step 1: Install TShock

Self hosting, download the release for your system from the TShock GitHub page, unzip it into a new folder, and start `TShock.Server` with your world:

```
./TShock.Server -port 7777 -maxplayers 8 -world /path/to/MyWorld.wld
```

On the first start TShock creates the `tshock` folder, its database and config.

## Step 2: Point TShock at your world

Copy your `.wld` into the folder TShock loads from and give its path or name with `-world`. If the file is not where TShock looks, and `-autocreate` is set, it quietly generates a brand new world with that name. That is the usual reason people "lose" their world when switching to TShock.

## Step 3: Claim the owner account

1. Watch the console on the first start for the line with the setup code (it is also saved in `tshock/setup-code.txt`).
2. Join with Terraria and type `/setup <code>`.
3. Create your real account: `/user add YourName YourPassword owner`.
4. Log in: `/login YourName YourPassword`.
5. Type `/setup` once more to switch the setup system off.

From now on the server console always has full rights, which is your way back in if you lock yourself out. Our [TShock commands guide](https://gamezservers.com/guides/tshock-commands-for-terraria-servers) covers every account and group command.

## Step 4: Set the basics in config.json

Stop the server, then edit `tshock/config.json`. Settings sit inside its `Settings` block:

| Key | Default | What it does |
| --- | --- | --- |
| `ServerPassword` | `""` | Join password |
| `ServerPort` | 7777 | Port |
| `MaxSlots` | 8 | Player limit |
| `ReservedSlots` | 20 | Extra slots for groups with the reserved slot permission |
| `RequireLogin` | false | Players must log in before playing |
| `SpawnProtection`, `SpawnProtectionRadius` | radius 10 | Stops building near spawn |
| `BackupInterval` | 10 | Minutes between world backups |
| `StorageType` | `sqlite` | Database type. Keep `sqlite` for one server |

Use `/reload` for some changes, or restart for all of them.

## The gotcha: launch options beat config.json

TShock's own documentation says options set on the command line override all configuration options. So if the server starts with `-port`, `-maxplayers` or `-password`, the matching `ServerPort`, `MaxSlots` and `ServerPassword` in `config.json` are ignored, however many times you save them.

This is exactly how GamezServers starts TShock. The panel launches it with:

```
./TShock.Server -ip 0.0.0.0 -port <your port> -maxplayers <your slots> -world <World name>.wld -autocreate <World size> -password "<Join password>" -motd "<Welcome message>"
```

So on our servers:

- Set the **join password** in the panel's **Join password** field, not in `config.json`. An empty panel field means no password, whatever the file says.
- The **player limit** comes from your plan's slots.
- The **welcome message** is the panel's **Welcome message**.
- Everything else (login rules, spawn protection, backups, groups) is yours in `config.json` and the database.

The panel also loads the world named in **World name** from the server's main folder, and creates a new one of the chosen **World size** if it does not find it. When you switch from Vanilla, your world sits in `saves/Worlds/`. Move the `.wld` file up into the main folder and set **World name** to its name without `.wld`, or TShock will make a fresh world beside it.

## Step 5: Protect builds and add plugins

Protect spawn or a base with a region:

```
/region set 1
/region set 2
/region define Spawn
/region allow Bob Spawn
```

After each `/region set`, hit a block to mark that corner. Plugins are `.dll` files built for your TShock version: upload them to `ServerPlugins/` and restart.

## Common problems

- **Your old world is gone and a new one loaded:** the `.wld` is not where TShock looks, or the name differs. Move it and fix the world name.
- **Password in config.json does nothing:** the launch option overrides it. On GamezServers, use the Join password field.
- **No setup code in the console:** setup already finished or an account exists. Use the server console: `user group YourName owner`.
- **Players get a version error:** their Terraria and the server's TShock target different versions. Update TShock after a Terraria patch, see [Terraria server version mismatch](https://gamezservers.com/guides/terraria-server-version-mismatch).
- **Server stops on start after an update:** an old plugin in `ServerPlugins/`. Remove it until it is updated.

## TShock on GamezServers

On a [Terraria server from GamezServers](https://gamezservers.com/games/terraria), pick **TShock** as the server type in Settings, and a backup is taken before the switch. Move your world from `saves/Worlds/` to the main folder in the file manager, set **World name**, and start. The console shows your setup code, and the panel has TShock buttons for jobs like `time noon` and `ban add`. To go the other way, see [switching a Terraria server to tModLoader or TShock](https://gamezservers.com/guides/how-to-switch-a-terraria-server-to-tmodloader-or-tshock).

## FAQ

### Can players join a TShock server with normal Terraria?

Yes. TShock runs vanilla content, so players join with unmodded Terraria on the same version.

### Where do I find the TShock setup code?

In the server console on the first start, and in `tshock/setup-code.txt`, until setup is finished.

### Will my vanilla world work on TShock?

Yes. TShock loads the same `.wld` file. Point it at the file and set the world name to match.

### Why does my TShock password not change?

The server's launch options override `config.json`. Change it where the server is started, which on GamezServers is the Join password field.
