Skip to content

Deployment Overview of Counter-Strike 2 Server on Server

Prerequisites and Basic Requirements

To ensure the successful deployment and operation of the Counter-Strike 2 server, the following requirements must be met:

  • Operating System: Ubuntu (with multiverse repository enabled).

  • Architecture Support: i386 architecture must be added to the system.

  • Privileges: Root or sudo privileges are required for package installation and directory management.

  • Network Requirements: Access to Steam content delivery networks (CDNs) is necessary to download game files via steamcmd.

FQDN of the final panel on the hostkey.in domain

The following table describes the domain template used for the server's access:

Parameter Value
Prefix plane
Domain hostkey.in
Full template plane{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The application utilizes the following directory structure for installation, configuration, and runtime data:

  • /opt/cs2: Main installation directory for the Counter-Strike 2 server files.

  • /opt/cs2/game/game/cfg/cs2server.cfg: Server configuration file.

  • /root/.steam/sdk64/: Directory containing required Steam SDK libraries.

  • /tmp/cs2server.pid: File used to track the active process ID of the server.

  • /var/log/cs2server.log: Log file for the server application.

Application installation process

The Counter-Strike 2 server is installed using a combination of system package management and the Steam Command Line Interface (steamcmd). The installation follows these steps:

  1. System Preparation: The multiverse repository is enabled, i386 architecture is added, and all system packages are updated to their latest versions.

  2. Environment Setup: A dedicated directory /opt/cs2 is created for the game files.

  3. SteamCMD Installation:

  4. The steamcmd package is installed via the system package manager.

  5. The Steam installation binaries are extracted into /opt/cs2.

  6. Game Download: An automated process executes steamcmd to:

  7. Set the installation directory to /opt/cs2/game.

  8. Log in anonymously.

  9. Download and validate the Counter-Strike 2 application (App ID 730).

  10. Library Configuration: The Steam client library (steamclient.so) is copied from the game files to /root/.steam/sdk64/ to ensure proper runtime execution.

  11. Configuration Deployment: A custom server configuration file cs2server.cfg is placed in the game's configuration directory.

Access Rights and Security

  • File Permissions:

  • Installation directories are set with 0755 permissions.

  • The management script /root/cs2server.sh is configured with executable permissions (0755).

  • Process Isolation: The server runs as a dedicated process, and its PID is tracked in /tmp to prevent multiple instances from running simultaneously.

Custom Scripts and Additional Setup

A custom management script is provided to control the lifecycle of the application:

Server Management Script: /root/cs2server.sh This script allows for manual control over the server process with the following commands:

  • start: Launches the dedicated server in the background using nohup, redirecting output to /var/log/cs2server.log.

  • stop: Terminates the running server process using its stored PID.

  • restart: Stops and then starts the server.

  • status: Checks if the server is currently active by verifying the existence of the PID file and the associated system process.

Docker Containers and Their Deployment

The deployment includes a containerized Nginx service used for managing SSL certificates via Certbot:

Service Image Ports Volumes Environment Variables Restart Policy
nginx jonasal/nginx-certbot:latest Host Network - nginx_secrets:/etc/letsencrypt
- /data/nginx/user_conf.d:/etc/nginx/user_conf.d
[email protected] unless-stopped

Application Update Instructions

To update the Counter-Strike 2 server, you must use the Steam Command Line Interface to validate and download the latest files:

  1. Navigate to the installation directory containing steamcmd.

  2. Execute a command to run steamcmd with the following parameters:

  3. force_install_dir /opt/cs2/game

  4. login anonymous

  5. app_update 730 validate

Location of configuration files and data

  • Server Config: /opt/cs2/game/game/csgo/cfg/cs2server.cfg

  • Application Logs: /var/log/cs2server.log

  • Steam SDKs: /root/.steam/sdk64/

Available ports for connection

The application utilizes the standard Counter-Strike 2 networking ports (typically UDP 27015 and related game ports), which must be opened in your firewall to allow player connections.

Starting and Stopping the application

Use the management script located in the root directory:

To start the server:

/root/cs2server.sh start

To stop the server:

/root/cs2server.sh stop

To check server status:

/root/cs2server.sh status

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×