How to Install a CS 1.6 Dedicated Server on Linux
From an empty VPS to a server people can join by IP, every command in order
This is the full path from a freshly rented Linux VPS to a Counter-Strike 1.6 server that anyone can join by IP: connect over SSH, prepare the system, create a separate user, install the server through SteamCMD, run it and keep it alive in screen after you close the terminal.
It's written for people with no server administration experience. Every command comes in the right order, with the user it runs under and the output you should see. What goes on top of the bare server - ReHLDS, Metamod-R, AMX Mod X, ReUnion, FastDL - has its own guide, all of them are linked at the end.
The Whole Build in One Block
If you have done this before and just need the commands, here they are, top to bottom. Debian or Ubuntu, 64-bit. Everything below this block explains each line, what it does and what you should see.
apt update && apt full-upgrade -y dpkg --add-architecture i386 && apt update apt install -y lib32gcc-s1 lib32stdc++6 libc6-i386 wget tar screen adduser cs16 usermod -aG sudo cs16 su - cs16
mkdir ~/steamcmd && cd ~/steamcmd wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz tar -xvzf steamcmd_linux.tar.gz ./steamcmd.sh +force_install_dir /home/cs16/cs16srv +login anonymous +app_set_config 90 mod cstrike +app_update 90 -beta steam_legacy validate +quit cd ~/cs16srv screen -S cs16 ./hlds_run -game cstrike +map de_dust2 +maxplayers 16 +port 27015
The first run may stop with Unable to initialize Steam. Press Ctrl+C and run the last line again, the second start is fine. Ctrl+A, D leaves the server running and takes you back to the shell.
Where to Host a CS 1.6 Server and What It Needs
The quickest way is to run the server right on your own machine. Nothing to pay for, everything is at hand, and settings can be changed on the fly. But it is not really a sensible option if you want a proper server. The computer has to stay on 24/7 under constant load, you need a dedicated IP and network configuration, DDoS protection, and so on. This guide is about a rented VPS.
Hosting is the convenient way. Providers offer plans with stable connectivity and ping, automatic setup and DDoS protection. The machine runs around the clock, it has its own static IP and a decent channel. Picking a host is your job: there are plenty, differing in price, hardware, location and terms. You can even find something free for a trial period, and that may well be enough to figure out how a CS 1.6 server is set up and how it runs.
CS 1.6 Dedicated Server Requirements
The most important part. GoldSrc is single-threaded, so the whole load lands on one core and its clock speed decides everything. Minimum 2.5 GHz, three and above is better. One core per server: if you plan several servers, count 1 core = 1 server.
One gigabyte is perfectly enough for a CS 1.6 server. If you want a full-featured setup with an http server for FastDL and a database, take 2 GB.
And that is with a lot of room to spare. The server files themselves take under a gigabyte, the rest goes to the system, maps, models and logs.
Ubuntu is fine, but if there are no special requirements (an admin panel or something else), I would go with a clean Debian. Less clutter in the system, less that can break.
The screenshots below show an example of picking such a machine at one of the providers. Pay attention to the High Frequency line: that is what CS 1.6 needs, processors clocked above 3 GHz.
Connecting to Your Linux VPS over SSH
The machine is rented and running. Now you need to connect to it to do anything on it. For managing the server I use two programs: PuTTY for the terminal over SSH, where you type commands, and WinSCP for files through a familiar two-panel file manager. WinSCP comes in handy later, when you drop maps, configs or modules onto the server: drag them from one window into the other and that is it.
First SSH Connection with PuTTY
Open your hosting control panel and go to the server settings. You will need three things:
- Server IP address
- Username, usually root
- Password
Open PuTTY, type the IP address into the Host Name field, leave the port at 22, create a session and connect. On the first login the program will ask about the host key, agree to it. Then enter the login and password. The password is not shown in the terminal in any way, not even as asterisks, this is normal, just type it and press Enter. If everything went through, you will see the command prompt. You are on the server.
Files over WinSCP
You connect the same way. Open WinSCP, press New Site and fill in:
- Host name - your server's IP
- Port - 22
- User name - root for now, cs16 once you create that user below
- Password - that user's password
On the left is your computer, on the right is the server. Drag a file from one window into the other and it uploads. No commands, all by mouse.
Preparing Debian or Ubuntu for a CS 1.6 Server
A fresh system is almost ready to go, but a couple of things need finishing: update the packages and add what CS 1.6 will not start without. Everything in this section runs as root.
Updating the System
The first thing to do after logging in is update the system. Two commands in one line:
apt update && apt full-upgrade -y
apt update && apt full-upgrade -y to update all installed packages
apt update refreshes the list of available packages, full-upgrade installs fresh versions of everything already in the system, and -y answers "yes" to every question so you do not have to confirm each step by hand. This takes anywhere from a few seconds to a couple of minutes.
32-bit Architecture Support
CS 1.6 is a 32-bit server, so on a 64-bit system you need i386 libraries. First allow the system to work with the 32-bit architecture, then refresh the package list once more so it can see the 32-bit versions:
dpkg --add-architecture i386 apt update
Installing Dependencies
Now the libraries themselves and a few utilities we will need along the way:
apt install -y lib32gcc-s1 lib32stdc++6 libc6-i386 wget tar screen
lib32gcc-s1,lib32stdc++6,libc6-i386- 32-bit libraries the server needs to runwget- downloads files from the networktar- unpacks archivesscreen- keeps the server running after you disconnect, used in the last step
Creating a Dedicated Linux User for the CS 1.6 Server
Working under root is not recommended. Root can do anything, including wiping the system by accident with a single typo. So I create a separate user, and that is who the server will live under. Let us call it cs16:
adduser cs16
The system will ask you to set a password, then it will ask for a name, phone number and other nonsense, those fields can be skipped by just pressing Enter. Confirm at the end.
Sudo Rights and Switching Over
Add the new user to the sudo group so it can run commands with administrator rights, then switch over to it:
usermod -aG sudo cs16 su - cs16
From here on every command runs as cs16. The prompt changes to something like cs16@xxx:~$. Just in case, refresh the package list under its name:
sudo apt update
HLDS or ReHLDS: Which Server Engine
A CS 1.6 server can run on two engines. HLDS, Half-Life Dedicated Server, is Valve's official program for GoldSrc games: it accepts connections, calculates physics, synchronises the game world and manages maps and rules. Its architecture is from the late 1990s, and after Valve wound down active development the bugs, limits and old technical decisions stayed in it.
ReHLDS, Reverse Engineered HLDS, is the same server side restored from the decompiled HLDS binary and then fixed and extended by the community. It is tied to the build it was restored from: the supported base is HLDS up to build 8684, which is why this guide installs the steam_legacy branch and not the current one.
| HLDS | ReHLDS |
|---|---|
| Original Valve binary, closed source | Engine restored from HLDS, open source |
| Bugs Valve no longer fixes | Dozens of fixes in network code, packet handling, memory management and server logic |
| Limited by its internal architecture | Added APIs for modifications, hooks, extended settings and raised limits |
| Can behave unstably under heavy load | Handles large numbers of players, bots and plugins better |
| Updated only when Valve decides to | Regularly updated and developed by the ReHLDS community |
This guide ends with a plain HLDS 8684 server that works on its own. Swapping the engine for ReHLDS, the build 8684 vs 10211 question, the Anniversary Update and the security side of it are in the ReHLDS guide.
Installing the CS 1.6 Server with SteamCMD
SteamCMD is Valve's official tool for downloading Steam game servers. Create a folder, download the archive, unpack it, run it - then four commands inside its console install the server itself.
Running SteamCMD
You are in the home folder of the new user, /home/cs16/. Create a separate folder for the SteamCMD client and its download cache and go into it:
mkdir ~/steamcmd && cd ~/steamcmd
Download the archive, unpack it and launch the Steam console script:
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz tar -xvzf steamcmd_linux.tar.gz ./steamcmd.sh
steamcmd.sh
On first launch SteamCMD will download the missing files and update itself. Wait until the Steam> prompt appears in the console, that means you can start entering commands.
Installing the CS 1.6 Server
Four commands in the SteamCMD console, then quit:
force_install_dir /home/cs16/cs16srv login anonymous app_set_config 90 mod cstrike app_update 90 -beta steam_legacy validate quit
force_install_dir- where the server goes. I install into cs16srv, you can use your own name, SteamCMD creates the folder itself.login anonymous- no Steam account is needed, the CS 1.6 server is available anonymously.app_set_config 90 mod cstrike- which mod to install, since HLDS AppID 90 holds four Half-Life series games.-
app_update 90 -beta steam_legacy validate- the download.90is the AppID of the Half-Life server,validatechecks the integrity of the files, and-beta steam_legacypicks the classic branch. The download takes a few minutes and ends with Success! App '90' fully installed.
Why steam_legacy and Not the Current Build
A plain app_update 90 validate installs build 10211 from October 8, 2024, the engine after the Anniversary Update. -beta steam_legacy installs build 8684 from August 3, 2020 - the last build ReHLDS, Metamod-R, AMX Mod X and the rest of the module stack run on. If you install the current build now, you will be reinstalling later. The full story is in the ReHLDS guide.
At this point your account has this structure:
- /home/cs16/steamcmd/ - SteamCMD installer files
- /home/cs16/cs16srv/ - game server files; the game itself is in cs16srv/cstrike/
First Run of the CS 1.6 Server
The server is installed. Go into its folder and run the hlds_run script with the launch parameters:
cd /home/cs16/cs16srv ./hlds_run -game cstrike +map de_dust2 +maxplayers 16 +port 27015
ls to confirm that the files were installed
-game cstrike- the mod;+map de_dust2- the map the server starts on;+maxplayers 16- the number of slots;+port 27015- the port the server accepts connections on.
On the first launch you may run into FATAL ERROR (shutting down): Unable to initialize Steam. The log says why:
dlopen failed trying to load: /home/cs16/.steam/sdk32/steamclient.so with error: cannot open shared object file: No such file or directory
The server needs the steamclient.so library to talk to Steam. It looks for it in ~/.steam/sdk32/, but right after installing through SteamCMD that folder does not exist yet, the file sits in the SteamCMD directory. The link is created on the first start, so press Ctrl+C and run the server again. The second time it comes up fine. If everything is in order, the console shows:
Connection to Steam servers successful. VAC secure mode is activated.
Check the server version with the version command:
Protocol version 48 Exe version 1.1.2.7/Stdio (cstrike) Exe build: 19:52:19 Aug 3 2020 (8684)
The server is up and anyone can join it by IP:27015. You can check its public status, players, cvars and detected software with my CS 1.6 Server Info tool.
Running the CS 1.6 Server in Screen
Right now the server lives exactly as long as your SSH connection is open. Close PuTTY or lose the connection and the server dies with the session. Screen solves this: it starts a window that lives on the server on its own, not tied to your SSH connection. The server keeps running after you disconnect, and you can come back to that window at any moment to look at the console, type commands, detach again and leave. We installed it with the dependencies; if you skipped that, sudo apt install screen.
- screen -S name
- Create a new named session
- screen -ls
- List all sessions
- screen -r name
- Attach to a session; screen -r -d name forces it if it is attached elsewhere
- Ctrl + A, D
- Detach, leaving the session running
- screen -S name -X quit
- Kill the session (stops the server)
Stop the test server with Ctrl+C, then create a session named cs16 and start the server in it right away:
screen -S cs16 ./hlds_run -game cstrike +map de_dust2 +maxplayers 16 +port 27015
You end up in the server console, same as with a normal launch. But now you can leave it with Ctrl+A, D and you are back in the ordinary terminal while the server keeps running. Check that the session is alive:
screen -ls
6398.cs16 (07/21/2029 11:59:57 PM) (Detached)
1 Socket in /run/screen/S-cs16.
screen -ls command confirms that the cs16 session is running and detached
Now you can safely close PuTTY, the server stays up. To get back into its console, connect over SSH and type screen -r cs16. Once the server appears in the Steam master list, you can find it in CS 1.6 Steam Server Stats: the tool checks servers every 10 minutes and builds a history of player activity, including 7-day and 30-day averages.
What Goes on Top of a Bare Server
What you have now is plain HLDS: it works, people can join, but there is no admin, no plugins and no way to change the game rules beyond server.cfg. The layer on top is a stack of modules, and one pulls in another. The server runs perfectly fine without ReUnion, only non-Steam clients cannot connect. Once you let them in, without ReVoice they cannot talk by voice to Steam players. And so on.
ReHLDS is the engine, everything else lives on top of it. Metamod-R attaches to the engine and acts as a loader: on its own it does nothing, but without it not a single module starts. Next comes AMX Mod X, technically also a Metamod module, but with its own platform for plugins. And at the bottom sit the .amxx plugins themselves.
| Module | Purpose | Priority |
|---|---|---|
| ReHLDS | Server core | High |
| Metamod-R | Module manager | High |
| AMX Mod X | Plugin manager | High |
| ReGameDLL_CS | CS 1.6 game library | Medium |
| ReAPI | Extended API for AMXX plugins | Medium |
| ReUnion | Client compatibility and authentication | Medium |
| ReVoice | Voice chat compatibility | Medium |
| ReSemiclip | Players passing through each other | Medium |
| ReChecker | Checking clients for cheats and mods | Low |
| FastDL | Fast download of maps and resources over http | Medium |
Each piece has its own guide. Go in this order, every one of them starts from the server you just built:
ReHLDS on Linux
The engine the whole server runs on: why build 8684, the install and rehlds.cfg.
open →
Metamod-R, AMX Mod X and Plugins
The loader and the plugin platform. Installing a plugin, why you compile .sma yourself, and what the compiler errors mean.
open →
ReGameDLL_CS, ReAPI, ReVoice, ReSemiclip
The modules most servers end up running: the game library, the extended API, voice chat and passing through teammates.
open →
ReUnion: non-Steam Clients
Letting non-Steam clients in, how they get a SteamID, and which authentication modes make sense.
open →
FastDL for a CS 1.6 Server
Maps, models and sounds download through the game port at a crawl. An http server next to the game fixes that.
open →
CS 1.6 ex_interp Settings
How interpolation works and best values.
open →Conclusion
You have a working CS 1.6 server: a rented VPS, a separate user, HLDS build 8684 from the steam_legacy branch, running inside screen and staying online around the clock. Anyone can connect to it by IP and play.
Two things are left outside this guide on purpose. The module stack - ReHLDS, Metamod-R, AMX Mod X and the rest - each has its own guide above, in the order they go in. And administration: how to make yourself an admin and manage the server. The classic route is the users.ini file and the AMX Mod X access flags. It works, but these days almost everyone goes through web admin panels - bans, statistics, players and settings in a browser instead of editing configs over SSH. That is a big topic with its own install process and its own pitfalls, and it deserves a separate write-up.
CS 1.6 Server FAQ
Do I need a Steam account or a paid license to run a CS 1.6 server?
No. The server files are downloaded through SteamCMD anonymously, with login anonymous. You do not need to own the game or log in with a real account to host a server.
Can players with a non-Steam client connect to my server?
Not by default. A clean server only accepts Steam clients. To let non-Steam clients in you install ReHLDS and the ReUnion module, and for them to talk by voice with Steam players you also need ReVoice. Both are covered in their own guides.
Why build 8684 and not the latest one?
Because ReHLDS and the whole module stack are only compatible with build 8684 and below. The current build 10211, released after the Anniversary Update, changed the engine internals and is not a valid base for them. That is why I pull the older build from the steam_legacy branch.
How many players and how much hardware do I really need?
One CPU core per server, since GoldSrc is single-threaded and only cares about the clock speed of a single core (3+ GHz is comfortable). 1 GB of RAM is enough for a plain server, 2 GB if you add an http server for FastDL and a database. That easily covers a full 32-slot server.
The server dies when I close PuTTY. What am I doing wrong?
You started it in the SSH session itself. Start it inside screen: screen -S cs16 ./hlds_run ..., then detach with Ctrl+A, D. The server keeps running, and screen -r cs16 brings its console back.
How do I update the server later?
Stop it, run SteamCMD again with the same four commands (force_install_dir, login anonymous, app_set_config, app_update 90 -beta steam_legacy validate) and start it again. Keep the -beta steam_legacy part, otherwise you get build 10211 and the module stack stops working.