Promoveaza serverul
67 lines 6.1 KiB Markdown Source Rendered Raw Permalink History
---
title: "Install a CS 1.6 Server on Debian 12"
excerpt: "A step-by-step CS 1.6 dedicated server install on Debian 12 (bookworm): enabling i386, installing the 32-bit libraries HLDS needs, downloading the game files with SteamCMD, and first launch."
category: "installation"
tags: "debian, linux"
image: ""
read_time: "8 min read"
---
<p>Debian 12 "bookworm" is a clean, stable base for a CS 1.6 server, but HLDS is a 32-bit binary, so the one thing that trips people up on a fresh 64-bit Debian is the missing i386 libraries. This walks through the whole install: enable multi-arch, install the 32-bit runtime, pull the game files with SteamCMD, and launch under a non-root user.</p>

<h2>1. Update and create a service user</h2>
<p>Never run a game server as root. As root, update the system and make a dedicated user:</p>
<pre>apt update &amp;&amp; apt upgrade -y
adduser --disabled-password --gecos "" csserver</pre>
<p>Everything from here on runs as <code>csserver</code>. Switch to it:</p>
<pre>su - csserver</pre>

<h2>2. Enable the i386 architecture</h2>
<p>HLDS and SteamCMD are 32-bit. On 64-bit Debian you must add the i386 architecture before the libraries are installable. As root:</p>
<pre>dpkg --add-architecture i386
apt update</pre>
<p>Skip this and the 32-bit packages in the next step simply will not be found, and HLDS later fails to start with a loader error about a missing library.</p>

<h2>3. Install the 32-bit libraries and tools</h2>
<p>As root, install the runtime HLDS needs plus the tools to fetch it:</p>
<pre>apt install -y lib32gcc-s1 lib32stdc++6 ca-certificates curl tar</pre>
<p><code>lib32gcc-s1</code> and <code>lib32stdc++6</code> are the 32-bit C/C++ runtimes the engine links against &mdash; the two libraries whose absence causes the classic <em>error while loading shared libraries</em> on first launch. <code>ca-certificates</code> lets SteamCMD validate its TLS connection.</p>

<h2>4. Install SteamCMD</h2>
<p>Back as <code>csserver</code>, download and unpack SteamCMD into its own folder:</p>
<pre>mkdir -p ~/steamcmd &amp;&amp; cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -</pre>
<p>The general SteamCMD setup, including the Valve-hosted download, is covered in <a href="/tutorials/install-steamcmd-linux">installing SteamCMD on Linux</a> if you want the detail. Run it once to let it self-update:</p>
<pre>./steamcmd.sh +quit</pre>

<h2>5. Download the CS 1.6 server files</h2>
<p>The CS 1.6 dedicated server is Steam app <code>90</code>. Because app 90 is an old HLDS package, set its mod config to <code>cstrike</code> and validate. Run SteamCMD with an anonymous login:</p>
<pre>./steamcmd.sh +force_install_dir ~/hlds \
  +login anonymous \
  +app_set_config 90 mod cstrike \
  +app_update 90 validate \
  +quit</pre>
<p>App 90 is notorious for needing a few retries &mdash; if it stops partway, run the exact same command again and it resumes. Keep going until it reports the install as fully up to date. For the safety considerations around where server files come from, see <a href="/tutorials/download-cs16-server-files-safely">downloading server files safely</a>.</p>

<h2>6. First launch</h2>
<p>Change into the install and start HLDS with a sane command line:</p>
<pre>cd ~/hlds
./hlds_run -game cstrike +ip 0.0.0.0 -port 27015 \
  +map de_dust2 +maxplayers 20 +sv_lan 0</pre>
<p><code>sv_lan 0</code> is required to reach the master list; the default <a href="/tutorials/change-cs16-server-port">port 27015</a> is UDP. If it boots to the console and prints the map loading, the install works. From here, consider swapping HLDS for <a href="/tutorials/install-rehlds-on-linux">ReHLDS</a> for performance, and set up a <a href="/tutorials/hlds-systemd-service">systemd service</a> so it survives reboots.</p>

<h2>7. Open the firewall and lock down access</h2>
<p>A running server that nobody can reach is a firewall problem. Debian 12 ships without a running firewall by default, but a VPS provider often adds one. If you use <code>ufw</code>, allow the game port as UDP:</p>
<pre>ufw allow 27015/udp</pre>
<p>CS 1.6 is UDP-only, so a TCP rule passes nothing &mdash; a frequent cause of "the server runs but the browser never sees it." Set a strong <code>rcon_password</code> in <a href="/tutorials/setup-server-cfg-cs16">server.cfg</a> before you expose the box, because an open RCON port on a public IP is found within hours. The full port list, including the master-server ports, is in <a href="/tutorials/cs16-server-firewall-ports">the firewall ports guide</a>.</p>

<h2>Common errors</h2>
<ul>
<li><strong><code>error while loading shared libraries: libstdc++.so.6</code></strong> &mdash; the 32-bit libraries are missing. Enable i386 and install <code>lib32gcc-s1</code> and <code>lib32stdc++6</code>.</li>
<li><strong>SteamCMD: <code>Failed to install app '90' (Missing file permissions)</code></strong> &mdash; you ran it as root earlier and the files are root-owned. Fix ownership: <code>chown -R csserver:csserver ~/hlds</code>.</li>
<li><strong>app_update 90 stalls or errors partway</strong> &mdash; a known app-90 quirk. Re-run the identical command; it resumes.</li>
<li><strong>Server starts but is not in the browser</strong> &mdash; <code>sv_lan 1</code>, or UDP 27015 is closed. Set <code>sv_lan 0</code> and open the port; see <a href="/tutorials/cs16-server-firewall-ports">firewall ports</a> and <a href="/tutorials/fix-server-not-in-master-list">server not in master list</a>.</li>
<li><strong><code>hlds_run: not found</code> even though it exists</strong> &mdash; a 32-bit loader is missing, or you are in the wrong directory. Confirm the i386 libs and run from <code>~/hlds</code>.</li>
</ul>

<h2>Verification</h2>
<p>With the server running, from another machine open the console in CS and <code>connect &lt;server-ip&gt;:27015</code>. You should join and see <code>de_dust2</code>. On the server, <code>status</code> lists you as a player. Then confirm it appears in the internet server browser after a minute &mdash; if you can join from outside and it lists publicly, the Debian 12 install is complete and you can move on to a systemd service and ReHLDS.</p>