Launching and Configuring Counter-Strike 1.6 Server on Linux

I will describe the installation and configuration of the Counter-Strike 1.6 game server.
On the test I will use Linux Ubuntu Server 18.04.

Create a directory, go to it and download the archive with installation files from the official website:

mkdir ~/SteamCMD
cd ~/SteamCMD
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz

Unpack the downloaded archive, delete it and make the installation script executable:

tar xfz steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz
chmod +x steamcmd.sh

Install the necessary libraries so that you can run 32-bit applications:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install lib32gcc1

Run the installation script:

./steamcmd.sh

Log in anonymously on the official server:

login anonymous

You may have to log in using your Steam account username and password:

login USERNAME

After entering the command, you must enter the password, wait, and you may also need to enter the Steam Guard code that will come by email.

Specify the directory for the downloaded files:

force_install_dir ../hlds

We execute the command to start downloading files (two times, since the first time the process is interrupted):

app_update 90 validate

At the end we will see the message:

Success! App ’90’ fully installed.

Exit the command line installation script:

quit

Create the necessary directories and files:

mkdir ~/.steam
ln -s ~/SteamCMD/linux32 ~/.steam/sdk32
touch ~/hlds/cstrike/listip.cfg
touch ~/hlds/cstrike/banned.cfg

Go to the directory with the downloaded files and try to run the Counter-Strike 1.6 server for the test:

cd ~/hlds
./hlds_run -game cstrike +ip 0.0.0.0 +maxplayers 12 +map de_dust2

If everything is ok, interrupt the server by typing quit or pressing CTRL+C.
Install Screen so that you can start the server in the background and exit Linux:

sudo apt-get install sudo screen

Run a new Screen session and start the server (where 192.168.1.50 is your dedicated IP that is visible from the Internet):

screen -a
cd ~/hlds
./hlds_run -game cstrike -console +ip 192.168.1.50 +maxplayers 32 +map de_dust2 -secure -sv_lan 0 -autoupdate -port 27015

Press Ctrl+a and immediately z to disconnect from the session and leave it running as a background process.
In the future, to return, let’s see the list of running sessions and connect to the desired one:

screen -ls
screen -r NAME

I described in more detail how to use Screen in this article – How to install and use Screen
See my other articles in the category – Counter-Strike

Join the Conversation

3 Comments

Leave a Reply

  1. Thank you for this tutorial. It’s the only one that worked flawlessly

  2. Hi there

    This is the response as run the server:

    “`
    Auto-restarting the server on crash
    Could not locate steam binary:steamcmd/steamcmd.sh, ignoring.

    Console initialized.
    Using breakpad crash handler
    Setting breakpad minidump AppID = 10
    Forcing breakpad minidump interfaces to load
    Looking up breakpad interfaces from steamclient
    Calling BreakpadMiniDumpSystemInit
    Protocol version 48
    Exe version 1.1.2.7/Stdio (cstrike)
    Exe build: 15:16:04 Jul 24 2019 (8308)
    STEAM Auth Server
    Server IP address 159.69.185.191:27016
    scandir failed:/root/hlds/./cstrike/SAVE
    [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
    CAppInfoCacheReadFromDiskThread took 17 milliseconds to initialize
    CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
    Looking up breakpad interfaces from steamclient
    Calling BreakpadMiniDumpSystemInit

    Connection to Steam servers successful.
    VAC secure mode is activated.

    “`

    But I’m constantly getting this error when I try to connect to server:

    “`

    This server accepts only legit clients – go an buy the game at Steam URL error 10.
    “`

    I have logged in with my steam account successfully with command:
    login MY USERNAME
    password: MY Password

    CS 1.6 Protocol 48 Full

    Do you know maybe how can I fix this.

    Thank you in advance fir the answer.