How to Set Up a Counter-Strike: Source Dedicated Server on AnonVM Hosting

Counter-Strike: Source (CSS) is a popular multiplayer first-person shooter that is known for its team-based gameplay and realistic physics. Hosting your own dedicated server allows you to play with your friends or the wider gaming community, with full control over the server settings. In this guide, we will walk you through the steps to set up a Counter-Strike: Source server on your AnonVM VPS.

Prerequisites

Before you begin, ensure you have:

  • A VPS from AnonVM with at least 2 GB of RAM and 1-2 CPU cores.
  • SSH access to your VPS.
  • SteamCMD installed on your VPS (Steam’s command-line tool to install and update game servers).
  • Basic Linux knowledge.

Step 1: Access Your AnonVM VPS

  1. Log in to your AnonVM account and access your VPS dashboard.
  2. Use an SSH client like PuTTY (for Windows) or the terminal (for Linux/Mac) to connect to your VPS:
     
    ssh root@your-vps-ip
    Replace your-vps-ip with the actual IP address of your VPS. Enter your password when prompted.

Step 2: Install Dependencies

  1. Update your VPS: It's a good idea to make sure your system is up to date before installing anything:

     
    apt-get update && apt-get upgrade -y
  2. Install required packages: You will need some packages like lib32gcc1 for 32-bit game server libraries:

     
    apt-get install lib32gcc1 -y
  3. Install SteamCMD: SteamCMD is a command-line version of the Steam client used to install and update game servers.

    • Install wget if it’s not already installed:

       
      apt-get install wget -y
    • Download SteamCMD:

       
      mkdir -p /home/steam cd /home/steam wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
    • Extract the downloaded file:

       
      tar -xvzf steamcmd_linux.tar.gz
    • Run SteamCMD to initialize it:

       
      ./steamcmd.sh

    SteamCMD will now download its files. When you see the prompt (steam), you can exit by typing:

     
    quit

Step 3: Install Counter-Strike: Source Server

  1. Create a directory for your server: This is where all server files will be stored.

     
    mkdir /home/cs-source cd /home/cs-source
  2. Download and install Counter-Strike: Source server: Use SteamCMD to install the server files. In the SteamCMD prompt, enter:

     
    ./steamcmd.sh

    Then, inside SteamCMD, run:

     
    login anonymous force_install_dir /home/cs-source/ app_update 232330 validate quit

    The app_update 232330 validate command installs the latest Counter-Strike: Source server files into the /home/cs-source directory.

Step 4: Configure the Server

  1. Edit the server configuration: Once the installation is complete, you will find the server configuration files in the /home/cs-source/cstrike/cfg directory.

    • Edit the server.cfg file:
       
      nano /home/cs-source/cstrike/cfg/server.cfg

    Here, you can set various server parameters such as:

    • hostname: Set the name of your server.
    • rcon_password: Set a password for remote control.
    • sv_password: Set a server password to restrict access (optional).
    • mapcycle: Define the rotation of maps.

    Example configuration snippet:

    txt
     
    hostname "My CS: Source Server" rcon_password "yourpassword" sv_password "" # Leave empty for no password sv_lan 0 # Set to 1 for LAN only mp_timelimit 30 # Set map time limit
  2. Map rotation: Edit the mapcycle.txt to add your desired map rotation:

     
    nano /home/cs-source/cstrike/mapcycle.txt

    Add maps you want to cycle through, one per line:

    txt
     
    de_dust2 de_inferno de_nuke
  3. Start server with custom configuration: You can start the server with custom configuration by running:

     
    cd /home/cs-source ./srcds_run -game cstrike -autoupdate -steam_dir /home/steam/steamcmd -steamcmd_script /home/steam/steamcmd.sh +map de_dust2 +maxplayers 16

    You can replace de_dust2 with any map from your rotation and change the number of players accordingly.

Step 5: Open Required Ports

To allow players to connect, you must open the necessary ports:

  1. The default Counter-Strike: Source port is 27015 (both UDP and TCP).

    Open the required port using UFW (Uncomplicated Firewall):

     
    ufw allow 27015/tcp ufw allow 27015/udp ufw reload

Step 6: Run the Server in the Background

You can run the server in the background using screen or tmux so that it continues running even if you disconnect from SSH.

  1. Install screen: If screen isn’t installed, run:

     
    apt-get install screen -y
  2. Start a new screen session:

     
    screen -S cssserver
  3. Start your server: Run the server as mentioned earlier:

     
    cd /home/cs-source ./srcds_run -game cstrike -autoupdate -steam_dir /home/steam/steamcmd -steamcmd_script /home/steam/steamcmd.sh +map de_dust2 +maxplayers 16
  4. Detach from the screen session: Press CTRL + A and then D to detach. The server will continue running.

  5. Reattach to the session: If you need to access the server console again, you can reattach to the screen session:

     
    screen -r cssserver

Step 7: Connect to Your Server

  1. Launch Counter-Strike: Source on your PC.
  2. Go to the Find Servers section and enter your VPS IP address and port (e.g., your-vps-ip:27015).
  3. If you have set a password, you will be prompted to enter it.

Step 8: Update the Server

To keep your server up-to-date, follow these steps:

  1. Stop the server by pressing CTRL + C in the screen session.
  2. Update the server using SteamCMD:
     
    ./steamcmd.sh login anonymous force_install_dir /home/cs-source/ app_update 232330 validate quit
  3. Restart the server:
     
    ./srcds_run -game cstrike -autoupdate -steam_dir /home/steam/steamcmd -steamcmd_script /home/steam/steamcmd.sh +map de_dust2 +maxplayers 16

Conclusion

You have successfully set up a Counter-Strike: Source dedicated server on your AnonVM VPS! You can now enjoy gaming with your friends or invite others to join. With full control over the server settings, you can create a custom experience tailored to your preferences.

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

Powered by WHMCompleteSolution