Files
esefandClaude Opus 5.5 7e9cbee14d cs16-dm-server: CS 1.6 deathmatch server in Docker
One-command setup (SteamCMD + pinned, checksum-verified ReHLDS / ReGameDLL /
Metamod-R / AMXX / ReAPI / ReUnion / CSDM-ReAPI / YaPB / GunGame), .env
settings, ./cs menu (map, DM/GunGame mode, bots, kill counter, restart,
update), own plugins (extras, rtv, mode switch), all-time kill counter,
watchdog + nightly backup, docs for admins and players.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 05:03:07 +03:00

5.6 KiB

Running the server

Start with ./cs, the menu that covers day-to-day use. This page covers everything else. The paths below are relative to the repo folder.

Admins (in-game admin menu)

  1. While the person is on the server, run ./rcon status and copy their ID from the uniqueid column (STEAM_0:1:12345678).
  2. Add a line at the end of hlds/cstrike/addons/amxmodx/configs/users.ini:
    "STEAM_0:1:12345678" "" "abcdefghijklmnopqrstu" "ce"
    
    The flags abcdefghijklmnopqrstu mean all rights. ce means "match by SteamID, no password".
  3. Run ./rcon amx_reloadadmins, or wait for the next map.
  4. In game the admin opens the console and types amxmodmenu. From there they can kick, ban (by SteamID), change the map, and start votes.

Don't ban by IP (addip, or amx_banip) when players come through a tunnel like playit. Everyone shares one IP there, so an IP ban kicks everybody.

Setup keeps users.ini when you re-run it.

RCON from inside the game

The password is in secrets/rcon-password.txt. In the game console:

rcon_password <the password>
rcon changelevel de_nuke

./rcon on the server does the same without the password ever leaving the machine.

To change the password, put a new one in secrets/rcon-password.txt, then run ./cs restart.

Maps

The default mapcycle has 11 stock maps with deathmatch spawn points: de_dust2, de_inferno, de_nuke, de_train, cs_office, de_aztec, de_dust, cs_italy, de_cbble, de_prodigy and cs_assault. Every stock map works with ./cs map.

To add a custom map:

  1. Copy mapname.bsp into hlds/cstrike/maps/. If the map comes with extra files (.wad, .res, sound/, models/, gfx/), copy those into hlds/cstrike/ with the same folder layout.
  2. Add mapname as a line in hlds/cstrike/mapcycle.txt, which controls rotation and the rtv vote.
  3. Spawn points: without a spawn file, deathmatch uses the map's normal team spawns. That works, but people spawn in two clumps. To add proper spawn points, give yourself admin (see above) and type csdm_edit_spawns in the console on that map. Save, and the file lands in addons/amxmodx/configs/csdm/spawns/mapname.spawns.cfg. For GunGame to use the same points, also run ln -s spawns/mapname.spawns.cfg hlds/cstrike/addons/amxmodx/configs/csdm/mapname.spawns.cfg from the repo folder.
  4. Bots download navigation for well-known maps automatically. On unknown maps they learn as they go, and they're clumsy at first.

Fast downloads: the game's built-in download is slow (and slower through a tunnel). Put a copy of the custom maps and sounds on any web server, laid out like cstrike/ (maps/, sound/, ...). Then add this to hlds/cstrike/custom.cfg:

sv_downloadurl "http://your.site/cstrike/"

Changing settings

  • .env: name, password, slots, port, first map, bots. Then run ./cs apply.
  • hlds/cstrike/custom.cfg: any server cvar. It applies on the next map (./cs map <current map> to apply now).
  • hlds/cstrike/addons/amxmodx/configs/csdm/config.ini: deathmatch settings (respawn time, spawn protection, gun menu contents, free_for_all = 0 for team DM). Setup keeps your copy.
  • hlds/cstrike/addons/amxmodx/configs/gungame.cfg: GunGame (weapon order, kills per level, warmup). This file comes from the repo, so a setup re-run replaces it. To keep GunGame changes, put the gg_... lines in custom.cfg instead.
  • Extras cvars, all of which also go in custom.cfg: esef_kill_hp (10), esef_kill_hp_hs (20), esef_damage (1), esef_sounds (1), esef_hudinfo (1). Set any of them to 0 to turn it off.

Backups

./scripts/install-cron.sh runs scripts/backup.sh every night at 04:30. It writes backups/cs16-YYYY-MM-DD.tar.gz and keeps 14 days. The backup holds .env, secrets, mapcycle.txt, custom.cfg, the AMXX configs, stats, the GunGame stats and the kill tally. The game itself isn't included (setup downloads it again). The backups sit on the same disk as the server, so copy them somewhere else if that matters to you.

To restore one file, run this from the repo folder: tar xzf backups/cs16-<date>.tar.gz <path inside>.

The backup also deletes server logs older than 30 days. Before it does, it adds their kills to the counter, so the all-time total keeps counting.

Watchdog

The same cron install runs scripts/watchdog.sh every 5 minutes. If the server stops answering for about 15 minutes while its container is "running", the watchdog restarts it and writes a line to watchdog.log. Crashes are handled by Docker itself (restart: unless-stopped). After a crash, docker inspect -f '{{.RestartCount}}' cs16 counts how many restarts there have been.

More than one server

Clone the repo again into a folder with a different name, for example git clone <repo url> cs16-gg. Docker Compose names a project after its folder, so two folders that are both called cs16-dm-server would control each other's container. Then give the new server its own settings before setup:

cd cs16-gg
cp .env.example .env      # then edit: CS_PORT=27016, CS_NAME=cs16-gg (both must differ from the first server)
./setup.sh
./scripts/install-cron.sh

Every folder is independent: its own game files, configs, stats and cron lines.

Logs and privacy

  • docker logs cs16 or ./cs logs shows the live console. ./cs logs hides password lines.
  • hlds/cstrike/logs/ has one file per map: kills, chat, connects. HLDS also writes every cvar into these files at each map change, including the join password. Don't paste them publicly.

Uninstall

./scripts/install-cron.sh --remove
docker compose down
cd .. && rm -rf cs16-dm-server     # everything lives in this folder
docker image rm cs16-dm-server:local