RSS



How to run a dedicated Steam server on your Ubuntu box – Countestrike style

Mon, Aug 18, 2008

Linux, Ubuntu, Video Games, howto

Talk about it in our Forums

How to run a dedicated Steam server on your Ubuntu box – Countestrike style

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: , , , , , , , , ,

Popularity: 10% [?]

Share and Enjoy:
  • Digg
  • del.icio.us
  • MisterWong
  • Reddit
  • Technorati
  • BlinkList
  • Facebook
  • Fark
  • Mixx
  • Slashdot
, , , , , , , , ,

This post was written by:

arsgeek - who has written 1989 posts on ArsGeek.


Contact the author

28 Comments For This Post

  1. Karamouza Says:

    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

  2. Karamouza Says:

    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?

  3. pi3kielny Says:

    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!

  4. cuka.ro Says:

    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

  5. Fahad Says:

    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.

  6. brhino07 Says:

    I am getting the error Operation not permitted. What do i do to fix this?

  7. brhino07 Says:

    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.

  8. Kyle Says:

    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.

  9. Evan Says:

    Do you know how/if I would use this with a shared library (.so) file for a hl2mp mod? (Like Zombie Master) :D

  10. Jesse Says:

    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!

  11. Apuntje Says:

    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 .

  12. Harry Crowell Says:

    The depthof information on this site is very enjoyable I believe anybodycanbe inspired from exploring andlearning all the diverse sources of choices.

  13. free Habbo furniture Says:

    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?

  14. Reinaldo Zolondek Says:

    Beist is the best! His AWP skills are better then markeloffs. If you dont know him, you probably will soon.

  15. JKS Says:

    Great tutorial, worked like a charm.

  16. Oren Hardee Says:

    different distributions (Debian, Ubuntu, SuSE, Fedora), Ubuntu is one of the most user friendly. It’s a new world, enjoy it.

  17. web bot Says:

    Ubuntu is a user friendly.I love this operating system because its open source.

  18. wrightrl Says:

    This Forum about Ubuntu Dedicated Source CS server or “Hl2mp” server is out of date and no longer works.

  19. wrightrl Says:

    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

  20. Halloween Haunt Says:

    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 :)

  21. scraps Says:

    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.

  22. perra-st Says:

    Thanx for this useful information.

  23. Solange Blant Says:

    thank you very much!

  24. Gisele Whitver Says:

    Cant get enough of this blog. Your opinion and facts truly let people know what its all about.

  25. mortgage calculator Says:

    A partnership that began in 2007 and has resulted in over a dozen Brightcove-powered video websites from FX.

  26. Terina Wiscount Says:

    I’m keen typically the design in this case. Is that it downloadable any where?

  27. android apps Says:

    I agree with your How to run a dedicated Steam server on your Ubuntu box – Countestrike style | ArsGeek, wonderful post.

  28. Dan Says:

    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”!

1 Trackbacks For This Post

  1. Free weekend for Crysis Wars!!!!!! - Page 4 - HardwareLogic Says:

    [...] Just make a new steam account and you’ll get the dedicated server files. or run Linux and do this: How to run a dedicated Steam server on your Ubuntu box – Countestrike style|ArsGeek its super [...]

Leave a Reply