<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HLDS &#8211; Henry Poon&#039;s Blog</title>
	<atom:link href="https://blog.henrypoon.com/blog/tag/hlds/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.henrypoon.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Sep 2022 05:12:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">83044199</site>	<item>
		<title>Setting up your own Counter-Strike 1.6 dedicated server via Docker</title>
		<link>https://blog.henrypoon.com/blog/2018/09/23/setting-up-your-own-counter-strike-1-6-dedicated-server-via-docker/</link>
					<comments>https://blog.henrypoon.com/blog/2018/09/23/setting-up-your-own-counter-strike-1-6-dedicated-server-via-docker/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sun, 23 Sep 2018 20:00:12 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer architecture]]></category>
		<category><![CDATA[Contents]]></category>
		<category><![CDATA[Counter-Strike]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Filesystem Hierarchy Standard]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[HLDS]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[ise]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Systemd]]></category>
		<category><![CDATA[Team]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[USR]]></category>
		<category><![CDATA[Variable]]></category>
		<guid isPermaLink="false">https://blog.henrypoon.com/?p=2992</guid>

					<description><![CDATA[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: Install Docker on your machine Get a Docker image for a CS 1.6 server (I created [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">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:</p>



<ol class="wp-block-list"><li>Install Docker on your machine</li><li>Get a Docker image for a CS 1.6 server (I created <a rel="noreferrer noopener" href="https://github.com/hpoon/HLDS-CS1.6" target="_blank">this one</a>, which is based off of an <a rel="noreferrer noopener" href="https://github.com/kriansa/cs-16-server" target="_blank">existing one</a>. Mine has:<ul><li>A lot of maps</li><li>Metamod</li><li>AMXModX (with high ping kicker, podbot control menu, round money, rock the vote, and admin all in one)</li><li>Podbot</li></ul></li><li>Customise the server (e.g. editing the server.cfg, amxx.cfg, and other config files, etc.)</li><li>Start it up! (the README.md in the above linked Git repos has more info on this)</li></ol>



<p class="wp-block-paragraph">As far as ports go, I only needed to forward 27015 on my machine, but your mileage may vary. Others have reported that <a rel="noreferrer noopener" href="https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server" target="_blank">some more ports</a> must also be forwarded on some machines.</p>



<p class="wp-block-paragraph">Then optionally, if you&#8217;re running Ubuntu and you want this server to start up like a service via systemd, you&#8217;ll need this:</p>



<ol class="wp-block-list"><li>An executable script with path /usr/local/bin/hlds with contents (make sure the DIR variable matches your installation directory):</li></ol>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#!/bin/sh

# Do not change this path
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

# The path to the game you want to host. example = /home/newuser/dod
DIR=/opt/cs-16-server/bin
DAEMON=./server

start()
{
    echo  -n "Starting HLDS"
    if [ -e $DIR ]; then
        cd $DIR
        $DAEMON start
    else
        echo "No such directory: $DIR!"
    fi
}

stop()
{
    echo -n "Stopping HLDS"
    if [ -e $DIR ]; then
        cd $DIR
        $DAEMON stop
    else
        echo "No such directory: $DIR!"
    fi
}

reload()
{
    echo -n "Restarting HLDS"
    stop
    sleep 1
    start
}

case "$1" in
    start|stop|reload)
        "$1"
        ;;
    *)
        echo  "Usage: $ 0 {start | stop | reload | status}"
        exit  1
        ;;
esac

exit  0</code></pre>



<ol class="wp-block-list" start="2"><li>A script with path /etc/systemd/system/hlds.service with contents:</li></ol>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[Unit]
Description=HLDS

[Service]
Type=oneshot
ExecStart=/usr/local/bin/hlds start
ExecStop=/usr/local/bin/hlds stop
ExecReload=/usr/local/bin/hlds reload
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target</code></pre>



<ol class="wp-block-list" start="3"><li>Then execute:</li></ol>



<pre class="wp-block-code"><code lang="bash" class="language-bash">systemctl daemon-reload
systemctl enable hlds
service hlds start</code></pre>



<p class="wp-block-paragraph">Feel free to check out my server that&#8217;s running right now with the same Docker image! Here&#8217;s the command to connect via the console.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">connect henrypoon.com:27015</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2018/09/23/setting-up-your-own-counter-strike-1-6-dedicated-server-via-docker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2992</post-id>	</item>
	</channel>
</rss>
