cd ~
# Install build dependencies on Ubuntu/Debian
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y build-essential
# Build dependencies for RedHat/Fedora/CentOS
sudo dnf install cmake gcc gcc-c++ glibc-devel.i686 SDL-devel.i686
# Clone repo
git clone --depth 1 https://github.com/rehlds/Metamod-R
cd Metamod-R
# Compile
./build.sh --compiler=gcc -j=$(nproc)
# Download HLDS compatible with ReHLDS
# Setup instructions for SteamCMD are on Valve's wiki: https://developer.valvesoftware.com/wiki/SteamCMD
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir ~/hlds +login anonymous +app_update 90 -beta steam_legacy validate +quit
# Compile ReHLDS
cd ~
git clone --depth 1 https://github.com/rehlds/ReHLDS
cd ReHLDS
./build.sh --compiler=gcc -j=$(nproc)
# Overwrite the original HLDS engine_i486.so
cp build/rehlds/engine_i486.so ~/hlds/engine_i486.so
# Or you could just download the latest release zip from https://github.com/rehlds/ReHLDS/releases
# and replace the engine_i486.so file on ~/hlds from that zip
# If you wanna use metamod,
# create the metamod folder and move the compiled metamod binary from earlier
mkdir -p cstrike/addons/metamod/dlls/
mv ~/Metamod-R/build/metamod/metamod_i386.so cstrike/addons/metamod/dlls/metamod.so
# Get latest Xash3D-FWGS AppImage from github releases
# If you wanna use metamod
wget https://github.com/FWGS/xash3d-fwgs/releases/download/continuous/xash3d-fwgs-i386.AppImage
# or not
wget https://github.com/FWGS/xash3d-fwgs/releases/download/continuous/xash3d-fwgs-amd64.AppImage
chmod +x xash3d-fwgs-amd64.AppImage
# Create start script
echo "./xash3d*.AppImage -game cstrike -dedicated -console -insecure -nomaster +maxplayers 16 +map de_dust" > start.sh
chmod +x start.sh
# Allow the port to be open on the firewall.
# For example, if you use ufw:
sudo ufw allow 27015/udp
# Get your machine's public IPv4 address
curl api.ipify.org
Edit your server's config with nano cstrike/server.cfg
.
Here's an example server.cfg
:
// disable autoaim
sv_aim 0
// disable clients' ability to pause the server
pausable 0
// default server name. Change to "Bob's Server", etc.
hostname "Big Man"
// maximum client movement speed
sv_maxspeed 320
// 20 minute timelimit
mp_timelimit 20
// Disable cheats
sv_cheats 0
// Set server IP address
ip "<your_public_ipv4_here>"
// set map to de_dust2
set defaultmap de_dust2
// Prevent permanent invisible shield
sv_skipshield 1
// Set this to `1` if you want your server to be on the public servers list
public 0
// Set maximum players
maxplayers 16
// load ban files
exec listip.cfg
exec banned.cfg
Make sure to change <your_public_ipv4_here>
to your actual machine's public IPv4 address from what you got on the curl
command earlier.
# Ignore the errors unless it crashes the server.
./start.sh
You can either use the console to connect to the server:
connect <ip>:27015 49
Or, add it as a server on the Internet Games menu with Xash3D 49 (New)
set as the protocol on your Xash3D-FWGS client.
NOTE: It is possible to do all of these on an arm64 Linux machine too, but this guide is mainly focused on x86 machines.
metamod also doesn't work on any archs other than i386 or x86 32-bit.
If you're on an arm64 machine, you can get a copy of Half-Life Dedicated Server binaries from here: https://github.com/hun1er/hlds-builds Be warned though, as this is an unofficial mirror, so download and use it at your own risk. I am not responsible for any issues it causes.