Hurtworld

games
Report Issue

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

Contributors:
README

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

Port default
Game 12871
Query 13871

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

Docker Images (1)
Name Image
ghcr.io/ptero-eggs/steamcmd:debian ghcr.io/ptero-eggs/steamcmd:debian
Startup Command
./Hurtworld.x86_64 -batchmode -nographics -exec "host {{SERVER_PORT}};queryport {{QUERY_PORT}};maxplayers {{MAX_PLAYERS}};servername {{HOSTNAME}};creativemode {{CREATIVE_MODE}};addadmin {{ADMINS}}" -logfile $1
Variables (9)

Game ID

The ID corresponding to the game to download and run using SRCDS.

Environment:
SRCDS_APPID
Default:
405100
User Viewable:
User Editable:
Rules:
required|in:405100

Include Oxide

This option will allow you to automatically install Oxide/uMod on the server. Default value is 0, change it to a 1 to install.

Environment:
INSTALL_OXIDE
Default:
0
User Viewable:
User Editable:
Rules:
required|boolean

Install Plugins

This 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=hurtworld

Environment:
INSTALL_PLUGINS
Default:
None
User Viewable:
User Editable:
Rules:
nullable|string

Query Port

Server Query Default Port.

Environment:
QUERY_PORT
Default:
13871
User Viewable:
User Editable:
Rules:
required|string

Max Players

Max players allowed on the server at one time.

Environment:
MAX_PLAYERS
Default:
60
User Viewable:
User Editable:
Rules:
required|string|max:60

Server Name

The name of your server in the public server list.

Environment:
HOSTNAME
Default:
A Hurtworld Server
User Viewable:
User Editable:
Rules:
required|string|max:50

Server Owner Guid

Steam id of the server owner.

Environment:
ADMINS
Default:
None
User Viewable:
User Editable:
Rules:
nullable|string|max:17

Creative Mode

Turn creative mode on and off (free build). Value as 0 for off, 1 for on.

Environment:
CREATIVE_MODE
Default:
0
User Viewable:
User Editable:
Rules:
required|boolean

AUTO_UPDATE

Disabling or enabling automated updates on boot.

Environment:
AUTO_UPDATE
Default:
1
User Viewable:
User Editable:
Rules:
required|boolean
Installation Script
Container: ghcr.io/ptero-eggs/installers:debian
Entrypoint: bash
#!/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 "-----------------------------------------"