How to Create a Server in Counter-Strike 2
Creating your own server in Counter-Strike 2 is not just a great way to customize the gameplay to your needs and play with your circle of friends. It’s a whole world of opportunities for enthusiasts and administrators. Your own server opens unlimited horizons for creativity and control: you set the rules, choose the maps, adjust game parameters such as speed, weapon damage, or round economy, and ensure a stable connection with low ping without random players. It’s an ideal platform for cozy evening games with colleagues, organizing amateur tournaments, or simply honing your skills in a controlled arena. You become the full owner of your virtual space.
In this article, we will cover all stages of creating and setting up a CS2 server from scratch in as much detail as possible, taking into account all potential pitfalls. We will go through the process from selecting a provider and configuring the operating system to the moment when you and your friends are already battling on a freshly deployed server. If you carefully follow each step of the instructions, even a complete beginner who has never administered a Linux server before will be able to manage the setup.
Which VPS to Choose? Copy link
One of the most important questions for anyone thinking about creating their own game server is choosing a reliable provider. Stability, low ping, uninterrupted uptime, and responsive technical support are key factors for comfortable and hassle-free gameplay. Hosting a CS2 server on a home computer comes with risks: a dynamic IP address, unstable connection, high ping for players from other regions, and the need to keep the PC running 24/7. Ordering a virtual server (VPS) solves all these problems by providing powerful and stable hardware in a professional data center.
For our CS2 server, we will choose a VDS from Hostman with the following configuration: CPU 2 x 3.3 GHz, RAM 4 GB, NVMe 80 GB; 1 IPv4.
This setup is sufficient for comfortable gameplay with friends, roughly 8–10 people. If you’re thinking about something bigger, such as a public server with regular activity of 20+ players or running complex mods with many plugins (e.g., MetaMod, SourceMod), it’s worth considering a more expensive, high-performance plan with extra resources. With Hostman, you can easily scale your setup, so you can start small and upgrade your virtual server configuration at any time with just a few clicks.
The system that will run the server is Ubuntu 24.04 LTS (Noble Numbat). This is a stable and popular distribution version, ensuring compatibility and a wealth of ready-made instructions available online.
Server Preparation Copy link
First, connect to your server via SSH; more details can be found in our article.
To create the server, we need to install Docker and Docker Compose. To do this:
-
Update APT packages:
sudo apt update-
Install supporting packages:
sudo apt install curl software-properties-common ca-certificates apt-transport-https -y-
curl: a tool for transferring data and working with URLs;software-properties-common: provides scripts for software management;ca-certificates: necessary for secure data transfer and certificate validation;apt-transport-https: allows working with repositories that transmit data via HTTPS.
-
Import the GPG key:
wget -O- https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/docker.gpg > /dev/null-
Add the Docker repository:
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null-
Update APT package indexes again:
sudo apt update-
Install Docker:
sudo apt install docker-ce -y-
Check that Docker is running correctly:
sudo systemctl status dockerThis command will show Docker’s status, indicating that it is active and running.
Great! Docker has been successfully installed.
Deploying the CS2 Server Copy link
This stage can be conditionally divided into two parts: obtaining a special key from Steam and directly configuring the server container.
Obtaining the SRCDS Token (Game Server Login Token, GSLT) Copy link
For your server to be legal and fully functional, it needs a unique key for authentication on the Steam network. Without this token, the server will be considered anonymous and severely limited in its functionality (marked as “pirate,” with some features disabled).
Steam account requirements:
- The account must not have bans (VAC or Game Ban) in any game.
- The account must not be restricted (Community Ban), for example, unable to add friends or trade.
- The account must have a verified mobile number linked (Steam Guard).
- CS2 must be added to the library on the account (any purchase in the Steam store over $5 also removes this restriction).
- Maximum number of tokens that can be created on one account: 1000.
Step-by-step instructions:
- Log in to Steam in your browser.
- Go to the official Game Server Management page.
- At the bottom of the page, find the form Create New Game Server Login Token.
- In the App ID field, enter 730. This is the unique identifier for Counter-Strike 2 in Steam.
- In the Memo field, you can enter any reminder for yourself (e.g., “My CS2 server on Hostman”).
- Click the Create button.
- The system will provide a long string of letters and numbers which is your token. Copy it and save it in a secure location (for example, in a file on your computer). You will need this token in the next step.
Server Configuration and Launch Copy link
Now let’s return to our server terminal. We will use a ready-made solution in the form of a Docker container, which significantly simplifies the process of installing and updating the game server.
- Check Docker Compose installation. Modern versions of Docker already include the Compose plugin. Let’s check:
sudo docker -v && sudo docker compose versionThe output should show the versions of Docker and Docker Compose, confirming they are ready to use.
- Create a working directory. It’s best to store all server configuration files in a separate folder for organization:
mkdir cs2server && cd cs2server- Download the
docker-compose.ymlconfiguration file. Instead of creating the file manually, we’ll use a ready-made example from a popular repository. Download it directly to the server:
wget https://raw.githubusercontent.com/joedwards32/CS2/refs/heads/main/examples/docker-compose.yml- Create the
.envconfiguration file. This is the most important file, containing all sensitive data and your server settings.
nano .env- In the text editor, insert the following parameters, replacing
generated_token_earlierwith the GSLT token you obtained in the previous section:
# Mandatory parameters
SRCDS_TOKEN=generated_token_earlier
# Password for RCON (remote server management)
CS2_RCONPW=Your_Complex_Password_1
# Password for connecting to the server (leave empty for public server)
CS2_PW=
# Your server’s name as players will see it in the server list
CS2_SERVERNAME=My Cool CS2 Server
# Password for GOTV (spectator mode)
TV_PW=Your_Complex_Password_2
# Additional settings (can be configured later)
CS2_PORT=27015
CS2_TV_PORT=27020
CS2_IP=0.0.0.0
CS2_MAXPLAYERS=10
CS2_MAP=de_dust2
CS2_GAMETYPE=0
CS2_GAMEMODE=1
After filling in the values, press Ctrl+O to save the file, Enter to confirm, and Ctrl+X to exit the nano editor.
- (Optional) Perform basic
docker-compose.ymlconfiguration. Open the file to quickly review or modify some parameters:
nano docker-compose.ymlYou’ll see the file structure. Here you can directly change parameters such as:
CS2_SERVERNAME: the server name visible to players.CS2_RCONPW: password for remote management via RCON.CS2_PW: password to connect to the server. Leave empty for a public server:"".TV_PW: password for spectators on GOTV../cs2/csgo:/home/steam/cs2-dedicated/csgo: connects your server’s configuration folder to the container folder, ensuring settings persist after updates.
After reviewing and making any changes, save the file (Ctrl+O, Enter, Ctrl+X).
Run the container:
sudo docker compose up -dThe -d flag means “detached,” so the container will run in the background while you can continue working in the terminal.
- Monitor the launch process. The server will not start instantly. Docker will first download the CS2 server image, then initialize it and load game files. This may take a significant amount of time (tens of minutes) because the game files are large.
Monitor the process with the following commands:
-
General container status:
sudo docker compose ps-
View real-time logs (very useful for tracking progress):
sudo docker compose logs -fTo exit log monitoring, press Ctrl+C.
-
View only the latest log entries:
sudo docker compose logsThe logs will show how the server downloads and updates CS2. Completion and successful launch are indicated by a line like:
[S_API] SteamNETSockets startup successfuland the absence of errors.
If you see a successful launch message in the logs, your CS2 server is now running and is likely visible in the public server list in the game. Next, we move on to testing and fine-tuning it.
Connecting to the Server and Basic Management Copy link
Now we can join our own server.
- Enable the Developer Console. Go to CS2 settings → Game → Advanced Settings and click Enable Developer Console.
- Find the public IP address of your VPS. It’s listed in your Hostman control panel on the server Dashboard.
- Open the console in the game (using the
~key on your keyboard, below Esc). - Enter the connection command. The standard CS2 port is 27015. For example:
connect 123.123.123.123Replace 123.123.123.123 with your server’s real IP address.
If you set a server password (CS2_PW), enter:
password your_server_passwordbefore running the connect command.
Once connected, you can start playing on your personal server.
Conclusion Copy link
As you can see, the process of creating your own Counter-Strike 2 game server, though it may seem complex at first, becomes quite manageable with a clear step-by-step guide.
Successfully launching a game server is important but only the first step in creating a stable and engaging gaming environment. Further work should focus on comprehensive optimization and configuration of all server systems.
The foundation of stable operation is a well-configured server file setup. These settings determine all aspects of functionality, from network parameters and game rules to security and performance. Detailed configuration ensures reliable and predictable server operation.
To expand functionality, you should implement modular platforms like MetaMod and SourceMod. These systems allow integration of a wide range of plugins, providing enhanced moderation, analytics, and game management capabilities.
Special attention should be paid to designing a balanced map rotation cycle, which directly affects player retention. Properly configured map rotation maintains long-term community interest.
Equally important is implementing a thoughtful administration system with clearly defined access rights. This ensures rapid response to incidents and minimizes operational risks.
A key element of professional project positioning is integrating a domain name. Using a custom domain instead of an IP address increases brand recognition, simplifies user access, and builds trust. The domain becomes part of corporate identity and integrates easily into marketing materials.
Implementing these measures comprehensively allows you to create a full-featured, reliable, and scalable gaming product, ready for your target audience and future development.