Counter-Strike Source

Here you'll get instructions of how to install a linux dedicated Counter-Strike server.

Look at our update for Half Life Deathmatch command!

Counter-Strike Source needs glibc 2.3.2 or later!

My setup
Games installation directory: /usr/local/games
Games user: games
Games group: games

Installation of Steam

Create a seperate steam directory
$ mkdir steam
Getting the files
$ wget ftp://hlserver:hlserver@ftp.valvesoftware.com/linux/hldsupdatetool.bin
Make the update tool executable
$ chmod +x ./hldsupdatetool.bin
Execute the update tool
$ ./hldsupdatetool.bin

Create a seperate steam account for admin purposes

Create a seperate steam account for your server besides your own account to play the Steam games. This is merely a hint, not a rule.

Creating a steam account
$ ./steam -create <email@address> <password> <hint> <answer>
$ ./steam -create gamesadmin@dragonbe.be complexPWD "I play games on" "Linux"

If you get an error AuthenticationServerRSAPublicKey failed signature verifcation, then you still have old settings recordes somewhere. Thes e are the steps to make it work again:

Go to your main games installation directory
$ cd /usr/local/games
$ ls -al
Look for the directory .steam (a hidden directory) and remove ClientRegistry.blob
$ rm .steam/ClientRegistry.blob

Installation of Counter-Strike Source Server

Installation
$ ./steam -command update -game "Counter-Strike Source" -dir /usr/local/games/srcds_l -username XXXXXX -password XXXXXX -remember_password

Configuring the server

Before you launch your newly downloaded server, you have to create a server.cfg file and you should modify the motd.txt file to welcome gamers at your server.

Move into your Counter-Strike source directory
$ cd /usr/local/games/srcds_l
Editing your server.cfg file
$ vi cstrike/server.cfg

The settings defined here are just for my setup. I show this configuration as an example, but you're free to modify the contents any way you want to.

// Logging
log 1

// Server Info
hostname "DragonBe's CS Source"
sv_contact admin@dragonbe.be
sv_region 3

// CS Specific Cvars
mp_autokick 1
mp_autoteambalance 1
mp_buytime 30
mp_c4timer 40
mp_decals 200
mp_flashlight 1
mp_forcecamera 0
mp_freezetime 6
mp_friendlyfire 1
mp_hostagepenalty 5
mp_limitteams 1
mp_roundtime 3
mp_spawnprotectiontime 5
mp_startmoney 800
mp_timelimit 25
mp_tkpunish 1

// General HL Cvars
sv_allowdownload 1
sv_allowupload 1
sv_footsteps 1
sv_maxrate 20000
sv_minrate 2000
sv_maxspeed 320
sv_specnoclip 0
sv_voiceenable 1
Edit your motd.txt (Message of the day)
$ vi motd.txt

Starting the Counter-Strike Source server

$ ./srcds_run -console -game cstrike +map de_dust +maxplayers 16 -port 27015 -pingboost 3 -autoupdate

Starting the Half Life Deathmatch server

Downloading the new Steam updates

$ cd /usr/local/games/steam/hlds_l
$ ./steam -command update -game "hl2mp" -username <username> -password <password> -remember_password
$ cd /usr/local/games/srcds_l
$ ./srcds_run -console -game hl2mp +map dm_lockdown +maxplayers 14 -port 27016 -pingboost 3 -autoupdate

Scripts

You can also use this script to run the server (this requires "screen").

#!/bin/sh

# define your port and ip here
IP=xxx.xxx.xxx.xxx
PORT=27015

echo "Starting Counter-Strike Source Server"
sleep 1
screen -A -m -d -S css-server ./srcds_run -console -game cstrike +map de_dust 
 +maxplayers 12 -autoupdate -ip $IP -port $PORT

Firewall port settings

Steam ports
UDP 1200 (used for friends service)
UDP 27000 to 27015 inclusive
TCP 27030 to 27039 inclusive
Computers running Dedicated Servers need these ports open
UDP: 27015 and 27020 (default HLDS, SRCDS and HLTV port)
TCP: 27015 (SRCDS Rcon port)