This tutorial is about setting up Counter Strike 1.6 Server on CentOS which is a flavor of Linux Operating System.

For setting up Counter Strike 1.6 Server on Windows, see this post Setup Counter-Strike 1.6 Server on Windows

Most people stay away from Linux because it is much more complicated as compared to Windows.

I myself prefer Linux Operating System because of its security and stability and that’s the reason I am writing this tutorial today.

Requirements

  1. CentOS
    You can setup Counter-Strike 1.6 Server on your home computer or on a VPS (Virtual Private Server).
    If you want to setup on VPS, read this post for hints on setting up VPS Setup TeamSpeak Server on Linux
    If Linux is not your primary OS, you can install Linux on a VM (Virtual Machine).
    Simply download and install VirtualBox and CentOS ISO files and your VM will be ready.
    However in this tutorial I assume you already have CentOS Server ready with root privileges.
    You can skip the next steps of requirements if you want to setup on VPS.
  2.  

  3. Internet Connection
    For Online Server, an Internet Connection is required.
    This tutorial is for home computers running on DSL Connection or WiMAX connection.
    For 16 slots server, a 1Mb internet connection is sufficient.
    For best performance, a 4Mb internet connection is preferred which can support upto 32 players.
  4.  

  5. Static IP
    The Public IP address of DSL connections is Dynamic.
    Which means on every restart of router the Public IP is changed.
    To make the IP static you have to request your DSL provider to provide you a Static IP address.
    PTCL users can get Static IP easily for a monthly charge of 200 300 rupees.
    Call 1218 from your PTCL number to get a Static IP on your DSL connection.
  6.  

  7. UPS
    To make your server 24/7 your computer must stay on all the times.
    For that you will need a UPS that will provide backup in case of power outages.

 

 
Installation Steps

  1. Download PuTTY
    If you are using Windows, you will need an SSH Client like PuTTY that lets you connect with your VPS.
    Download PuTTY from here PuTTY.exe
  2.  

  3. Login to VPS
    Once you have downloaded PuTTY, open it and you will see the screen below:
    PuTTY SSH Client Console Window
    Enter your VPS IP address in Host Name field and press enter.
    A black console window will open asking for the username.
    Enter your username (which should be root) and press enter.

    Now it will ask for your password like below:
    PuTTY SSH Client Console Window
    Enter your password and press enter.
    Note that your password will not be shown as you type it so don’t get confused.

    Once you have logged in, you will see something like below:
    PuTTY SSH Client Console Window
  4.  
     

  5. Server Installation
    Write the following commands in PuTTY console one-by-one:
    useradd -d /home/hlds -s /bin/false hlds
    cd /home/hlds
    wget http://cdn01.counterstrike.com.pk/web/files/hlds4linux_cspak.zip
    unzip hlds4linux_cspak.zip
    cd hlds4linux_cspak
    chown -R hlds:hlds /home/hlds
    chmod +x ./hlds_run
    chmod +x ./hlds_i486
    chmod +x ./hlds_i686
    screen -A -m -d -S hlds su -c "./hlds_run -game cstrike +ip 0.0.0.0 +port 27015 +maxplayers 32 +map de_dust2_long_short +sys_ticrate 1000" hlds -s /bin/sh

    After you have executed all the commands without getting any errors, the Counter Strike 1.6 Server should be started successfully in background.
  6.  

  7. Start Counter Strike 1.6 Server on Startup
    Counter Strike 1.6 Server does not automatically starts when your VPS is restarted.
    To start the server automatically on startup, execute the following commands:
    echo cd /home/hlds >> /etc/rc.local
    echo screen -A -m -d -S hlds su -c "./hlds_run -game cstrike +ip 0.0.0.0 +port 27015 +maxplayers 32 +map de_dust2_long_short +sys_ticrate 1000" hlds -s /bin/sh >> /etc/rc.local

    Now the Counter Strike 1.6 server will automatically startup after crash or reboot.
  8.  

  9. Testing
    This step is just to make sure that you have properly configured the server.
    Open your game and click on Add Server.
    Enter your Private IP with Port and click Add.
    If you can see your server running, you can proceed to the next step.
  10.  

  11. Open Firewall
    This step is not required if you are using VPS.
    Now you have to open your Windows Firewall so that other people can connect to your server.
    You need to open UDP port 27015 on your windows firewall.
    Follow steps on this link to open Windows Firewall ports:
    http://windows.microsoft.com/en-us/windows/open-port-windows-firewall
    At this stage, you have created a LAN server which means people connected to your Router can now join your server.
  12.  

  13. Port Forwarding
    This step is not required if you are setting up on VPS.
    Now you have to “Forward the ports from your Router to your Computer” so that Online Players can connect to¬†your server.
    In simple words, all the people connecting to your Router on port 27015 will be forwarded to the port 27015 of your Computer.
    There are hundreds of thousands of router models with different port forwading methods each.
    Here are steps for some routers:
    http://www.counterstrike.com.pk/2014/03/port-forwarding-on-dsl-modem-router/
    For other routers, just google about it and you will find the steps.
  14.  

  15. Testing
    This step is not required if you are using VPS.
    This step is to make sure the firewall and ports are properly opened.
    Goto this link and enter your server port to verify it is open Port Checker
    To find your Public IP, visit this link : http://myip.counterstrike.com.pk/
    whatismyip
    Now you have created an Online Server which means people from all around the world can join your server.

 

Having problems? Just comment below and we will find you a solution!

 

For installing Counter Strike 1.6 Game on Windows based computer, visit this link: How to install Counter-Strike 1.6 Game on Windows