How to Set Up a Counter-Strike Game Server on Your Dedicated Server

Setting up a dedicated Counter-Strike game server allows you to control the game environment, customize settings, and provide a stable and lag-free experience for players. Follow the steps below to install and configure your own Counter-Strike server on your dedicated server.


Step 1: Update Your Dedicated Server

Before you begin setting up your Counter-Strike server, make sure your dedicated server is up to date. This ensures all system dependencies and security patches are installed.

  • For Ubuntu/Debian:
    • sudo apt update && sudo apt upgrade -y
  • For CentOS/RHEL:
    • sudo yum update -y

Step 2: Install Required Dependencies

Counter-Strike requires specific software dependencies to function correctly. Install these before proceeding.

  • For Ubuntu/Debian:
    • sudo apt install -y lib32gcc1 lib32stdc++6 wget screen
  • For CentOS/RHEL:
    • sudo yum install -y libstdc++.i686 wget screen

Step 3: Install SteamCMD

SteamCMD is a command-line version of Steam that allows you to install and update game servers like Counter-Strike. Follow the steps to install SteamCMD.

  • Download SteamCMD:

    • For Ubuntu/Debian:
      • wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
    • For CentOS/RHEL:
      • wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
  • Extract the SteamCMD archive:

    • tar -xvzf steamcmd_linux.tar.gz
    • This will create a steamcmd directory.
  • Navigate to the SteamCMD folder:

    • cd steamcmd

Step 4: Create a Directory for Counter-Strike Server

It is recommended to create a dedicated directory for your Counter-Strike server to keep everything organized.

  • Run the following command to create and navigate to the server directory:
    • mkdir ~/cs_server
    • cd ~/cs_server

Step 5: Install Counter-Strike Dedicated Server

Using SteamCMD, you can now install the Counter-Strike server files.

  • Run SteamCMD:
    • ./steamcmd.sh
  • Install Counter-Strike:
    • At the SteamCMD prompt, type the following to install the server:
      login anonymous
      force_install_dir ./csgo/
      app_update 740 validate
      quit
      

This command will install Counter-Strike: Global Offensive (CS:GO) server files in the csgo/ directory.

Step 6: Configure the Counter-Strike Server

Once the installation is complete, you’ll need to configure your server settings.

  • Navigate to the server configuration directory:
    • cd ~/cs_server/csgo/cfg
  • Edit the server.cfg file to customize your server settings:
    • nano server.cfg

Add or modify the following basic settings:

  • hostname "Your Server Name" - Change the server name.
  • rcon_password "your_password" - Set a remote control password for server management.
  • sv_password "your_password" - Set a password for your server (optional).
  • sv_maxplayers 16 - Set the maximum number of players.
  • mapgroup mg_allclassic - Set the default map group (optional).
  • gamemode 1 - Set the game mode.

Save and exit the file after editing.

Step 7: Open Required Ports

For players to connect to your server, you need to open the required ports in your server’s firewall. The default ports for Counter-Strike are:

  • TCP/UDP Port 27015
  • For Ubuntu/Debian with UFW:
    • sudo ufw allow 27015/tcp
    • sudo ufw allow 27015/udp
  • For CentOS/RHEL with firewalld:
    • sudo firewall-cmd --zone=public --add-port=27015/tcp --permanent
    • sudo firewall-cmd --zone=public --add-port=27015/udp --permanent
    • sudo firewall-cmd --reload

Step 8: Start the Counter-Strike Server

You are now ready to start your Counter-Strike server.

  • Navigate to the server’s directory:

    • cd ~/cs_server/csgo
  • Start the server:

    • screen -S cs_server ./srcds_run -game csgo -console -autoupdate -steam_dir ~/steamcmd -steamcmd_script ~/steamcmd/steamcmd.sh

This command will start the server in the background, allowing you to disconnect and keep the server running.

Step 9: Manage the Server Using RCON

You can manage your server remotely using the RCON password you set earlier.

  • Connect to the server via RCON:

    • You can use an RCON tool or connect directly through the console by typing:
      rcon_password "your_password"
      
  • Run server commands via RCON:

    • For example, to change the map:
      rcon sv_map de_dust2
      

Step 10: Test the Server

To test your Counter-Strike server, open the Counter-Strike game and click on Find Servers.

  • Click on the "Favorites" tab.
  • Click "Add a Server" and enter your server’s IP address followed by the port (e.g., 123.456.789.123:27015).
  • Click "Add this address to Favorites" and then double-click the server to join.

Conclusion

Setting up a dedicated Counter-Strike server on your server offers you complete control over your gaming environment. With the flexibility to manage game settings, mods, and maps, you can provide a custom multiplayer experience for players. Follow the above steps to easily set up and run your own Counter-Strike server, ready for action.

Was this answer helpful? 0 Users Found This Useful (0 Votes)