How to Install ReHLDS on Linux (2026 Guide)

July 2, 2025 Daemon666 9 min read 17 görüntülenme

ReHLDS is a reverse-engineered, bug-fixed rewrite of the Half-Life dedicated server engine, maintained by the rehlds GitHub organisation. It is a drop-in replacement for the engine binary: same directory layout, same cvars, same mods. What you get is a large pile of fixed engine bugs, real anti-exploit protections against the classic HL crash packets, faster networking, and cvars that plain HLDS simply does not have. There is no serious reason to run stock HLDS on a public server in 2026.

1. Start from a working HLDS install

ReHLDS replaces files inside an existing App 90 install — it is not a full server. If you do not have one yet, do the SteamCMD install first and make sure the vanilla server boots to a map.

2. Get the right build

Download the latest ReHLDS release archive from the project's GitHub releases page. The archive contains both platforms; you want the Linux directory. Do not mix a Linux engine_i486.so with Windows swds.dll files from a different release — engine and Metamod ABI expectations are tied to the build.

The Linux files that matter:

engine_i486.so
hlds_linux        (the launcher ReHLDS ships)
libstdc++.so.6    (only if the archive contains one — usually you keep the system one)

3. Back up, then copy

cd /home/steam/hlds
cp engine_i486.so engine_i486.so.valve.bak
cp hlds_linux hlds_linux.valve.bak

cp /path/to/rehlds/engine_i486.so ./engine_i486.so
cp /path/to/rehlds/hlds_linux ./hlds_linux
chmod +x hlds_linux hlds_run

Both files go in the server root (next to hlds_run), never inside cstrike/. Copying engine_i486.so into cstrike/ is a classic mistake — the server keeps running the Valve engine and you spend an hour wondering why rehlds_version is unknown.

4. Start the server

cd /home/steam/hlds
./hlds_run -game cstrike -strictportbind -ip 0.0.0.0 -port 27015 \
  +map de_dust2 +maxplayers 20 +sv_lan 0

On startup ReHLDS prints its banner. Look for a line naming ReHLDS and its version — if you only see the Valve Half-Life Dedicated Server banner, the engine file was not replaced.

5. Verify it is actually running

In the server console:

rehlds_version

A stock HLDS answers Unknown command: rehlds_version. ReHLDS prints its version string. That single command is the whole verification — do not trust the file timestamp, trust the cvar.

6. ReHLDS-specific cvars worth setting

Put these in cstrike/server.cfg. They are the reason people install ReHLDS in the first place:

// reject malformed / oversized packets instead of crashing
sv_rehlds_attachedentities_playeranimationspeed_fix 1
sv_rehlds_local_gametime 1
sv_rehlds_send_mapcycle 0

// hardening
sv_rehlds_force_dlmax 1
sv_filterban 1
sv_rcon_maxfailures 5
sv_rcon_minfailures 5
sv_rcon_minfailuretime 30

Enable them one at a time, restart, and watch the log. Some hardening cvars interact badly with old plugins that send hand-built messages — if the server starts crashing right after you turn a batch on, see crash after enabling ReHLDS security cvars.

7. Rebuild the rest of the stack in order

ReHLDS on its own is only the engine. The order that works:

  1. ReHLDS (engine) — you are here.
  2. ReGameDLL_CS — replaces cstrike/dlls/cs.so, the game logic.
  3. Metamod-r — the plugin loader, pointed at from liblist.gam.
  4. AMX Mod X — loaded by Metamod.
  5. ReAPI — only useful once ReHLDS and ReGameDLL are both in place.

Do not install ReAPI before ReGameDLL. ReAPI hooks functions that only exist in ReGameDLL; without it the module refuses to load or the server dies at map start.

Common errors

  • Unknown command: rehlds_version — the engine was not replaced. You copied engine_i486.so to the wrong directory, or you are launching a different hlds_linux (check with ps aux | grep hlds and look at the path).
  • Segmentation fault immediately at startup — mismatched binaries: a 64-bit build of something in the chain, or a Metamod version that predates the ReHLDS API. Confirm with file engine_i486.so; it must say ELF 32-bit LSB shared object, Intel 80386. If it says x86-64, you downloaded the wrong archive.
  • Host_Error: Couldn't get DLL API from ./cstrike/dlls/cs.so — your ReGameDLL build is older or newer than the ReHLDS engine's expected interface. Update both to the current releases; see ReGameDLL/ReHLDS incompatibility.
  • Metamod plugins show bad load after the switch — you are on classic Metamod with an old ABI. Move to Metamod-r, or read the bad load fix.

Rolling back

Because you backed up the originals, rollback is two commands:

cd /home/steam/hlds
cp engine_i486.so.valve.bak engine_i486.so
cp hlds_linux.valve.bak hlds_linux

Restart, run rehlds_version, and confirm it is unknown again. Keep those .bak files — they are the only trivially available copy of the Valve engine once you have overwritten it, short of re-running app_update 90 validate (which, usefully, also restores them).

Verification checklist

  • rehlds_version returns a version string.
  • The server reaches a map and accepts a client connection.
  • meta list (if Metamod is installed) shows every plugin as RUN.
  • The log has no repeating warnings on map change.

If all four hold, you are on ReHLDS. Next: the full modern stack, or compile it yourself with the Docker build guide.

Katkıda bulunanlar: Daemon666 ✦
Paylaş: