Every other day I run into someone who is asking this question, and has little luck finding a simple answer. A lot of people easily get intimidated by this too. A couple of years back, I used to be the admin of one of the most populated servers around here, so I decided to share my knowledge and do a series of posts that would help people who face these problems.
First things first, you will need a copy of the game which would act as the core of the server. If you can access BitTorrent or are using an unreliable internet connection which disconnects often, then you should download the game from here. You actually don’t have to download all the files from the torrent. All you need is the base game plus the Addon pack.
Optionally (and I prefer this), if you have a fast internet connection, which would be 512k or faster, then you should download this utility, and follow these simple steps:
- Create a folder on your hard drive and rename it to anything you want, like “Counter-Strike Dedicated Server” or something.
- Extract the above RAR file anywhere on your computer and double click on the installer.exe included in it.
- When the installer asks for the installation directory, simply choose the folder you created in step 1.
- After a couple of moments, a console window will open up and it will start downloading the Half Life Server files along with Counter Strike. It takes about 30 minutes to complete on a 1 Mbps connection.
- After the installation is complete, verify that the size of the folder you created is between 310-320 MB. If it isn’t, then re-run the installer, it will download the remaining files. Beware that It usually takes twice to fully download the server.
- After the download is complete, you need to patch your server to work without steam. For this download this file. This is only required in case you want to run a non-steam server.
- Unzip the above file and place it in the Server’s directory replacing the original files.
Once you have the core server files ready, you need to configure the server to run on the internet. To make it work online:
- Go to the installation directory, and open the cstrike folder.
- Look for a file called server.cfg and open it with any text editor like Notepad. This file contains all your server settings including the server variables (termed cvars onwards).
- Replace all the text in it with the following code:
hostname "ACN-Clan.tk (Beta CS 1.6)"
Now goto your HLDS directory (Its the one you created initially, where you installed the server files) and right-click on the HLDS.exe. Select Create Shortcut and then open up the shortcut's properties. Click the Shortcut tab above. Now add the following at the end of the text in the Target box:
-console -game cstrike -ip localhost -port 27015 +exec server.cfg +maxplayers 4 +map de_dust2
For example, if you're HLDS is in G:\HLDS, then the field should be:
"G:\HLDS\hlds.exe" -console -game cstrike -ip localhost -port 27015 +exec server.cfg +maxplayers 4 +map de_dust2
Here is a little description of all the cvars in the above line.
- -console enables the console and starts the server.
- -game cstrike tells the HLDS to set the server type to Counter-Strike. This could also be any other Half-Life MOD.
- localhost should be replaced by you're IP address. It is a good idea to have a Static IP for a dedicated server, or if you have a domain registered then place the domain name there.
- -port is the default port for the server. You also need to forward that port to accept incoming connections.
- +exec server.cfg tells the HLDS to load the cvars from the server.cfg configured earlier.
- +maxplayers 4 sets the maximum number of players allowed to 4. It is a good idea to allow a small number of players to test the servers.
- +map de_dust2 tells the server to start dust2 map.
After you are finished with this step, you can double click on the newly created shortcut to start your server. You can also add this shortcut to your system startup to automatically run your server every time your system reboots.
Congrats! You're basic Internet enabled Counter-Strike dedicated server is now ready. Join the game now and frag some! You should keep in mind that this is just a basic server (MetaMod, AdminMod and StatsMe are installed in the back end but we are not using them) without additional features. Do comment about any suggestions or difficulties you had doing this. Next, I would post how to setup AMX Mod X (The King of Half-Life Server Side Scripting), HL Guard, and other cool plug-ins. Hope all this could help.