This content is archived from old gaming web-sites. It remains here for posterity and is no longer updated.
So you want to run your own Counter-Strike server eh? It's not
that hard to be honest. Just make sure you have the requirements
for one. Each player consums bursting bandwidth of ~7K/sec. Most
will use 4K/sec until fire fights break out then it will go up.
This means if you want to run a 16 man server on the Internet you'll
need an upload speed of about 896Kbps. Normal modem users have ~33kbps
upsteam. Cable users: 128kbps, ADSL users: 256kbps.
As for hardware you want a 500MHz or faster CPU, anything less
will mean maps take too long to load. RAM depends on the operating
system. 256MB's is usually ok. If you are planning on using a dedicated
box for CS servers you should be able to get 4 CS servers running
perfectly on: 1GHz CPU, 512MB RAM, UDMA100 Hard Drives.
HLDS Setting up
HLDS or Half-Life Dedicated Server is the software that runs the
server. It's a console based application, meaning you can run it
as a Service on Win32 or use nohup on Linux. Download and install
the latest version of HLDS (old ones simply won't work online) along
with the latest version of Counter-Strike. I'll presume you have
installed a Win32 copy to C:\HLDS\ just to make this document easier
for me to write :) However you are planning to launch the server
you'll need to get the command line correct with the correct arguments
to start the server correctly. Use this:
C:\HLDS\hlds.exe -game cstrike +maxplayers 16 +map de_dust +exec
This will start the game and load Counter-Strike. It'll set the
maximum players to 16 and set de_dust as the first map (I generally
choose this as it's one of the quickest to load, and is popular
so people will come back after a crash). The last part executes
a console script called start.cfg. This is useful for any commands
you want to be executed on server start up, but not done every time
the map is changed. Such as server passwords, you may want to have
one on, but then take it off. If you have it in the server.cfg it
will put it back on every time the map changes.
This is the configuration file for your server (in your cstrike
directory), and will be executed *every* time the map changes. Put
permanent settings here, and one-off settings in start.cfg. Here
is a sample server.cfg:
Before I run through the config, this is a nice new bit for Valve's new world of
servers. Which all their games
are now supporting, the plan is to turn of WON. Now setting up a Steam server isn't as easy,
naturally it's supposed
to be easier, but it's not due to poor design at Valve. I
highly suggest you download the 500MB full install of the original Steam servers and then download
the updates from bit-torrent (Valve release on bit-torrent as they are aware that their network
cannot support themselves). This is the best method for most server admins as the Steam network
coughs up data at about 45K/Sec tops, which is no good for us on backbones and usually download
Once you have downloaded and figured out how to extract the files you will need to run the Steam
updater. Do this (we are now presuming you are runnign Linux):
cd <HLDS install dir>
./steam -create <email> <password> <question> <answer>
./steam -update <game> <HLDS install dir> <email> <password> Y
[^ do that line twice]
./hlds_run -autoupdate -game cstrike blah blah blah
Of course, some people are sitll using Windows for servers (fools) so what we do for them is
the exact same as above but in a command prompt window. Just change the './steam' bit to
Take note of your e-mail and password you created an account with, as Steam will
it, even if you ask it to remember it (the Y one the end of the update line asks it to save it).
// My Config
with // is a comment and won't be executed.
- sponsored by aligrant.com"
||This is the server's
||Makes the server reload this file
on every map change.
||This loads any previous
||Turns off automatic
aiming for snipers.
||Turns off cheats
(such as unlimited money).
||Sets forward speed
||Allows people to
upload their logos.
||Allows people to
download logos and maps.
from pausing the game.
each spray of a players logo.
||Turns on logging.
||Logs each bullet
||Turns on fall damage
||Allows players to
use the Torch.
||Will make footsteps
for players in KiloByte per second.
||Minimum rate, don't set too low
overwise 56K'ers can't play.
||Remote control password.
||Tells the server
if it should announce itself to the Internet as there.
||Turns on friendly
||Length of the map
||Length of each round
||Minutes people can
buy for (90 seconds)
||Auto balances the
||Maximum extra of
players on a team.
That's about it. Your server should now be ready to use. You can
edit your mapcycle.txt to adjust in which order new maps are loaded.
To control your server remotely use "rcon". You use this
from your Half-Life console. Connect to your server in CS and type
this in your console:
Make sure your password matches the one in your server.cfg. If
you don't specify one then you won't be able to control it remotely.
You can now issue all console commands to the server the same way
as if you were looking at it, but just prefix rcon to the command.
So, to list the details of all the players on the server you could
Automated Startup and recovery
Valve made the hlds_run script, what this does is create a watcher process that monitors
the HLDS process, and restarts it if it crashes. The down-side to this script is
that it doesn't help when an admin types "rcon quit", as that is not seen as a crash.
In order to combat this I modified the script slightly by taking out a few lines. I also
added in an error check to stop the script if it's run from 'root' (which is just a very
bad, and unsafe idea).
You can download the modified script from
. Just over-write your current one (NB: this is only applicable to Linux users, Win32 should
set HLDS up as a service (see Win2K resource kit)).
The other thing to save on time is to have the games start automatically when the server is
switched on. To do this you can create a simple shell script that will start all your games. Such as:
nohup /home/servers/hlds_l/hlds_run -game cstrike +maxplayers 12 +map cs_docks > /var/log/hlds_l.log &
You will need to make this file executable (chmod 755 ). Then you will need to create a link to it
from the system start up (for this you will need root access to create a startup file). To save the server
from trying to start the games as root you should use the "su" command to get around it.
S99hlds_l shell script:
- Login as 'root'
- Navigate to /etc/rc.d/rc3.d/
- Create a shell script called S99hlds_l
- Enter the below into the new file
- Make the new file executable (chmod 755)
su - -c <username> <startupscript>