For a while now Valve through Steam have had a dedicated server for Linux from which you can launch your multiplayer fragfests. I’ve recently started messing about with it and I’ve gotten Counter Strike, Counter Strike Source and Half Life multiplayer to launch off of it. I’m still mucking about with server settings and finding statistics for it however I did not find a ton of documentation on this through Google so I decided to put up my notes here. This will get you running and give some basic idea on how to set up a dedicated server. If you’ve got pointers, corrections or advice, please post them in the comments and I’ll update this article as we slog through this mess.
A note: I say Ubuntu in the title because that’s what I’m running and that’s where I wrote this how to article. It is most likely applicable to any Debian system and probably good for just about any other flavor out there.
Now, we begin!
First thing you’ll need is an intimate knowledge of how your Linux kernel is programed, along with a decent working knowledge of physics program for modern GPUs. Nah, just kidding. You’ll need a terminal session. Go to Applications-> Accessories-> Terminal and lets get this show on the road.
In your terminal session, we’re going to create a directory for your Steam dedicated servers to live. Let’s call it ’steam’.
sudo mkdir /steam
Hey, we’re on our way! No lets head into the directory we just created.
cd /steam
Once there, we’ll need to download a .bin file called hldsupdatetool.bin, like so:
sudo wget http://storefront.steampowered.com/download/hldsupdatetool.bin
That will take but a few seconds, unless you’re on dial up in which case you probably shouldn’t be running a dedicated server anyway. Once that’s there, let’s run it.
chmod +x hldsupdatetool.bin
sudo ./hldsupdatetool.bin
Now that we’ve gotten the half life server update stuff out of the way, we’ll run Steam for Linux for the first time so it can update itself.
sudo ./steam
Let that do it’s thing, it could take a minute or two. Once that finishes, you’ll have to decide on what game(s) you want to host and then tell Steam to go get the dedicated server. The command looks like this:
sudo ./steam -command update -game “SOMEGAME” -dir .
You’ll want to substitute SOMEGAME with one of the following options (keeping the quotes) cstrike, dmc, dod, ricochet, tfc, valve, Counter-Strike Source or hl2mp. The two that I’ve messed with are Half-Life 2 Multiplayer (hlf2mp) and Counter Strike Source. So to set up Counter Strike Source, do this:
./steam -command update -game “Counter-Strike Source” -dir .
That tells Steam to update the game (in this case, install it too) in to the local (.) directory.
Once you’ve downloaded a particular game you want to host, you’re going to want to change some directory permissions, like so:
sudo chmod -R 755 steam
Now that you’ve gotten the game downloaded, you launch a dedicated server like so:
./srcds_run -game cstrike +maxplayers 16 -autoupdate
That will launch Counter Strike Source, set the max players to 16 and update as necessary. You can also specifiy a map, located in the cstrike/maps directory by adding -map de_mapname. Leave off the file extension when you do this. To see all of the maps, do this from the steam directory.
cd cstrike/maps
ls | grep *.bsp
if you go up one directory (cd ..) you can look at maplist.txt to see all of the maps available. There’s also a mapcycle.txt which I’m assuming is how the server knows to move through maps.
I do know you can set a specific port with the +port 12345 command where 12345 would be the desired port number.
Now you and I are both up to the same level of understanding on this. I’d love to delve further into it, and love even more to know how to get statistics (number of players connected, which map is currently running, etc.) or some sort of GUI control panel. And how do you ban J. Random Asshat players?
If you discover more, please let me know!
Technorati Tags: half life 2, counter strike, steam, valve, dedicated server, multiplayer, linux, ubuntu, how to, video games















August 27th, 2008 at 10:34 am
Hi, there.
Excellent post.
I’m new to linux, so I followed your steps but when i get to “chmod +x hldsupdatetool.bin” command I get an “Operation not permitted” error.
Now what?
Thanks in advance
August 27th, 2008 at 11:01 am
Well I think I’ve got it. The command should be “sudo chmod +x hldsupdatetool.bin”. And know I get this new message “Getting version 32 of Steam HLDS Update Tool
Downloading. . . . . . . . . . . .Cannot open output file ‘LinuxHldsUpdateTool_32.pkg’
Any ideas?
October 9th, 2008 at 5:40 am
Hi.
When you start up server you jump up into console. To get statistics just type ’stats’ and hit enter. To see what maps You have, type ‘maps *’, to change map ‘map map_name’. There’s more like: hostname, ip, kick etc. To see what it does just type command without any parameters, and You’ll get current value and usage help. Commands are rather easy to guess, so try to find out more. Some, hmm.. ’some’ are listed here: http://www.xdude.com/hl2dedicatedserverconsolecommands.htm
Another thing, it’s good to run server in screen, just not to have to be still logged in. Usefull packages are screen and detachtty. And ls cstrike/maps/*.bsp is sufficient
Thanks a lot for this article!