Terraria gameplay

Host a Terraria Dedicated Server

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

Hardware Requirements

Here's what you need to run a Terraria dedicated server.

Economy

Small world, 1-4 players

CPU0.5 cores
RAM1 GB
Storage2 GB

Standard

Medium world, 4-8 players

CPU1 core
RAM2 GB
Storage2 GB

Pro

Large world, 8-16 players

CPU2 cores
RAM3 GB
Storage2 GB

Start hosting from your own computer

Run a Terraria server on your desktop, laptop, VPS, or dedicated machine — GameCP automates Docker setup, resource allocation, and Terraria configuration instantly. Automatic port forwarding means your friends can connect without touching your router. Start local, scale to a VPS when you're ready.

Get Started FreeNo credit card required

Setup in 4 Steps

Skip the manual installation, port forwarding, and configuration. Install on your own computer and start hosting instantly.

The Manual Way vs. GameCP

Manual Setup

  • Configure 1+ firewall ports and router settings
  • Write systemd service files
  • SSH into server to edit configs
  • Requires a VPS or dedicated server
  • 30-60 minutes if experienced

With GameCP

  • Automatic port forwarding — no router config
  • Host from your own PC, VPS, or dedicated server
  • Docker container with auto-restart
  • Visual config editor in browser
  • Under 5 minutes total

Under the Hood

The full manual process to host a Terraria dedicated server on a VPS. Or install GameCP on your own computer and skip all of this.

Step 1

Configure & Prepare

Set your server settings, then install Docker, and pull the Terraria container image.

Server ConfigurationEdit values to update all commands
terminal
# Update system and install Docker
sudo apt update && sudo apt install -y docker.io
sudo systemctl enable --now docker

# Create game server directory
sudo mkdir -p /opt/gameserver

# Server configuration
export MAX_PLAYERS="8"
export SERVER_MOTD="Welcome!"
export WORLD_NAME="world"
export WORLD_SIZE="1"
export WORLD_DIFFICULTY="3"
export NPCSTREAM="0"
export TERRARIA_VERSION="latest"

# Pull the container image
docker pull ghcr.io/ptero-eggs/yolks:debian
Step 2

Run the Installation Script

Terraria uses a custom install script to download and configure the server files.

Installation Script
#!/bin/bash
# Vanilla Installation Script
#
# Server Files: /opt/gameserver
## install packages to get version and download links
apt update
apt install -y curl wget file unzip jq

DOWNLOAD_LINK=invalid

mkdir -p /opt/gameserver/
cd /opt/gameserver/

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=/opt/gameserver/saves/Worlds
worldname=default
world=/opt/gameserver/saves/Worlds/default.wld
difficulty=3
autocreate=1
port=7777
maxplayers=8
EOF

mkdir -p /opt/gameserver/saves/Worlds

echo -e "Install complete"
Step 3

Open Firewall Ports

Terraria requires 1 port to be open for game traffic and queries.

terminal
sudo ufw allow 7777/tcp
7777/TCP(PORT)
Step 4

Launch the Server

Start the Terraria server using the configuration from Step 1.

terminal
docker run -d \
  --name terraria-server \
  -p 7777:7777/tcp \
  -e MAX_PLAYERS="8" \
  -e SERVER_MOTD="Welcome!" \
  -e WORLD_NAME="world" \
  -e WORLD_SIZE="1" \
  -e WORLD_DIFFICULTY="3" \
  -e NPCSTREAM="0" \
  -e TERRARIA_VERSION="latest" \
  -v /opt/gameserver:/opt/gameserver \
  -w /opt/gameserver \
  ghcr.io/ptero-eggs/yolks:debian \
  ./TerrariaServer.bin.x86_64 -config serverconfig.txt

Or skip all of this

GameCP automates every step above: Docker, port forwarding, startup, and config. Install on your own PC and deploy a Terraria server in under 5 minutes.

Deploy with GameCP

Ready to Host Your Terraria Server?

Install GameCP on your own computer and start hosting in minutes. Automatic port forwarding, zero config — your friends connect instantly.

No credit card required · Free tier available · Install local, scale later

Deploy Free