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
Popularity: 10% [?]












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!
November 21st, 2008 at 7:25 pm
For: “How to setup a dedicated linux steam only counter-strike 1.6 server read this! -> http://forum.cuka.ro/index.php/topic,4.0.html
January 25th, 2009 at 5:08 am
Is root required?
Could I store the files in my home directory, and NOT start it as root?
I don’t have root access on the server in question.
January 25th, 2009 at 3:34 pm
I am getting the error Operation not permitted. What do i do to fix this?
January 25th, 2009 at 3:59 pm
OK, I have gotten thsi far
sudo ./steam -command update -game “SOMEGAME” -dir .
and it is now telling me
No installation directory supplied or previously set.
ima linux n00b and any help is much appreciated.
April 12th, 2009 at 9:31 pm
How about you re-write this without using sudo everywhere?
Make a new user, su into that user, do everything as non-root.
Seeing pages and pages of SUDO SUDO SUDO scares me.
September 17th, 2009 at 3:14 am
Do you know how/if I would use this with a shared library (.so) file for a hl2mp mod? (Like Zombie Master)
January 14th, 2010 at 1:16 am
This will save everyone hours of frustration… as far as I have found if you are using a default fresh install of Ubuntu you will need to be logged in as root, I wasted half a night getting no where until I figured out how to login as root!
February 1st, 2010 at 1:47 am
Note: if you receive a ‘uncompress: command not found’ message it means your server does not have uncompress installed. You have two options to easily work around this, try the following while logged-in as root:
code:
ln -s /bin/gunzip /bin/uncompress
Then try to run ./hldsupdatetool.bin again. If that does not work, or you do not have root privileges you can download the binary file we have available:
code:
wget http://www.cstrike-planet.com/dls/steam
Now that you have the steam binary file, Type the following command to begin installing CS Source
code:
chmod +x steam
./steam -command update -game “Counter-Strike Source” -dir .
February 15th, 2010 at 11:46 pm
The depthof information on this site is very enjoyable I believe anybodycanbe inspired from exploring andlearning all the diverse sources of choices.
March 22nd, 2010 at 1:35 pm
I really think that steam accounts make a lot of problems and aren’t really worth the money. I am looking for alternatives right now, so are there any other options?
April 14th, 2010 at 8:26 am
Beist is the best! His AWP skills are better then markeloffs. If you dont know him, you probably will soon.
July 28th, 2010 at 2:12 am
Great tutorial, worked like a charm.
August 6th, 2010 at 11:20 am
different distributions (Debian, Ubuntu, SuSE, Fedora), Ubuntu is one of the most user friendly. It’s a new world, enjoy it.
October 23rd, 2010 at 12:33 am
Ubuntu is a user friendly.I love this operating system because its open source.
October 29th, 2010 at 5:01 am
This Forum about Ubuntu Dedicated Source CS server or “Hl2mp” server is out of date and no longer works.
October 29th, 2010 at 4:35 pm
Okay I retract my statement about this not working….it was my core processor that was the problem…once I updgraded to different motherboard it all worked. 10/29/2010
Sincerely,
Morgun Freeman
December 9th, 2010 at 10:13 am
Hi sir. I have some problems using your tips on our windows servers at our office. But when I tried to restart all over again, it seemd to work miraculously
December 11th, 2010 at 2:13 pm
I can usually use putty to manage from a remote PC / Netbook and was trying to get the point across any details about the transfer by FTP (uploading is disabled by default in Ubuntu) and I know of no Ubuntu package for SourceMod. You can directly download SourceMod / metamod but in most of the instructions do say to remove the first time since the zip file then upload. The article says it is fairly easy. I would say that for anyone with little experience in Linux. I found this looking for ways to run TF2 as a service and still no luck. 10.4, and 10.10 I have loaded on two servers and both give me an invalid command to execute
sudo / etc / init.d / srcds start
/ Etc / init.d / srcds gives me permission errors
I tried to load this using a root account and user account.
January 21st, 2011 at 9:45 am
Thanx for this useful information.
February 8th, 2011 at 6:40 am
thank you very much!
March 7th, 2011 at 7:33 am
Cant get enough of this blog. Your opinion and facts truly let people know what its all about.
June 8th, 2011 at 4:04 pm
A partnership that began in 2007 and has resulted in over a dozen Brightcove-powered video websites from FX.
June 20th, 2011 at 10:38 am
I’m keen typically the design in this case. Is that it downloadable any where?
August 22nd, 2011 at 10:07 pm
I agree with your How to run a dedicated Steam server on your Ubuntu box – Countestrike style | ArsGeek, wonderful post.
September 20th, 2011 at 11:32 am
Everyone should keep in mind that when doing anything with Linux command line and you get “Operation Not Permitted” or any other error with similar wording, that you should add “sudo” in front of the command. There’s no need to log in as root and is a pain in the butt to get enabled for the first time. It also poses a security risk for your system. So remember, just add “sudo”!