Setting up a Day of Defeat Source/Counter Strike Source dedicated server on Linux

Introduction
Even though there is some information on how to setup a dedicated server source server on a Linux based system the articles are often old or to generic for my liking. I have written this article to help other people setup a Day of Defeat source (DOD:S) server on a Ubuntu 8.04.1 system.

Downloading the software from steampowered.com
The first thing to do is to download the Source Dedicated Server from steampowered. So on the linux server I create a folder on the dod user account and download the binary with the following commands.

dod@dirac:~$ mkdir srcds_l
dod@dirac:~$ cd srcds_l
dod@dirac:~/srcd_l$ wget http://www.steampowered.com/download/hldsupdatetool.bin

The next thing to do is to make the file executable and run the program.

dod@dirac:~/srcd_l$ chmod +x hldsupdatetool.bin
dod@dirac:~/srcd_l$ ./hldsupdatetool.bin
dod@dirac:~/srcd_l$ ./steam

Now the basic part is installed and need to download and install DOD:S.

dod@dirac:~/srcd_l$ ./steam -command update -game dods -dir .

If I wanted something like CS:S instead I would replace dods with “Counter-Strike Source”.

Startup script
In stead of issuing a series of command every time I wish to start the server I run the following shell script.

#!/bin/bash
 
cd srcds_l
./steam -command update -game dods -dir . 
# This updates dods file to latests version before launching the game.  
 
cd orangebox
./srcds_run -console -game dod +map dod_kalt +maxplayers 24 +ip 192.168.1.153 -port 27015 -autoupdate -pingboost 1 -debug 
# This starts the server and sets some obvious settings. Notice the strange syntax with a plus in front of ip but a minus in front of port.

If the server is behind a router as mine is you need to forward some ports to the server:

  • UDP 1200 (Friends Network)
  • UDP 27000 to 27015 (Gameport)
  • UDP 27020
  • TCP 27030 to 27039
  • TCP 27015 (SRCDS Rcon port)

server.cfg
The next logical thing to do is to edit the server.cfg. It should be created in
srcds_l/orangebox/dod/cfg/
Most of these entrys are self explanatory.

hostname "1337 |-|4xor DODS server"
sv_contact "1337@foobar.com"
rcon_password "verysecret"
//sv_password "somewhat secret"
 
//SETTINGS
sv_visiblemaxplayers 24 // Overrides the max players reported to prospective clients
sv_lan 0  // This is not a Lan server 
sv_secure 1 // No cheats!
sv_cheats 1 // No cheats
sv_region 3 // Region 3 is europe
sv_unlag 1
sv_rcon_minfailures 2
sv_rcon_maxfailures 3
sv_rcon_banpenalty 0 (permanent ban}
sv_rcon_minfailuretime 30
sv_logbans 1
sv_filterban 1
log "on" // creates a logfile
sv_logfile 1
sv_log_onefile 1 //only one log file 
 
sv_allowDownload "1" // enables or disables direct client downloads from server.
sv_dl_maxRate "250000" // sets the max rate in bytes/s for direct client downloads. 250000 B/S = 244.KB/s
net_maxfilesize 500 // The maximal filesize in mb for the client to download from the server.
 
mp_friendlyfire 1 
mp_timelimit 30 // 30 minute timelimit
mp_autokick 7 // Kick idle players
dod_bonusround 0 // Winning team cant kill losers
 
//mapcyclefile "mapcycle.txt"

Adding more maps
To install a map such as dod_arnhem the first thing to do is to download the zip/rar file from some webserver such as
DOD:S maps [fpsbanana.com]
and then unpack the bsp files in to the folder /srcds_l/orangebox/dod/maps/

dod@dirac:~/srcds_l/orangebox/dod/maps$ unrar -e dod_strand.rar

If the zip files contains new sounds or models these files should be moved to the appropriate path in /srcds_l/orangebox/dod/.

Running the server
When running the game, one can connect to the server and use rcon to administer the server. Once connected to the server start the in-game console and the following to connect.

rcon_password "verysecret"

I should then be logged in a be able to do all sorts of nice things on the server. Every command should start with “rcon” when working on the server.

  • rcon say [text]
    Say something in-game as Console: [text]
  • rcon changelevel [map]
    Change the level of play (Example: dod_palermo)
  • rcon stats
    This will show a table with CPU usage and stuff on the server.
  • rcon restartgame [x]
    This will restart the game (NOT the server) in seconds.
  • rcon quit
    This terminates the server.
  • rcon kickid [number]
    Kick someone from the game, using the UserID or SteamID.
  • rcon users
    Show user info for players on server.
  • rcon banid [x] [y] kick
    Ban [x] in minutes (0=permanent) [y] User or SteamID.
  • rcon addip [x] [z] kick
    Ban by IP [x] same as above [z] IP-address of player.
  • rcon removeid [p]
    Remove ban for [p] by SteamID.
  • rcon removeip [q]
    Remove ban for [q] by IP-address.
  • rcon writeid
    Saves all the banned SteamID’s.
  • rcon writeip
    Saves all the banned IP-addresses.

If you don’t want to run your own server, you could always rent game servers from a host that specialize in providing DOD or CSS servers.

Sources
Source Dedicated Server Guide [planethalflife.gamespy.com]
Install: Linux (Rev. 2) [srcds.com].
www.srcds.com
list.valvesoftware.com

Only registered users can comment.

  1. Pingback: LinuxIN.dk
  2. I am running the server on a Thinkpad T40 with Ubuntu 8.04.1 LTS. It has 768 Mb ram and Pentium M 1.5 GHz CPU. With 12 players on the server the CPU usage is about 65%. The net traffic was quite steady 55 kb/s up and 120 kb/s down. So I would say that the hardware demands are quite low but the net demands are somewhat more demanding. 🙂

  3. I have already written this somewhat in the comments. I do not know the exact numbers but at least it is possible with my meager setup: “I am running the server on a Thinkpad T40 with Ubuntu 8.04.1 LTS. It has 768 Mb ram and Pentium M 1.5 GHz CPU. With 12 players on the server the CPU usage is about 65%. The net traffic was quite steady 55 kb/s up and 120 kb/s down.”

  4. hi
    how to crate sniper server i make onli sniper clas and no limit of sniper clas but i want to ad M1 Carbine to secondary weapon and granades and expand magazin help sambady 🙂

  5. Hi Laurynas. I haven’t tried that out, so I can’t really guide you. Why just not start a LAN game within the game on the computer you are playing from? Merry christmas btw. 🙂

    Kind regards
    Thomas Jansson

  6. Hey, You have done an admirable job. I should definitely reddit it and I’ll recommend to my friends. Almost certainly they will be benefited from this website.

  7. Hi, thx very much for this interesting guide. It’y very helpful and easy to understand.

Leave a Reply