How to install Counter-Strike 1.6 Server

You will need access as root or super user to a GNU/Linux Machine, or have the system admin install screen and wget for you.

In this tutorial, I’m using a Red-Hat based distribution, named CentOS, version 6.3 – 64 bit

These are the steps needed to install a Counter-Strike 1.6 Server:

Install screen and wget

[root@howto ~]# yum -y install screen wget

Create a symlink for uncompress (this is needed by hldsupdatetool.bin)

[root@howto ~]# ln -s /usr/bin/gunzip /usr/bin/uncompress

Make the server start on system boot

[root@howto ~]# echo "su - hlds -c "/home/hlds/start_hlds"" >> /etc/rc.local

Add user “hlds” and set a password for it

[root@howto ~]# useradd hlds
[root@howto ~]# passwd hlds

Switch to hlds user and check current directory afterwards

[root@howto ~]#su - hlds
[hlds@howto ~]$ pwd
/home/hlds

Download hldsupdatetool.bin from steampowered.com

[hlds@howto ~]$ wget http://www.steampowered.com/download/hldsupdatetool.bin

Make the file executable and run it

This will extract the steam tools needed to download and install the server

[hlds@howto ~]$ chmod +x hldsupdatetool.bin
[hlds@howto ~]$ ./hldsupdatetool.bin
Enter 'yes' to accept this agreement, 'no' to decline:
Enter 'yes' to accept this agreement, 'no' to decline: yes
extracting steam.tar.Z...done

You may list the files and see the newly extracted files

[hlds@howto ~]$ ls -l
total 11076
-rwxrwxr-x 1 hlds hlds 3513408 Sep  2  2005 hldsupdatetool.bin
-rw-r--r-- 1 hlds hlds    3413 Apr  7  2005 readme.txt
-rwxr-xr-x 1 hlds hlds 7822833 Apr  7  2005 steam

Update Valve

[hlds@howto ~]$ ./steam -command update -game valve -dir .
 0:01     Fetching exclude list
 0:01     Calculating download size
 0:02     No files will be downloaded
 0:02 [80.239.194.134:27030] Disconnecting
 HLDS installation up to date

Update Counter Strike

The command needs to be ran 3 times, each time it performs a different operation, just follow the instructions on screen

[hlds@howto ~]$ ./steam -command update -game cstrike -dir .
Checking bootstrapper version ...
Getting version 45 of Steam HLDS Update Tool
Downloading. . . . . . . . . . . .
Steam Linux Client updated, please retry the command
[hlds@howto ~]$ ./steam -command update -game cstrike -dir .
Checking bootstrapper version ...
Getting version 45 of Steam HLDS Update Tool
Downloading. . . . . . . . . . . .Steam Linux Client updated, please retry the command
CAsyncIOManager: 0 threads terminating.  0 reads, 0 writes, 0 deferrals.
CAsyncIOManager: 21 single object sleeps, 0 multi object sleeps
CAsyncIOManager: 0 single object alertable sleeps, 0 multi object alertable sleeps
[hlds@howto ~]$ ./steam -command update -game cstrike -dir .
... 99.06%  downloading ./valve/valve.rc
99.06%  downloading ./valve/valvecomm.lst
100.00% downloading ./valve/xeno.wad

HLDS installation up to date
CAsyncIOManager: 0 threads terminating.  0 reads, 0 writes, 0 deferrals.
CAsyncIOManager: 74 single object sleeps, 0 multi object sleeps
CAsyncIOManager: 0 single object alertable sleeps, 0 multi object alertable sleeps

Create the startup script and make it executable

Make sure you edit the ip, port, cpu, number of players, sys_ticrate, etc acording to your needs

[hlds@howto ~]$ echo '#!/bin/bash' > /home/hlds/start_hlds
[hlds@howto ~]$ echo "screen -A -mdLS hlds_cstrike -c /home/hlds/.screenrc ./hlds_run -binary ./hlds_i686 -console -debug -game cstrike -port 27015 -pingboost 2 +sys_ticrate 1000 +heapsize 1048576 +sv_maxupdaterate 100 +secure +sport 27014 +ip <code>85.25.243.169</code> +maxplayers 32 +map cs_assault -pidfile hlds.pid +cpu 8 -autoupdate" >> /home/hlds/start_hlds
[hlds@howto ~]$ chmod +x /home/hlds/start_hlds

Make the last adjustments before starting the server

[hlds@howto ~]$ echo "logfile /home/hlds/hlds_screen.log" > /home/hlds/.screenrc
[hlds@howto ~]$ touch /home/hlds/cstrike/listip.cfg
[hlds@howto ~]$ touch /home/hlds/cstrike/banned.cfg
[hlds@howto ~]$ mkdir -p /home/hlds/SAVE
[hlds@howto ~]$ mkdir -p /home/hlds/valve/SAVE
[hlds@howto ~]$ mkdir -p /home/hlds/platform/SAVE

Start the server and check if it is running

[hlds@howto ~]$ ./start_hlds
[hlds@howto ~]$ netstat -tuanlp |grep hlds
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
udp        0      0 85.25.243.169:26900         0.0.0.0:*                               4079/./hlds_i686
udp        0      0 85.25.243.169:27015         0.0.0.0:*                               4079/./hlds_i686

If you want to gain access to console, enter the screen session by issueing

[hlds@howto ~]$ screen -x hlds_cstrike

Exit the screen by pressing CTRL + a + d

If you just want to check the logs in real time use

[hlds@puck233 ~]$ tail -f hlds_screen.log

Exit by pressing CTRL + c

You may now connect to the server with your Counter Strike 1.6 Client

Enjoy your play!

6 thoughts on “How to install Counter-Strike 1.6 Server”

  1. Hi, I have a CentOS 6.3 with minimal desktop installation.
    I do some steps, but, when I run this command:

    [hlds@howto ~]$ ./hldsupdatetool.bin

    I have this error:

    -bash: ./hldsupdatetool.bin: /lib/ld-linux.so.2: bad ELF interpreter: File or directory not found.

    What can I do now? :/
    Please, help me!

    Reply
  2. Hey, thx for this good wiki.

    How can i restart the cs server ? or stop it ?
    its possible to do a auto restart each day ?

    thx a lot 🙂

    Reply
    • Hi, you may use a cron job to run daily and do what you want (just google for adding cron jobs). The easy way is to run the kill command on the process ID and then run again the start command or you could create an init script.

      Reply

Leave a Reply to Cristian Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.