Skip to content

Terraria Vanilla

Dig, fight, explore, build! Nothing is impossible in this action-packed adventure game.

egg-terraria-vanilla.json

updated

Install

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

Image

  • Debian ghcr.io/ptero-eggs/yolks:debian

Startup

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

9 variables

Startup command

./TerrariaServer.bin.x86_64 -config serverconfig.txt
  • the version of Terraria that is to be used. You can use the full version number or the file number. (ex. 1.3.5.3 or 1353) Get version numbers here - https://terraria.wiki.gg/wiki/Server#Downloads

    TERRARIA_VERSIONUsers can edit

    required|string|max:20

  • The name for the world file.

    WORLD_NAMEUsers can edit

    required|string|max:20

  • The maximum number of players a server will hold.

    MAX_PLAYERSUsers can edit

    required|numeric|max:255

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

    WORLD_SIZEUsers can edit

    required|numeric|in:1,2,3

  • World Difficulty Options: 0(normal), 1(expert), 2(master), 3(journey)

    WORLD_DIFFICULTYUsers can edit

    required|numeric|in:0,1,2,3

  • Server MOTD

    SERVER_MOTDUsers can edit

    required|string|max:128

  • The Seed to use when creating the World

    WORLD_SEEDUsers can edit

    nullable|string|max:20

  • The password which should be used.

    PASSWORDUsers can edit

    nullable|string

  • Reduces enemy skipping but increases bandwidth usage. The lower the number the less skipping will happen, but more data is sent. 0 is off.

    NPCSTREAMUsers can edit

    required|int|between:0,60

Wings

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

Files Wings edits

Wings sets these values in these files before each start.

serverconfig.txt properties

worldpath
/home/container/saves/Worlds
worldname
{{server.build.env.WORLD_NAME}}
world
/home/container/saves/Worlds/{{server.build.env.WORLD_NAME}}.wld
difficulty
{{server.build.env.WORLD_DIFFICULTY}}
autocreate
{{server.build.env.WORLD_SIZE}}
port
{{server.build.default.port}}
maxplayers
{{server.build.env.MAX_PLAYERS}}
motd
{{server.build.env.SERVER_MOTD}}
seed
{{server.build.env.WORLD_SEED}}
password
{{server.build.env.PASSWORD}}
npcstream
{{server.build.env.NPCSTREAM}}

Readme

Terraria

Vanilla Terraria egg with support for Journey's End. Currently up to 1.4.0.2 is supported, however future patches will require updates to the install script.

Minimum RAM warning

You may want to assign a minimum of 768 mb of RAM to a server as it will use around 650 mb to generate the world on the first start.

Required Server Ports

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

Changes

  1. 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 64 lines bash in ghcr.io/ptero-eggs/installers:debian Show
#!/bin/bash
# Vanilla Installation Script
#
# Server Files: /mnt/server
## install packages to get version and download links
apt update
apt install -y curl wget file unzip jq

DOWNLOAD_LINK=invalid

mkdir -p /mnt/server/
cd /mnt/server/

if [ "${TERRARIA_VERSION}" == "latest" ] || [ "${TERRARIA_VERSION}" == "" ] ; then
    V=$(curl -sSL https://terraria.org/api/get/dedicated-servers-names | jq -r .[] | head -1)
    DOWNLOAD_LINK="https://terraria.org/api/download/pc-dedicated-server/${V}"
else
    CLEAN_VERSION=$(echo ${TERRARIA_VERSION} | sed 's/\.//g')
    echo -e "Downloading terraria server files"
    DOWNLOAD_LINK=$(curl -sSL https://terraria.wiki.gg/wiki/Server#Downloads | grep '>Terraria Server ' | grep -Eoi '<a [^>]+>' | grep -Eo 'href=\"[^\\\"]+\"' | grep -Eo '(http|https):\/\/[^\"]+' | grep "${CLEAN_VERSION}" | cut -d'?' -f1)
fi 

## this is a simple script to validate a download url actaully exists
echo ${DOWNLOAD_LINK}

if [ ! -z "${DOWNLOAD_LINK}" ]; then 
    if curl --output /dev/null --silent --head --fail ${DOWNLOAD_LINK}; then
        echo -e "link is valid."
    else        
        echo -e "link is invalid closing out"
        exit 2
    fi
fi

CLEAN_VERSION=$(echo ${DOWNLOAD_LINK##*/} | cut -d'-' -f3 | cut -d'.' -f1)


echo -e "running 'curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}'" 
curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}

echo -e "Unpacking server files"
unzip ${DOWNLOAD_LINK##*/}

echo -e ""
cp -R ${CLEAN_VERSION}/Linux/* ./
chmod +x TerrariaServer.bin.x86_64

echo -e "Cleaning up extra files."
rm -rf ${CLEAN_VERSION}

echo -e "Generating config file"
cat <<EOF > serverconfig.txt
worldpath=/home/container/saves/Worlds
worldname=default
world=/home/container/saves/Worlds/default.wld
difficulty=3
autocreate=1
port=7777
maxplayers=8
EOF

mkdir -p /mnt/server/saves/Worlds

echo -e "Install complete"