Counter Strike 1.6 on a Linux Server

Abstract:

This article will describe how to install a CS 1.6 server on a linux server. This guide will only explain how to install a default configuration of the server and will not delve deep into configuring the server.

Install And Update Steam

To get steam you need to download the hldsupdatetool. This is the official binary, that contains the automatically-updating steam executable. The steam executable itself can be used to install all dedicated game servers, that use the steam platform.

First of all you will need a directory where to put all the server files. Type the following on the server:

mkdir hlds

cd hlds

Then you need to download the executable containing the steam binary. To download the file either use the link below to download it to your local machine,

Steam Executable

or type

wget http://torqzone.com/wp-content/uploads/2008/02/hldsupdatetool.bin

on the server to download directly the the server.

After the download you need to make this file executable, so you can work with it. Type

chmod +x hldsupdatetool.bin

This will present you with a license and you will have to agree with it to continue. If it presents you with an error like this one: ‘uncompress: command not found’

Type this (you have to be root):

ln -s /bin/gunzip /bin/uncompress

After that try executing the hldsupdatetool.bin once more and it should work.

After steam executable is extracted we first need to update it. Execute:

./steam -command update -game cstrike -dir .

to update steam

Installing the game

To begin the game install you need to repeat the previous command:

./steam -command update -game cstrike -dir .

Please note, that due to the download it might take some time for all the operations to be completed. On Torqhost servers it usually takes from 5 minutes for those files to be downloaded. You will see a message saying “HLDS installation up to date” after the install process exists. This shows, that the server is ready for startup.

Starting the server

There are several options you need to know before you start the server. Make sure you understand them before you start any server because it make cause problems if you set them incorrectly.

-autoupdate

This options ensures the server is up to date and generally it should always be used to make sure you installation is up to date.

-game

This is the game you wisth to run on the server. In our case it will be cstrike (because Counter strike source is part of the cstrike series).

+maxplayers

The maximum amount of slots allowed on the server. This is a very important if you are running in a shared environment and are selling servers.

+map

The starting map for the server.

-port

The port number the server will run on. Default is 27015, but if you are running many servers on one machine you will need to change it. Note, that you cannot run multiple servers on a single port.

-ip

The IP address to use. If you want to use an alternate address that comes with the server you can do it by using this switch.

To start the game server type

./hlds_run -game cstrike -autoupdate +maxplayers 20 +map de_dust2 > hlds.log 2>&1 &

Attach other parameters as necessary. This will allow you to close you command line window, but the server will continue running. It basically detaches the server process from any window.

All server executable output will go into the hlds.log file located in the same folder. To view it use

tail hlds.log

or

tail -f hlds.log to view output in real time.

One Response to “Counter Strike 1.6 on a Linux Server”

  1. Dana RUSSIAN FEDERATION Says:

    Your blog is getting better and better! Previous posts were good, but this one is just FABULOUS.

Leave a Reply