Do you have a VPS or Dedicated Server and want to install game servers on it? For example, a Half-Life 2 Dedicated Server? Then you're in the right place! Below, we'll explain step by step how to install this type of service on your server.
SteamCMD is required to set up a Half-Life 2 server. SteamCMD is the command-line version of the Steam client. With this tool, you can quickly and easily download Dedicated Server applications for popular Steam games. You can find SteamCMD on the official Valve developer page: https://developer.valvesoftware.com/wiki/SteamCMD.
Next, download it. The download contains the steamcmd.zip file, which you first need to extract. We recommend creating a separate folder and extracting the file there. You should then see steamcmd.exe. Run it and wait for the installation process to finish.
Once the message Loading Steam API.... OK appears, the process has completed successfully, and you can start installing the Half-Life 2 server.
After installation, you should be able to run commands in the Steam command line (steamcmd.exe). You need to log in there using the anonymous user. Run the following command: login anonymous
The next step is installation. Run the command app_update 232370. App ID 232370 is for the Half-Life 2 Dedicated Server application.
Please be patient while the download completes, as it can take some time for larger games. A confirmation message will appear once the process has completed successfully.
To make the server visible and accessible from outside your network, you need to allow or forward the server ports in your firewall. To do this, open the Windows Firewall settings.
You need to add additional rules in the settings. Click the inbound and outbound rules as described below, then add rules for the following ports: 27015-27020 for the TCP/UDP protocols.
At this point, you’ve completed the basic installation of your Half-Life 2 server. You can change additional server settings by editing the startup file. Navigate to your root directory. There, you’ll find the cfg folder, where you can open the server.cfg file. You can adjust server options here.
../steamapps/common/hl2-ds/hl2mp/cfg/server.cfg
To let other players join your server, you need to generate and add a Game Server Login Token (GSLT). This token authenticates your server with Steam. To create a GSLT, visit http://steamcommunity.com/dev/managegameservers and generate a token using Game ID 232370, which is for Half-Life 2.
Once you have the token, add it to your server startup parameters using +sv_setsteamaccount <TOKEN>.
Now for the important part: start your server. Go to the main game directory and run the following command:
start srcds.exe -console -game hl2mp -secure +maxplayers 10 +map dm_runoff +sv_setsteamaccount XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
You should now see logs in the command-line window indicating that the server started successfully. Note that the first startup may take a little longer while everything is set up. Alternatively, you can connect directly by using the search at the bottom of the server list and searching for [deine_ip_adresse]:2456.