Counter Strike 1.6 - ReHLDS

games
Report Issue

CS 1.6 ReHLDS binaries egg. ReHLDS is a reverse-engineered, optimized version of HLDS. Developed by third-party modders to improve stability, performance, and security. Fully compatible with MetaMod, AMX Mod X, and other plugins. Included modules are rehlds, reunion, amxmodx, metamod-r, reapi and ReGameDLL_CS

Contributors:
README

Counter-Strike 1.6 ReHLDS

Description

Counter-Strike 1.6 ReHLDS (Reverse Engineered Half-Life Dedicated Server) is an optimized and updated version of the original HLDS, designed for stability, performance, and security. It provides a modern platform for hosting Counter-Strike 1.6 servers with improved support for custom plugins and modules.

This egg offers everything you need to set up a Counter-Strike 1.6 server using ReHLDS, MetaMod-R, AMX Mod X, and other popular tools.

System Requirements

Component Minimum Recommended
Processor - -
RAM 1 GB 2 GB
Storage 2 GB 5 GB

Server Ports

Ports required to run the server in a table format.

Port default
Game 27015
Source TV 27020
Client 27005
Steam 26900

27015 is the default port, but any port can be used. The only required port is the Game port, server can run perfectly fine without other allocations.

Modules

  • ReHLDS: Improved performance, crash protection, and extended features.
  • MetaMod-R: Plugin loader for custom server modifications.
  • AMX Mod X: Advanced scripting platform for server plugins.
  • ReAPI: Enhances plugin capabilities with new native functions.
  • ReGameDLL: Updated game library for improved functionality.
  • Reunion: A Metamod plugin that allows protocol 47 and 48 non-steam clients to connect to ReHLDS servers

Notes

  • The server installation includes default configuration files such as server.cfg, listip.cfg, and banned.cfg.

For further configuration or plugin information, refer to the official AMX Mod X documentation or the ReHLDS GitHub repository.

Docker Images (1)
Name Image
ghcr.io/ptero-eggs/games:source ghcr.io/ptero-eggs/games:source
Startup Command
./hlds_run -console -game {{HLDS_GAME}} -port {{SERVER_PORT}} -sport {{VAC_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart +maxplayers 32 +pingboost 2 +sys_ticrate 1200
Variables (10)

ReHLDS Version

The version of ReHLDS to install, or 'latest' for the latest release.

Environment:
VERSION
Default:
latest
User Viewable:
User Editable:
Rules:
required|string

Available Modules

Available Modules: rehlds, reunion, amxmodx, metamod-r, reapi and ReGameDLL_CS

Environment:
INSTALL_MODULES
Default:
rehlds,reunion,amxmodx,metamod-r,reapi,ReGameDLL_CS
User Viewable:
User Editable:
Rules:
required|string|max:128

Server Hostname

This sets the hostname of the server. Example: "My Custom CS 1.6 Server"

Environment:
HOSTNAME
Default:
Counter-Strike 1.6 Server
User Viewable:
User Editable:
Rules:
required|string|max:128

Map

The default map for the server.

Environment:
SRCDS_MAP
Default:
de_dust2
User Viewable:
User Editable:
Rules:
required|string|alpha_dash

Auto update

Auto update on restart

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

Game ID

The ID corresponding to the game to download and run using HLDS. The HLDS server ID is 90. This should not be changed.

Environment:
SRCDS_APPID
Default:
90
User Viewable:
User Editable:
Rules:
required|numeric|in:90

Game Name

The name corresponding to the game to download and run using HLDS

Environment:
HLDS_GAME
Default:
cstrike
User Viewable:
User Editable:
Rules:
required|alpha_dash|between:1,100

Beta branch

Leave empty for the public branch, for the legacy version select steam_legacy.

Environment:
SRCDS_BETAID
Default:
steam_legacy
User Viewable:
User Editable:
Rules:
nullable|string|in:,steam_legacy

VAC port

Specifies the VAC port the server should use. Default is 26900.

Environment:
VAC_PORT
Default:
26900
User Viewable:
User Editable:
Rules:
required|numeric|digits_between:1,5

Validate

Validate game files on update. Keep it disabled with ReHLDS due to SteamCMD overwriting its changes

Environment:
VALIDATE
Default:
0
User Viewable:
User Editable:
Rules:
required|boolean
Installation Script
Container: ghcr.io/ptero-eggs/installers:debian
Entrypoint: bash
#!/bin/bash

if [[ -z "${STEAM_USER}" ]] || [[ -z "${STEAM_PASS}" ]]; then
    echo -e "Steam user is not set.\nUsing anonymous user."
    STEAM_USER=anonymous
    STEAM_PASS=""
    STEAM_AUTH=""
else
    echo -e "User set to ${STEAM_USER}"
fi

# Download and install SteamCMD
cd /tmp
mkdir -p /mnt/server/steamcmd
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

chown -R root:root /mnt
export HOME=/mnt/server

# Install game via SteamCMD
./steamcmd.sh \
+force_install_dir /mnt/server \
+login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} \
+app_set_config 90 mod ${HLDS_GAME} \
$( [[ "${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

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

cd /mnt/server

# Download repo etc
REPO_OWNER="Red-Banana-Official"
REPO_NAME="cstrike1.6_rehlds"
RELEASE_DATA=$(curl -s https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest)

TAG_NAME=$(echo "$RELEASE_DATA" | jq -r '.tag_name')
[[ "$TAG_NAME" == "null" ]] && TAG_NAME="1.0.0"

DOWNLOAD_URL=$(echo "$RELEASE_DATA" | jq -r '.zipball_url')
OUTPUT_FILE="$REPO_NAME-$TAG_NAME.zip"

rm -rf ${REPO_OWNER}-*
echo "Downloading release: $OUTPUT_FILE"
curl -sSL -o "$OUTPUT_FILE" "$DOWNLOAD_URL" || { echo "Failed to download $OUTPUT_FILE"; exit 1; }
echo "Downloaded: $OUTPUT_FILE"
echo "-----------------------------------------"

unzip -q -o "$OUTPUT_FILE"
rm -f "$OUTPUT_FILE"

EXTRACTED_DIR=$(find . -maxdepth 1 -type d -name "${REPO_OWNER}-*" | head -n 1)
cd "$EXTRACTED_DIR"

# Module install
install_module() {
    local NAME=$1
    local DIR=$2
    ZIP=$(find modules/$DIR/ -type f -name '*.zip' | sort -V | tail -n 1)
    
    if [[ -z "$ZIP" ]]; then
        echo "Error: ZIP file for module '$NAME' not found."
        return 1
    fi

    echo "Installing module: $NAME"
    
    mkdir -p "${NAME}-install"
    cp "$ZIP" "${NAME}-install"
    cd "${NAME}-install"
    unzip -q -o *.zip

    case "$NAME" in
        "rehlds"|"ReGameDLL_CS") 
            cp -r bin/linux32/* /mnt/server
            ;;
        "amxmodx"|"reapi") 
            cp -r addons /mnt/server/cstrike
            ;;
        "metamod-r")
            cp -r addons /mnt/server/cstrike
            mkdir -p /mnt/server/cstrike/addons/metamod
            touch /mnt/server/cstrike/addons/metamod/plugins.ini
            grep -qxF "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" /mnt/server/cstrike/addons/metamod/plugins.ini || echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> /mnt/server/cstrike/addons/metamod/plugins.ini
            sed -i 's|^gamedll_linux.*|gamedll_linux "addons/metamod/metamod_i386.so"|' /mnt/server/cstrike/liblist.gam || echo 'gamedll_linux "addons/metamod/metamod_i386.so"' >> /mnt/server/cstrike/liblist.gam
            ;;
        "reunion")
            mkdir -p /mnt/server/cstrike/addons/metamod/reunion/
            cp -r bin/Linux/* /mnt/server/cstrike/addons/metamod/reunion/
            touch /mnt/server/cstrike/addons/metamod/plugins.ini
            grep -qxF "linux addons/metamod/reunion/reunion_mm_i386.so" /mnt/server/cstrike/addons/metamod/plugins.ini || echo "linux addons/metamod/reunion/reunion_mm_i386.so" >> /mnt/server/cstrike/addons/metamod/plugins.ini
            cp reunion.cfg /mnt/server/cstrike/reunion.cfg
            SALT=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 50)
            sed -i "s/^SteamIdHashSalt\s*=.*/SteamIdHashSalt = $SALT/" /mnt/server/cstrike/reunion.cfg
            ;;
    esac

    cd ..
    rm -rf "${NAME}-install"
    echo "Module '$NAME' installed successfully."
}

declare -A MODULES=(
    ["rehlds"]="rehlds"
    ["amxmodx"]="amxmodx"
    ["ReGameDLL_CS"]="ReGameDLL_CS"
    ["reapi"]="reapi"
    ["metamod-r"]="metamod-r"
    ["reunion"]="reunion"
)

IFS=',' read -r -a MODULE_LIST <<< "${INSTALL_MODULES}"
for mod in "${MODULE_LIST[@]}"; do
    [[ -n "${MODULES[$mod]}" ]] && install_module "$mod" "${MODULES[$mod]}"
done

# Ensure files exist
mkdir -p /mnt/server/cstrike/addons/amxmodx/data
[[ ! -f /mnt/server/cstrike/listip.cfg ]] && echo "// Banned IPs" > /mnt/server/cstrike/listip.cfg
[[ ! -f /mnt/server/cstrike/banned.cfg ]] && echo "// Banned IDs" > /mnt/server/cstrike/banned.cfg
[[ ! -f /mnt/server/cstrike/addons/amxmodx/data/csstats.dat ]] && touch /mnt/server/cstrike/addons/amxmodx/data/csstats.dat

chmod -R 777 /mnt/server
rm -rf /mnt/server/Red-Banana-Official-*

echo "-----------------------------------------"
echo "Installation Complete!"
echo "-----------------------------------------"