Egg Repository

Pterodactyl Community Egg Repository

Hurtworld

Hurtworld is a hardcore multiplayer survival FPS with a focus on deep survival progression that doesn't become trivial once you establish some basic needs. Built for hardcore gamers, Hurtworld aims to punish. This egg includes the options to install Oxide/uMod and corresponding plugins

Read Me

Hurtworld

From their website

Install notes

Due to rate limiting the console on the panel cannot keep up with the game console and the build will complete before the panel console may show it. Reloading the console will load it to the latest part of the log.

Server Ports

These are the servers required ports

Portdefault
Game12871
Query13871

Mods/Plugins may require ports to be added to the server

Yolks
NameTag
ghcr.io/ptero-eggs/steamcmd:debianghcr.io/ptero-eggs/steamcmd:debian
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
Game IDThe ID corresponding to the game to download and run using SRCDS.SRCDS_APPID405100YesNo
Include OxideThis option will allow you to automatically install Oxide/uMod on the server. Default value is 0, change it to a 1 to install.INSTALL_OXIDE0YesYes
Install PluginsThis variable allows you to automatically install Oxide plugins. Format example: No Build Zones,Loot Chests,HW Time Control Plugins can be found at: https://umod.org/plugins?categories=hurtworldINSTALL_PLUGINSYesYes
Query PortServer Query Default Port.QUERY_PORT13871YesNo
Max PlayersMax players allowed on the server at one time.MAX_PLAYERS60YesYes
Server NameThe name of your server in the public server list.HOSTNAMEA Hurtworld ServerYesYes
Server Owner GuidSteam id of the server owner.ADMINSYesYes
Creative ModeTurn creative mode on and off (free build). Value as 0 for off, 1 for on.CREATIVE_MODE0YesYes
AUTO_UPDATEDisabling or enabling automated updates on boot.AUTO_UPDATE1YesYes
Install Script
#!/bin/bash
# steamcmd Base Installation Script
# Server Files: /mnt/server
# Image: 'ghcr.io/ptero-eggs/installers:debian'
# Ensure Steam credentials are set
if [[ -z "${STEAM_USER}" ]] || [[ -z "${STEAM_PASS}" ]]; then
    echo -e "Steam user is not set. Using anonymous login."
    STEAM_USER=anonymous
    STEAM_PASS=""
    STEAM_AUTH=""
else
    echo -e "User set to ${STEAM_USER}"
fi

# Install SteamCMD
echo "Downloading and installing SteamCMD..."
mkdir -p /mnt/server/steamcmd
cd /tmp
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
mkdir -p /mnt/server/steamapps
cd /mnt/server/steamcmd

# Set ownership to prevent permission issues
chown -R root:root /mnt
export HOME=/mnt/server

# Install server using SteamCMD
echo "Installing Hurtworld server via SteamCMD..."
./steamcmd.sh +force_install_dir /mnt/server \
    +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} \
    $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) \
    +app_update ${SRCDS_APPID} \
    $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) \
    $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) \
    ${INSTALL_FLAGS} validate +quit

# Set up Steam libraries
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
mkdir -p /mnt/server/.steam/sdk64
cp -v linux64/steamclient.so ../.steam/sdk64/steamclient.so

# Copy Steam libraries to Hurtworld directories
mkdir -p /mnt/server/Hurtworld_Data/Plugins/x86
mkdir -p /mnt/server/Hurtworld_Data/Plugins/x86_64
cp -v linux32/steamclient.so /mnt/server/Hurtworld_Data/Plugins/x86/steamclient.so
cp -v linux64/steamclient.so /mnt/server/Hurtworld_Data/Plugins/x86_64/steamclient.so

# Check if INSTALL_OXIDE needs to be installed
if [[ "${INSTALL_OXIDE}" == "1" ]]; then
    echo "INSTALL_OXIDE is set to 1. Downloading and installing uMod/Oxide..."
    curl -sSL -o umod.zip "https://umod.org/games/hurtworld/download/develop"

    if [ -f umod.zip ]; then
        echo "Extracting uMod/Oxide..."
        unzip -o umod.zip -d /mnt/server
        rm umod.zip
    else
        echo "Failed to download uMod/Oxide!"
        exit 1  # Stop the script if Oxide fails to install
    fi

    # Ensure Oxide directory exists for plugins
    PLUGIN_DIR="/mnt/server/oxide/plugins"
    mkdir -p "$PLUGIN_DIR"

    if [[ -n "${INSTALL_PLUGINS}" ]]; then
        IFS=',' read -ra PLUGINS <<< "${INSTALL_PLUGINS}"

        echo "Downloading selected Oxide plugins..."
        for PLUGIN in "${PLUGINS[@]}"; do
            PLUGIN_NAME=$(echo "$PLUGIN" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/"//g')

            # url formatting
            PLUGIN_FILE="${PLUGIN_NAME// /}"
            PLUGIN_URL="https://umod.org/plugins/${PLUGIN_FILE}.cs"

            # Download the plugin
            echo "Downloading plugin: $PLUGIN_NAME"
            curl -sSL -o "$PLUGIN_DIR/${PLUGIN_FILE}.cs" "$PLUGIN_URL"

            # Verify the downloaded file is valid
            if grep -q "<!DOCTYPE html>" "$PLUGIN_DIR/${PLUGIN_FILE}.cs"; then
                echo "Error: Plugin '$PLUGIN_NAME' not found! Removing invalid file."
                rm -f "$PLUGIN_DIR/${PLUGIN_FILE}.cs"
            else
                echo "Successfully downloaded: $PLUGIN_NAME"
            fi
        done
    else
        echo "INSTALL_PLUGINS is empty. No plugins will be installed."
    fi
else
    echo "INSTALL_OXIDE is set to 0. Skipping uMod/Oxide installation and plugin downloads."
fi

# Ensure directory exists
mkdir -p /mnt/server/Hurtworld_Data/Managed

## Install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"