2025-01-16 23:01:08 +01:00
2025-01-17 19:53:02 +01:00
2026-02-17 19:32:41 +01:00
2026-02-17 19:19:58 +01:00

Docker GitHub Actions Steam

GitHub Actions Docker Image CI Docker

banner

HLDS Docker - Crossfire 24/7

Half-Life Dedicated Server as a Docker image

Probably the fastest and easiest way to set up an old-school Half-Life Deathmatch Dedicated Server (HLDS) running Crossfire map 24/7 with 15-minute rounds.

You don't need to know anything about Linux or HLDS to start a server. You just need Docker and this image.

Features

Included:

  • 15-minute rounds with automatic map cycling
  • Crossfire map only
  • Customizable server settings via .env
  • Auto-restart on crash
  • MetaMod + AMX Mod X 1.9 installed
  • Built-in timeleft command (type in chat to see remaining time)
  • Admin commands ready

Quick Start

The latest image of this repo is available in docker hub josejsalinas/hl-server

docker run -d --name halflife-server \
  -p 27015:27015 \
  -p 27015:27015/udp \
  -e SERVER_NAME="My Crossfire Server" \
  -e MAX_PLAYERS=16 \
  -e RCON_PASSWORD=changeme \
  josejsalinas/hl-server:latest

Or use docker compose with the hub image by creating a docker-compose.yml:

services:
  halflife:
    image: josejsalinas/hl-server:latest
    container_name: halflife-server
    restart: unless-stopped
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
    environment:
      - SERVER_NAME=${SERVER_NAME:-Half-Life Crossfire Server}
      - MAX_PLAYERS=${MAX_PLAYERS:-16}
      - SERVER_PASSWORD=${SERVER_PASSWORD:-}
      - RCON_PASSWORD=${RCON_PASSWORD:-changeme}
      - WELCOME_MESSAGE=${WELCOME_MESSAGE:-Welcome to Crossfire!}

Build Locally

Build the image yourself:

docker compose build

Run your server:

docker compose up -d

That's it! Your server is now running on port 27015.

Configuration

Edit the .env file to customize your server:

cp .env.example .env
nano .env
Variable Description Default
SERVER_NAME Server name shown in server browser Half-Life Crossfire Server
MAX_PLAYERS Maximum number of players 16
SERVER_PASSWORD Password to join server (leave empty for public) (empty)
RCON_PASSWORD RCON admin password changeme
WELCOME_MESSAGE Message shown when players join Welcome to Crossfire! Fight until the last player stands!

Example Configuration

SERVER_NAME=My Awesome Crossfire Server
MAX_PLAYERS=20
SERVER_PASSWORD=secret123
RCON_PASSWORD=adminpass456
WELCOME_MESSAGE=Welcome! 15-minute Crossfire rounds!

What is included

  • HLDS Build 7882. Stable version compatible with MetaMod and AMX Mod X.

    Protocol version 48
    Exe version 1.1.2.2/Stdio (valve)
    Exe build: 17:23:32 May 24 2018 (7882)
    
  • Metamod-P version 1.21p38

  • AMX Mod X version 1.9 (latest stable)

  • Minimal config with 15-minute rounds and Crossfire map only

  • Customizable via environment variables

Default mapcycle - crossfire 24/7

  • crossfireS

Advanced

Custom Server Configuration

In order to use additional custom settings, you can modify server.cfg before building, or:

  1. Enter the running container:
docker exec -it halflife-server bash
  1. Edit the config:
nano /opt/steam/hlds/valve/server.cfg
  1. Restart the server:
docker compose restart

Notes

  • The server uses HLDS build 7882 for better compatibility with AMX Mod X
  • Round duration is set to 15 minutes
  • Only the Crossfire map is in rotation
  • Server automatically restarts on crash

License

This configuration is provided as-is for running Half-Life dedicated servers. Half-Life is a trademark of Valve Corporation.

Description
Half-Life Dedicated Server as a Docker image
Readme 1.3 MiB
Languages
Dockerfile 42%
Shell 33.2%
Pawn 24.8%