Skip to content

Server Setup

wootguy edited this page Oct 11, 2026 · 11 revisions

Building the server

Prerequisites

Windows users:
Install Git, CMake, and Visual Studio.

Linux users:
Install git, CMake, a compiler, and 32-bit libraries for cross-compiling.
Debian packages: apt install git cmake build-essential gcc-multilib g++-multilib libc6-dev-i386 mesa-common-dev

Install HLDS

  1. Install the official Half-Life dedicated server from SteamCMD. The steam_legacy beta is required for ReHLDS compatibility:
    login anonymous
    app_set_config 90 mod cstrike
    app_update 90 -beta steam_legacy validate
    
  2. Test that HLDS is working with this command. Run this in the steamapps/common/Half-Life/ folder that was downloaded in the previous step.
    hlds.exe +map crossfire +maxplayers 32 +developer 1 +log on
    You should be able to join the server in the LAN tab of the in-game server browser.

Install ReHLDS

ReHLDS is required for SevenKewp to load, but will be optional in the future.

  1. Build and install my fork of ReHLDS.
    1. Windows users:
      1. Open rehlds/msvc/ReHLDS.sln. Select OK if asked to retarget.
      2. Optional: If you're setting up a public server, right-click the ReHLDS project and select Properties -> Configuration Manager. Change the Active solution configuration to Release. This gives much better performance.
      3. Right click Solution 'ReHLDS' and select Build Solution
      4. Copy the .exe and .dll files from SevenKewp/rehlds/msvc/Debug (or Release) over the existing files in your Half-Life/ folder on the dedicated server. Director.dll is special and goes into Half-Life/valve/dlls/ instead.
  2. Test that ReHLDS is installed correctly by launching the server again.
    hlds.exe +map crossfire +maxplayers 32 +developer 1 +log on
    In the server console, enter the rescount command. You should see some statistics about models/sounds/etc. If nothing happens, you're still running HLDS and need to fix your ReHLDS install.

Install SevenKewp

  1. Open a shell somewhere and clone the repo: git clone --recurse-submodules https://github.com/wootguy/SevenKewp
  2. cd SevenKewp and git checkout the latest release tag, which as of this writing is v0.4.0 (git checkout v0.4.0)
  3. git submodule update --init --recursive in case submodules have changed between the latest tag and the latest master commit.
  4. Run scripts/build.bat (Windows) or scripts/build.sh (Linux).
    1. The v0.4.0 release is missing these scripts, grab them here.
  5. Copy the contents of SevenKewp/build/output/ to Half-Life/valve/ in your Half-Life dedicated server.
  6. Copy the contents of SevenKewp/sevenkewp/ to Half-Life/valve/ on your dedicated server. The .cfg files and delta.lst must be in valve/, but you can copy everything else to valve_downloads/ if you want.
  7. Add -dll dlls/server.dll (Windows) or -dll dlls/server.so (Linux) to the launch options of your dedicated server. If you use metamod, then add gamedll dlls/server.dll (or .so) to metamod's config.ini instead.
  8. Try it out! Example launch command:
    hlds.exe +map sc_test -dll dlls/server.dll +maxplayers 32 +developer 1 -heapsize 131072 -num_edicts 7727 +servercfg "" +log on

Troubleshooting

There is an error about loading .so files on Linux and the server fails to start ("LoadLibrary failed on ...").

The .so libs in the Half-Life folder may be incompatible with your system. Deleting the .so files that the server is complaining about may fix this. Or try symlinking your system libs in place of the Half-Life libs, like so:
ln -fs /usr/lib/i386-linuxgnu/libxxx.so ./libxxx.so
Half-Life is a 32-bit program so you must use 32-bit libraries with it.

Building native plugins

Native plugins are tightly integrated with the mod code and have full access to its classes and utilities. This makes native plugins powerful but easily broken by mod updates. Here's how to build them.

  1. Set up the mod project as described in the previous section
  2. Open a shell in SevenKewp/plugins/
  3. Clone all the plugin repos you want. Example: git clone https://github.com/wootguy/HLCMapPlugins/
  4. Run the build script again: scripts/build.bat (Windows) or scripts/build.sh (Linux)
  5. Copy the contents of SevenKewp/build/output/ to valve/ on your dedicated server.
  6. Repeat steps 4 and 5 whenever the mod updates.

Installing native plugins

Once you have built or downloaded a native plugin, you need to copy it to the right place and update the relevant config file. valve and valve_downloads are interchangeable. The plugin loader will search both paths.

Server plugins

  1. Copy the dll to the server plugins folder (Example: valve/plugins/server/AntiBlock.dll)
  2. Add the plugin file path to valve/plugins.txt without the file extension (Example: write Antiblock to load the path in step 1)

Plugin paths in plugins.txt start in valve/plugins/server/. That's why you only need to write AntiBlock instead of valve/plugins/server/AntiBlock in the above example.

Map plugins

These steps only apply to unreleased maps/ports. Ideally the map package will set this up for you so that you only need to extract the files.

  1. Copy the dll to the map plugins folder (Example: valve/plugins/maps/pizza_ya_san.dll)
  2. Add the plugin file path to the map cfg file(s) the plugin was made for (Example: add map_plugin pizza_ya_san to valve/maps/pizza_ya_san1.cfg and valve/maps/pizza_ya_san2.cfg).

Plugin paths in map cfg files start in valve/plugins/maps/.

Installing Sven Co-op maps

Sven Co-op maps often need converting before they can be used in Half-Life. Not doing this will result in crashes. This section is here mostly as a warning not to install maps directly. Good luck actually following this. I plan to publish all my ports and ripents later so that this isn't needed.

  1. Create a folder and copy scripts/convert_map.py to the new folder.
  2. Add modelguy, ripent, bspguy, studiodec, studiomdl (Sven Co-op SDK), and wadmaker to the same folder. modelguy and bspguy may need to be built from source for the latest porting features.
  3. Copy resguy_default_content_hl.txt from resguy to the folder, and rename it to resguy_default_content.txt
  4. Copy skill.cfg to the folder.
  5. Copy sound/hlcoop/sentences.txt to the folder, and rename it to hlcoop_sentences.txt
  6. Copy titles.txt from the latest version of Sven Co-op to the folder.
  7. Update valve_path in the script to point to your Half-Life/valve folder.
  8. Install imagemagick and ffmpeg. Make sure magick and ffmpeg are usable from the command-line.
  9. Extract a map package to the folder (maps/ should end up next to the script)
  10. Run the script

Maps made for Sven Co-op 5.x often need special attention (map moving/splitting to fit in the +/-4096 grid, texture resizing, etc.). bspguy has porting tools to help with this.

So far, I've had the only server hosting sven maps so I don't bother renaming files that the script modifies. That's a horrible practice and will cause crashes once other server ops start hosting without reading this section.

Server configuration

See the Server Settings wiki for configuration unique to this mod.

Clone this wiki locally