Note: OPT. = optional section
I. Setting a Static IP Address
Before we begin, we need to set a static IP address to our computer. You need to download a program called portforward.com – https://portforward.com/software/download-instructions/network-utilities/ to continue. Once it is installed, select the Static IP Address option in the menu. Select your network device in the drop-down menu and press the Make it Static button.
The reason why we are doing this is because if your IP address is still dynamic, it will keep changing every time you restart your PC and it needs to be the same.
II. Port Forwarding
Finding the Default Gateway
Before you get to the server part, you need to forward some ports on your router so that Half-Life Dedicated Server (the tool we’re using) can use them, and clients from other networks can access those ports.
Open your start menu and type cmd and open the Command Prompt. Elevation is not required. In the command prompt, type the command ipconfig. A list of configurations for the network devices you have will appear. Find the one you’re using, and get the address for your Default Gateway. Type that address in the URL bar of your browser. NOTE: make sure you keep CMD open!! We will need it later. You should have a prompt appear to type a username and password. Most routers have the username and password admin, but some people, like me, have the username admin and a password. You can go to your router and there should be a sticker showing the default gateway password (it isn’t the one you use to connect to your router). If you can’t find it, you should look around the house for any other things that came with the router, or contact your ISP.
Now, we can port forward! Find the page for port forwarding on your router settings. If you can’t find it, your ISP should show you how on their website.
Using this page we can add “rules” to your router. Create one, [name it whatever you want] and enter the IP for your PC. In ALL the boxes where you can enter a port, type 27015 and select the TCP protocol and save the rule. Repeat the exact same step, but this time, use the UDP protocol. NOTE: you cannot use the “UDP/TCP” protocol. Repeat the same step again, but this time, type the port 27020. Make sure you keep the UDP protocol. Repeat the step again, but with the port 26900.
Now, you should be port forwarded!
III. Downloading Half-Life Dedicated Server (HLDS)
You’d think you could just go into Steam Tools and download the tool from there, but for unknown reasons, that version of the tool is broken. You need to download https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD to get the fixed version of the tool. Extract the ZIP to any folder you want [if you have multiple drives, save it to the one with the most space, 3 GB+ is recommended]. Now, you can open SteamCMD and wait for it to download all the files it needs.
Half-Life Dedicated Server
Once SteamCMD has finished downloading, you can sign in to your Steam account, though if you don’t want to, you can try using the anonymous account.
Once you’re logged in, you can install Half-Life Dedicated Server (we will refer to it as HLDS from now on). In SteamCMD, type app_update 90 validate and it will begin downloading, then it will validate all the files. The download will suddenly stop, so type the command again until there are no more updates. Once it is finished, go to your SteamCMD folder, then steamapps, common, Half-Life.
IV. Setting Up HLDS
Create a batch file in your HLDS folder. The batch file tells HLDS what settings to use. Name the batch file with the name of the game/mod of which you want to host a server for. You can create more batch files for different mods/games.
The -game variable is not required for normal Half-Life.
If you want mods/other games, such as Counter-Strike, copy their folders from your Half-Life directory, which can be found by going to Half-Life’s properties in your Steam library, LOCAL FILES and then BROWSE LOCAL FILES. Copy the mod/game folder to your HLDS directory.
CS Condition Zero: czero
Deathmatch Classic: dmc
Opposing Force: gearbox
00. Nightfire: nightfire
Gunman Chronicles: rewolf
Day of Defeat: dod
Team Fortress Classic: tfc
For mod folder names, play the mod, open the console and type gamedir
Tracking Your Progress
HLDS should be able to work at this point, though with only basic functions. Before we go any further, start your batch file for Half-Life and make sure you have your IP on your clipboard. Open Half-Life, open the console, and type connect <your IP> and you should be able to join. If it says STEAM validation rejected, close the server and run the batch file again.
If you’re able to join the server, you now need to see if other people from other networks can join. Search “what it my ip address” or just “ip” and your public IP address should appear. You can send this to playtesters of the server and they should be able to join if you port forwarded correctly.
To shut down your server, do not simply close the HLDS window, otherwise players will just lose connection. Type quit in the server console and players will be kicked from the server before HLDS closes with the message “Kicked: server shutting down.”
V. Configuring HLDS
In your HLDS directory, go to the game/mod folder you want to host for, and open server.cfg with Notepad. The default looks like this:
In this file you can change the server name, how fast players can move and add your own commands you want to run on server startup. It is recommended that you add // custom commands at the bottom of the file to enter your own commands. See section VII for a list of commands.
In ordinary deathmatch games such as Half-Life, Opposing Force, Team Fortress Classic and Deathmatch Classic, they have a mapcycle.txt file which allows you to change what maps you want in the server. After a match, the server uses that file to decide the next map. Plugins for AMX MOD X (see section VI) allow players to vote for the next map.
VI. (Optional) AMX MOD X
AMX MOD X is the plugin base for all servers that run on HLDS. I will not show you how to install and make your own plugins.
You can download it www.amxmodx.org – https://www.amxmodx.org/ and in the installer, select Select Mod Directory and choose the game/mod in your HLDS directory that you want to host for.
VII. HLDS Commands
There are lots of handy commands in HLDS that you can use to make your server better. A lot of SV commands that work in Half-Life also work in HLDS, such as sv_airaccelerate. These commands can be added to your // custom commands section of your server.cfg file.
Function: Changes the map without kicking out all players.
Function: Changes the amount of players that can be in the server. Changes are applied on the next changelevel
Value: 10-<no max>
Function: Changes how fast players can walk. Jumping may be slowed down due the the bunnyhop cap implemented into the engine in 2003.
Value: <your server name in quotation marks>
Function: sets the server name shown in server browser and leaderboard
Value: <your password in quotation marks, with no spaces>
Function: Sets a password to the server. Players will need the password to connect to and join the server.
If you want more commands let me know in the comments.
You should now be able to run your own server. If you ran into any problems, let me know in the comments.
Thank you for reading this guide!
I hope you enjoy what we shared today about Counter-Strike – Starting a Dedicated Server. If there is anything, you want us to add, please let us know via comment below! See you soon! And thanks!
- Check All Counter-Strike Posts List