Skip to content

tshock

The t-shock modded terraria server. https://tshock.co/

egg-tshock.json

updated

Ports

Add an allocation on the node for each port.

  • Game 7777

Install

Installer image
ghcr.io/ptero-eggs/installers:debian
Install script
45 lines

Image

  • Dotnet 6 ghcr.io/ptero-eggs/yolks:dotnet_6

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

4 variables

Startup command

./TShock.Server -ip 0.0.0.0 -port 7777 -maxplayers 8 -world world.wld -autocreate 1

Dotted values come from the server settings. These values are examples.

  • The maximum number of players a server will hold.

    MAX_PLAYERSUsers can see

    required|numeric|digits_between:1,3

  • Defines the worlds size. 3 sizes 1 (small), 2 (medium), 3 (large).

    WORLD_SIZEUsers can see

    required|numeric|digits_between:1,3

  • The name for the world file.

    WORLD_NAMEUsers can edit

    required|string|max:20

  • The version on tshock that will be installed. default is latest non-pre-release

    TSHOCK_VERSIONUsers can see

    required|string|max:20

Wings

Stop command
exit
Running when the console shows
Type 'help' for a list of commands

Readme

TShock

TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools. https://tshock.co/

From their GitHub

TShock is a toolbox for Terraria servers and communities. That toolbox is jam packed with anti-cheat tools, server-side characters, groups, permissions, item bans, tons of commands, and limitless potential. It's one of a kind.

Server Ports

TShock, like Terraria, only requires a single port to run. The default is 7777

Port default
Game 7777

Plugins may require ports to be added to the server.

Extra Information

If you want to download mods in the console, the startup command has to be changed.

New startup: mono TerrariaServer.exe -ip 0.0.0.0 -port {{SERVER_PORT}} -maxplayers {{MAX_PLAYERS}}

This will remove the autocreate function, and will thus allow you to download mods and generate world. Afterwards, you can change it back with the correct world name to start automatic. Word name is set in the configuration panel.

Any version older then TShock v5 needs to use the legacy egg, and version newer or v5 must use the normal TShock one.

Migration from v4 to v5

If you're upgrading from TShock 4, you swith to the new egg copying the tshock configuration folder over (containing the sqlitedb file as well as the json configuration files, etc) to the new server, and starting the new server that way.

Changes

  1. Update egg-tshock.json to match new download filename format (#28)

    · Daniel Barton · 1910fe6

  2. Add standalone games

    · Daniel Barton · 74c706a

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 45 lines /bin/bash in ghcr.io/ptero-eggs/installers:debian Show
#!/bin/bash
# Vanilla tModloader Installation Script
#
# Server Files: /mnt/server
## install packages to get version and download links
apt update
apt install -y curl wget jq file unzip

## get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/Pryaxis/TShock/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/Pryaxis/TShock/releases")
MATCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "(linux-x64|linux-amd64)" || echo "linux-arm64")

echo "${MATCH}"

if [ -z "$TSHOCK_VERSION" ] || [ "$TSHOCK_VERSION" == "latest" ]; then
    DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i -E "${MATCH}" | head -1 )
else
    VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION "$TSHOCK_VERSION" '.[] | select(.tag_name==$VERSION) | .tag_name')
    if [ "$TSHOCK_VERSION" == "$VERSION_CHECK" ]; then
        DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$TSHOCK_VERSION" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' |  grep -i -E "${MATCH}" | head -1 )
    else
        echo -e "defaulting to latest release"
        DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i -E "${MATCH}" | head -1)
    fi
fi

## mkdir and cd to /mnt/server/
mkdir -p /mnt/server

cd /mnt/server

## download release
echo -e "running: wget $DOWNLOAD_LINK"
wget $DOWNLOAD_LINK -O TShock.zip

unzip -o TShock.zip

tar xvf TShock-*.tar

rm TShock.zip TShock-*.tar

chmod +x TShock.Server

echo -e "install complete"