Operating System Linux

How to Install a Counter-Strike 1.6 Server on Ubuntu 26.04 or AlmaLinux 9

Install the Half-Life Dedicated Server with SteamCMD, select the Counter-Strike mod, open the game port and keep the server running on a current Linux release.

This guide sets up a Counter-Strike 1.6 dedicated server on a 64-bit Linux VPS running Ubuntu 26.04 LTS, Ubuntu 24.04 LTS, Debian 13 or AlmaLinux 9 / Rocky Linux 9. Counter-Strike 1.6 runs on the Half-Life Dedicated Server (HLDS), which Valve distributes free of charge through SteamCMD under app ID 90. An anonymous SteamCMD login is enough; you do not need to own the game to host it.

Requirements

  • An x86-64 server. HLDS and SteamCMD are 32-bit x86 programs, so they do not run on ARM instances.
  • About 1 GB of RAM and 2 GB of free disk space for one server.
  • A user with sudo rights and a public IPv4 address.

Install the 32-bit libraries

On Ubuntu 26.04, Ubuntu 24.04 and Debian 13, install the 32-bit runtime libraries that SteamCMD and HLDS need, plus tmux for keeping the console open:

sudo apt update
sudo apt install lib32gcc-s1 lib32stdc++6 curl tar tmux

On AlmaLinux 9 and Rocky Linux 9:

sudo dnf install glibc.i686 libstdc++.i686 curl tar tmux

Create a dedicated user

Do not run a game server as root. Create an unprivileged account and switch to it:

sudo useradd -m -s /bin/bash steam
sudo -iu steam

All remaining steps, except the firewall, run as the steam user.

Download SteamCMD

Fetch Valve's SteamCMD archive and unpack it in its own directory:

mkdir ~/steamcmd
cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

Run it once so that it updates itself, then leave the prompt:

./steamcmd.sh +quit

Install HLDS with the Counter-Strike mod

HLDS is a special case in SteamCMD: the app ID is always 90, and you choose the game with app_set_config before the download. Set the install directory before logging in:

cd ~/steamcmd
./steamcmd.sh +force_install_dir /home/steam/hlds +login anonymous +app_set_config 90 mod cstrike +app_update 90 validate +quit

Valve's SteamCMD documentation notes that app 90 often needs several runs before every file is in place. Repeat the same command until SteamCMD reports that the app is fully installed and no more files are downloaded. Then confirm that the game directory exists:

ls /home/steam/hlds/cstrike /home/steam/hlds/hlds_run

Give the server access to the Steam client library, otherwise HLDS logs a steamclient.so error at startup:

mkdir -p ~/.steam/sdk32
ln -s ~/steamcmd/linux32/steamclient.so ~/.steam/sdk32/steamclient.so

Configure the server

Settings live in /home/steam/hlds/cstrike/server.cfg, which is executed on every map change. Open it with an editor and set at least these values:

hostname "My CS 1.6 Server"
rcon_password "use-a-long-random-string"
sv_password ""
sv_lan 0
mp_timelimit 30
mp_friendlyfire 0

Leave sv_password empty for a public server or set it to make the server private. The map rotation is in cstrike/mapcycle.txt, one map name per line.

Open the firewall

The game uses UDP port 27015 by default. Open TCP 27015 as well if you want remote console (RCON) access. Run these as your sudo user, not as steam.

Ubuntu and Debian with UFW:

sudo ufw allow 27015/udp
sudo ufw allow 27015/tcp

AlmaLinux and Rocky Linux with firewalld:

sudo firewall-cmd --permanent --add-port=27015/udp
sudo firewall-cmd --permanent --add-port=27015/tcp
sudo firewall-cmd --reload

If your provider has its own network firewall, allow the same ports there.

Start the server

Start HLDS inside a tmux session so that it keeps running after you log out:

sudo -iu steam
tmux new -s cs16
cd ~/hlds
./hlds_run -game cstrike +ip 0.0.0.0 +port 27015 +maxplayers 16 +map de_dust2

hlds_run is a wrapper script that restarts the server process if it crashes. Detach from the session with Ctrl+B then D, and return to the console later with tmux attach -t cs16. Type status in the console to see the current map and connected players, and quit to stop the server.

Verify the connection

Check that the server is listening:

ss -lun | grep 27015

In the Counter-Strike 1.6 client, open the console and connect by address, replacing the example IP with your server's:

connect 203.0.113.10:27015

Update the server

Stop the server, run the same SteamCMD command that installed it, and start it again:

cd ~/steamcmd
./steamcmd.sh +force_install_dir /home/steam/hlds +login anonymous +app_set_config 90 mod cstrike +app_update 90 validate +quit

Be aware that validate restores any stock file you edited to its original content. Back up server.cfg, mapcycle.txt and motd.txt before updating, or drop validate for routine updates.

Frequently asked questions

Why does the download finish with missing files?

This is a long-standing quirk of app 90 that Valve's documentation acknowledges. Run the app_update 90 validate command again; each pass fetches more of the depots until the installation is complete.

Can I run more than one server on the same VPS?

Yes. Install each one into its own directory with a different force_install_dir, start it with a different +port value such as 27016, and open that port in the firewall.

Why is my server not shown in the internet server list?

Make sure sv_lan is 0, UDP port 27015 is reachable from outside, and the server is bound to the public address. Players can always connect directly by IP and port even when the master server list is slow to pick the server up.

Does the server need a Steam account or a game server token?

No. HLDS downloads with login anonymous, and GoldSrc servers start without a game server login token.

Share story:

Continue reading other guides on How VPS.