Set Up a Half-Life 2: Deathmatch Server on AlmaLinux 9 or Rocky Linux 9
Install SteamCMD on AlmaLinux 9 or Rocky Linux 9, download the Half-Life 2: Deathmatch dedicated server (app 232370), configure it and open the firewall.
This guide sets up a Half-Life 2: Deathmatch dedicated server on AlmaLinux 9 or Rocky Linux 9 with SteamCMD, Valve's command-line Steam client. At the end the server runs under its own unprivileged account, is reachable on the default port 27015 and can be updated with one command. The multiplayer component of Half-Life 2 is Half-Life 2: Deathmatch (game directory hl2mp); the single-player campaign has no dedicated server.
CentOS 6 reached end of life in November 2020 and can no longer run current Steam tools safely. AlmaLinux 9 and Rocky Linux 9 are the maintained replacements, and Valve's SteamCMD documentation covers the RHEL family alongside Ubuntu and Debian.
Requirements
- A 64-bit (x86_64) server running AlmaLinux 9 or Rocky Linux 9. SteamCMD and the server binaries are x86 programs and do not run on ARM.
- A user with
sudorights. - Several gigabytes of free disk space for SteamCMD and the server files.
- No Steam account. The dedicated server (Steam application ID
232370, "Half-Life 2: Deathmatch Dedicated Server") is downloaded with an anonymous login. Use of SteamCMD and the server files is subject to the Steam Subscriber Agreement.
Step 1: Install the 32-bit libraries
SteamCMD is a 32-bit program, and the server files that SteamCMD delivers for this game are 32-bit as well. Valve's documentation lists these dependencies for Enterprise Linux:
sudo dnf install -y glibc.i686 libstdc++.i686
Install the tools used in the rest of the guide. tmux keeps the server console alive after you close your SSH session:
sudo dnf install -y curl tar tmux nano
Step 2: Create a user for the server
Never run a game server as root. Create a dedicated account and switch to it:
sudo useradd -m steam
sudo -iu steam
Run every command in steps 3 to 5 as this user. Type exit when you need to return to your own account.
Step 3: Install SteamCMD
Create a directory for SteamCMD, then download and unpack the archive from Valve's content delivery network:
mkdir ~/Steam
cd ~/Steam
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
Step 4: Download the Half-Life 2: Deathmatch server
Run SteamCMD with the commands on one line. Set the installation directory before logging in, log in anonymously, install the application and quit:
cd ~/Steam
./steamcmd.sh +force_install_dir /home/steam/hl2dm +login anonymous +app_update 232370 validate +quit
On the first run SteamCMD updates itself, then downloads the server. The process ends with a line that says the app was fully installed. If a download stops part-way, run the same command again; it resumes and validate checks every file.
Some older tutorials use application ID 238430. That ID belongs to a different game, so use 232370.
Step 5: Configure the server
Game settings are read from hl2mp/cfg/server.cfg inside the installation directory each time a map loads. Create the file:
nano /home/steam/hl2dm/hl2mp/cfg/server.cfg
Start with a small configuration and replace the example values:
// Half-Life 2: Deathmatch server configuration
hostname "Example HL2DM Server"
rcon_password "use-a-long-random-password"
sv_password ""
sv_lan 0
mp_fraglimit 50
mp_timelimit 20
mp_teamplay 0
hostname is the name shown in the server browser. rcon_password protects remote administration; leave it empty to disable RCON entirely. Set sv_password if you want a private server.
Step 6: Open the firewall
Return to your sudo account with exit. Source servers use UDP for game traffic, and TCP on the same port for RCON:
sudo firewall-cmd --permanent --add-port=27015/udp
sudo firewall-cmd --permanent --add-port=27015/tcp
sudo firewall-cmd --reload
Skip the TCP rule if you do not use RCON from outside, or restrict it to your own address with a rich rule. If your provider has a network firewall in front of the server, open the same ports there. SourceTV, when you enable it, uses UDP port 27020.
Step 7: Start the server
Switch back to the steam user, open a tmux session and start the server through its wrapper script:
sudo -iu steam
tmux new -s hl2dm
cd /home/steam/hl2dm
./srcds_run -console -game hl2mp -port 27015 +map dm_lockdown +maxplayers 16
-game hl2mp selects Half-Life 2: Deathmatch, +map sets the first map and +maxplayers the number of slots. The console is ready when it reports that the connection to the Steam servers succeeded and prints the server's public IP address.
Detach from the session with Ctrl+B followed by D; the server keeps running. Reattach later with tmux attach -t hl2dm. To stop the server, type quit in its console.
Step 8: Connect and verify
Start Half-Life 2: Deathmatch on your own computer, open the developer console and connect directly:
connect 203.0.113.10:27015
The server should also appear in the in-game server browser under the name you set. In the server console, status lists the current map and the connected players.
Updating the server
When Valve updates the game, clients on the new version may be unable to join an outdated server. Stop the server, then run the installation command again as the steam user:
cd ~/Steam
./steamcmd.sh +force_install_dir /home/steam/hl2dm +login anonymous +app_update 232370 +quit
Your server.cfg is not part of the download and is left alone. Start the server again when the update finishes.
Troubleshooting
- "No such file or directory" when starting
steamcmd.shorsrcds_run: the 32-bit libraries from step 1 are missing. The message refers to the 32-bit loader, not to the script itself. - A warning that
steamclient.socannot be found in~/.steam/sdk32: create the directory and link the library that SteamCMD already downloaded:mkdir -p ~/.steam/sdk32 && ln -s ~/Steam/linux32/steamclient.so ~/.steam/sdk32/steamclient.so. - The server is not listed or players time out: check that UDP port 27015 is open in firewalld and in any provider-side firewall, and that
sv_lanis0.
Frequently asked questions
Can I host the Half-Life 2 campaign as a server?
No. The Half-Life 2 story is single-player only. The officially supported multiplayer game on the same engine is Half-Life 2: Deathmatch, which is what application 232370 installs. Co-operative campaign play exists only through third-party modifications.
How many players can the server hold?
The maps that ship with the game are built for small matches, so 8 to 16 slots is a sensible range. The game received a 64-bit update in February 2025 that raised the engine's player limit, but the server package available through SteamCMD was reported at the time to contain only the 32-bit server binary with its lower limit. Check the Source-1-Games issue tracker for the current state before planning a large server.
Does this work on Ubuntu or Debian?
Yes. Valve's documentation lists lib32gcc-s1 as the dependency there (sudo apt-get install lib32gcc-s1). The SteamCMD download, the app_update command and the srcds_run options are identical; only the firewall commands differ.
How do I start the server automatically after a reboot?
The simplest method is a @reboot entry in the steam user's crontab that starts a detached session: @reboot cd /home/steam/hl2dm && tmux new -d -s hl2dm './srcds_run -console -game hl2mp -port 27015 +map dm_lockdown +maxplayers 16'. Edit the crontab with crontab -e while logged in as steam.