Setting up your own Counter-Strike 1.6 dedicated server via Docker

Once upon a time, you had to run the HLDSUpdateTool, and then SteamCMD. But now, awesome people on the internet have created Docker images for setting up a Counter-Strike 1.6 dedicated server. Now, all you have to do is:

  1. Install Docker on your machine
  2. Get a Docker image for a CS 1.6 server (I created this one, which is based off of an existing one. Mine has:
    • A lot of maps
    • Metamod
    • AMXModX (with high ping kicker, podbot control menu, round money, rock the vote, and admin all in one)
    • Podbot
  3. Customise the server (e.g. editing the server.cfg, amxx.cfg, and other config files, etc.)
  4. Start it up! (the in the above linked Git repos has more info on this)

As far as ports go, I only needed to forward 27015 on my machine, but your mileage may vary. Others have reported that some more ports must also be forwarded on some machines.

Then optionally, if you’re running Ubuntu and you want this server to start up like a service via systemd, you’ll need this:

  1. An executable script with path /usr/local/bin/hlds with contents (make sure the DIR variable matches your installation directory):
    # Do not change this path
    # The path to the game you want to host. example = /home/newuser/dod
        echo  -n "Starting HLDS"
        if [ -e $DIR ]; then
            cd $DIR
            $DAEMON start
            echo "No such directory: $DIR!"
        echo -n "Stopping HLDS"
        if [ -e $DIR ]; then
            cd $DIR
            $DAEMON stop
            echo "No such directory: $DIR!"
        echo -n "Restarting HLDS"
        sleep 1
    case "$1" in
            echo  "Usage: $ 0 {start | stop | reload | status}"
            exit  1
    exit  0
  2. A script with path /etc/systemd/system/hlds.service with contents:
    ExecStart=/usr/local/bin/hlds start
    ExecStop=/usr/local/bin/hlds stop
    ExecReload=/usr/local/bin/hlds reload
  3. Then execute:
    systemctl daemon-reload
    systemctl enable hlds
    service hlds start

Feel free to check out my server that’s running right now with the same Docker image! Here’s the command to connect via the console.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s