EN

Game servers

How to Create Your Counter-Strike 2 Server

Complete guide to create and configure a dedicated Counter-Strike 2 (CS2) server on a VPS or dedicated Linux server. Installation with SteamCMD, GSLT token, configuration and systemd service.

10 min read, updated on 18 November 2026

On this page

Your values

Enter them once and the commands in this guide update.

This guide explains how to install and configure a dedicated Counter-Strike 2 (CS2) server on your VPS or dedicated Linux server.

Order a Server

To host your Counter-Strike 2 server, HostMyServers offers several gaming-optimized options:

Prerequisites

  • SSH access as root or user with sudo privileges
  • 64-bit Linux system (Debian 12/13 or Ubuntu 22.04/24.04 recommended, glibc 2.31 or higher required)
  • Active firewall: nftables (recommended), iptables or ufw (use only one firewall tool at a time)
  • Minimum 4 GB RAM (8 GB recommended)
  • About 70 GB free disk space (100 GB recommended, SSD)
  • Port 27015 UDP accessible (and port 27015 TCP for RCON, from your static IP address only)
  • A Steam account with a registered phone number (for the GSLT token)

Required Configuration

Component Minimum Recommended
RAM 4 GB 8 GB
CPU 2 cores 4 cores, high clock speed
Storage 70 GB SSD 100 GB SSD
Network 100 Mbps 1 Gbps

System Update

Terminal
sudo apt update && sudo apt upgrade -y

Installing Dependencies

SteamCMD requires the 32-bit library lib32gcc-s1. Install the required packages:

Terminal
sudo apt install -y wget tar screen lib32gcc-s1

Creating a Dedicated User

For security reasons, create a dedicated user:

Terminal
sudo adduser --disabled-password --gecos "" cs2

Firewall Configuration

Open port 27015 over UDP for players. Port 27015 over TCP is used for RCON: restrict it to your static IP address (replace YOUR_IP).

With UFW

Terminal
sudo ufw allow 27015/udp
sudo ufw allow from YOUR_IP to any port 27015 proto tcp
sudo ufw reload

With iptables

Terminal
sudo iptables -A INPUT -p udp --dport 27015 -j ACCEPT
sudo iptables -A INPUT -p tcp -s YOUR_IP --dport 27015 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Saving the rules across reboots requires the iptables-persistent package.

With nftables

These commands use the inet filter table and the input chain, which are present by default in /etc/nftables.conf on Debian.

Terminal
sudo nft add rule inet filter input udp dport 27015 accept
sudo nft add rule inet filter input ip saddr YOUR_IP tcp dport 27015 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf

Installing SteamCMD

Connect as the cs2 user:

Terminal
sudo -u cs2 bash
cd ~

Create the directories and download SteamCMD:

Terminal
mkdir -p ~/steamcmd ~/cs2-server
cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzf steamcmd_linux.tar.gz

Downloading the CS2 Server

Start the server installation (application ID 730):

Terminal
./steamcmd.sh +force_install_dir /home/cs2/cs2-server +login anonymous +app_update 730 validate +quit

At the end, the message Success! App '730' fully installed. is displayed. Check that the server executable is present:

Terminal
ls ~/cs2-server/game/bin/linuxsteamrt64/cs2

Linking steamclient.so

CS2 needs the steamclient.so file to communicate with Steam. Create the link to SteamCMD's 64-bit file:

Terminal
mkdir -p ~/.steam/sdk64
ln -sf ~/steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so

GSLT Token (required)

To generate it, log in to your Steam account and go to the Steam Game Server Account Management.

Creating the token has a few prerequisites:

  • Your Steam account must not be community banned or locked
  • Your Steam account must not be limited
  • Your Steam account must have a registered phone number
  • Your Steam account must own the game for which you are creating a game server account
  • Your Steam account can create up to 1000 game server accounts

In the App ID of the base game field, enter 730. You can add a memo to remind you which server it is for, then finish by clicking the Create button.

To use the token, add it to the launch command line:

Text
+sv_setsteamaccount YOUR_TOKEN

Server Configuration

server.cfg File

Create the configuration file:

Terminal
nano ~/cs2-server/game/csgo/cfg/server.cfg

Basic Configuration

Text
hostname "My CS2 Server"
sv_password ""
rcon_password "ChangeMe"
sv_region 3
sv_lan 0
sv_cheats 0
mp_friendlyfire 0
mp_autoteambalance 1

Main Parameters

Parameter Description
hostname Public server name
sv_password Password to join (empty = public)
rcon_password Remote administration password
sv_region Region: 3 = Europe, 0 = US East, 4 = Asia, 255 = worldwide
sv_lan 0 = server visible on the Internet, 1 = local network only
sv_cheats Cheat commands (0 = disabled)
mp_friendlyfire Friendly fire (0 = disabled, 1 = enabled)
mp_autoteambalance Automatic team balancing (0 or 1)

Game Modes

The mode is selected at launch with +game_type and +game_mode:

Mode game_type game_mode
Casual 0 0
Competitive 0 1
Wingman 0 2
Arms Race 1 0
Demolition 1 1
Deathmatch 1 2

First Launch

Terminal
cd ~/cs2-server/game/bin/linuxsteamrt64
./cs2 -dedicated -console -usercon -port 27015 -maxplayers 64 +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount YOUR_TOKEN

Once startup is complete, the console shows the server connecting to the Steam servers. To stop the server, type quit.

Launch Optimization

Launch Parameters

Parameter Description
-dedicated Runs the server in dedicated mode (required)
-console Runs in console mode
-usercon Enables RCON
-port Server port (27015 by default)
-ip IP address to listen on
-maxplayers Maximum number of players
+game_type and +game_mode Game mode (see the table above)
+mapgroup Map group (mg_active for the active official maps)
+map Starting map
+sv_setsteamaccount GSLT token (required, see the dedicated section)
-insecure Disables VAC protection (see the warning below)

Changing the Port

Terminal
./cs2 -dedicated -console -usercon -port 27016 -maxplayers 64 +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount YOUR_TOKEN

Don't forget to open the new port in the firewall.

File Structure

Path Description
game/bin/linuxsteamrt64/cs2 Server executable
game/csgo/cfg/ Configuration files
game/csgo/cfg/server.cfg Main configuration
game/csgo/addons/ Extensions (Metamod, CounterStrikeSharp)

Configuration as systemd Service

Create Service File

Exit the cs2 user session (exit) to return to your administrator account, then create the service file:

Terminal
sudo nano /etc/systemd/system/cs2.service

File content:

Configuration
[Unit]
Description=Counter-Strike 2 Server
After=network.target

[Service]
Type=simple
User=cs2
Group=cs2
WorkingDirectory=/home/cs2/cs2-server/game/bin/linuxsteamrt64
ExecStart=/home/cs2/cs2-server/game/bin/linuxsteamrt64/cs2 -dedicated -console -usercon -port 27015 -maxplayers 64 +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount YOUR_TOKEN
Restart=on-failure
RestartSec=20

[Install]
WantedBy=multi-user.target

Enable and Start Service

Terminal
sudo systemctl daemon-reload
sudo systemctl enable cs2.service
sudo systemctl start cs2.service

Management Commands

Terminal
# Check status
sudo systemctl status cs2.service

# Stop server
sudo systemctl stop cs2.service

# Restart server
sudo systemctl restart cs2.service

# View logs
sudo journalctl -u cs2.service -f

Running with screen (alternative)

Terminal
sudo -u cs2 bash
cd ~/cs2-server/game/bin/linuxsteamrt64
screen -S cs2
./cs2 -dedicated -console -usercon -port 27015 -maxplayers 64 +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount YOUR_TOKEN

To detach: Ctrl+A then D

To return: screen -r cs2

Run in the Background with a Log

Terminal
sudo -u cs2 bash
cd ~/cs2-server/game/bin/linuxsteamrt64
screen -AdmSL cs2 ./cs2 -dedicated -console -usercon -port 27015 -maxplayers 64 +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount YOUR_TOKEN
Option Description
-A Adapts the window to the terminal size
-d -m Starts the session detached, in the background
-S cs2 Session name
-L Writes the server output to a log file

The screenlog.0 file is created in the folder where the command is run (~/cs2-server/game/bin/linuxsteamrt64) and contains all the server-side output. To follow it live:

Terminal
tail -f ~/cs2-server/game/bin/linuxsteamrt64/screenlog.0

In case of a startup error, this is the first file to check. To return to the server console: screen -r cs2

Server Update

Stop Server

Terminal
sudo systemctl stop cs2.service

Download the New Version

Terminal
sudo -u cs2 bash
cd ~/steamcmd
./steamcmd.sh +force_install_dir /home/cs2/cs2-server +login anonymous +app_update 730 validate +quit
exit

Restart Server

Terminal
sudo systemctl start cs2.service

Console Commands

These commands are used in the server console or via RCON.

Command Description
status Shows connected players and their ID
map <map> Change map
kick <player> Kick a player
banid <minutes> <steamid> Ban a player (0 = permanent)
mp_restartgame 1 Restart the game
say <message> Send a message to all players
exec server.cfg Reload the configuration
quit Stop the server

Using RCON from the Game

Your IP address must be allowed on TCP port 27015 in the firewall.

In the game console:

Text
rcon_address SERVER_IP:27015
rcon_password YourPassword
rcon status

Automatic Backup

Backup Script

Terminal
sudo nano /home/cs2/backup.sh
Terminal
#!/bin/bash
BACKUP_DIR="/home/cs2/backups"
SERVER_DIR="/home/cs2/cs2-server"
DATE=$(date +%Y-%m-%d_%H-%M-%S)

mkdir -p $BACKUP_DIR

# Backup the configuration
tar -czf $BACKUP_DIR/cs2_$DATE.tar.gz -C $SERVER_DIR game/csgo/cfg

# Delete backups older than 7 days
find $BACKUP_DIR -name "cs2_*.tar.gz" -mtime +7 -delete

echo "Backup completed: cs2_$DATE.tar.gz"
Terminal
sudo chown cs2:cs2 /home/cs2/backup.sh
sudo chmod +x /home/cs2/backup.sh

Schedule Backup

Terminal
sudo crontab -u cs2 -e

Add:

Text
# Backup every day at 4 AM
0 4 * * * /home/cs2/backup.sh

Connecting to the Server

Players can connect by:

  1. Launching Counter-Strike 2
  2. Opening the game console (enabled in the game options)
  3. Typing: connect SERVER_IP:27015
  4. If a password is set: password YourPassword before connecting

You can also add the server to your Steam favorites (View menu, Servers, Favorites tab).

Troubleshooting

Server won't start

  • Check the logs: sudo journalctl -u cs2.service -n 100
  • Check the available disk space: df -h
  • Check that the installation is complete (re-run the app_update command)
  • Check that the executable exists: ls ~/cs2-server/game/bin/linuxsteamrt64/cs2 (otherwise, the installation is incomplete)
  • Check that the steamclient.so link exists: ls -l ~/.steam/sdk64/steamclient.so

Players can't connect

  • Check that the GSLT token is present and valid in the launch command line

  • Check that port 27015 is open over UDP:

    Terminal
    sudo ufw status
    sudo iptables -L INPUT -n --line-numbers | grep 27015
    sudo nft list ruleset | grep 27015
  • Check that the server is listening: ss -ulnp | grep 27015

  • Test from another machine with nc -zvu SERVER_IP 27015

Server doesn't appear in the list

  • Check that sv_lan 0 is set in server.cfg
  • Check that the GSLT token is valid: if in doubt, generate a new one
  • Wait a few minutes after startup
  • Check that the server has Internet access

Performance issues

  • Reduce -maxplayers if the server is overloaded
  • Disable unnecessary extensions in game/csgo/addons
  • Schedule regular restarts

FAQ

I get the error "Error! App '730' state is 0x202 after update job"

This error is usually caused by a lack of disk space: the CS2 installation takes about 69 GB, and the error was observed with only 50 GB available. Check the free space with df -h, free up space or add a volume, then re-run the app_update command.

Which ports need to be opened?

In addition to the server port (27015 over UDP), these ports are required by Steam. They allow the server to receive responses from Steam servers when your firewall blocks incoming traffic by default:

UFW:

Terminal
sudo ufw allow proto udp from any port 27000:27030 to any port 1025:65535
sudo ufw allow proto udp from any port 4380 to any port 1025:65535
sudo ufw reload

iptables:

Terminal
sudo iptables -A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65535 -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --sport 4380 --dport 1025:65535 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

nftables:

Terminal
sudo nft add rule inet filter input udp sport 27000-27030 udp dport 1025-65535 accept
sudo nft add rule inet filter input udp sport 4380 udp dport 1025-65535 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf

I get "Permission denied" when running ./steamcmd.sh

Apply a chmod:

Terminal
chmod +x /home/cs2/steamcmd/linux32/steamcmd && chmod +x /home/cs2/steamcmd/steamcmd.sh

I get the message "WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'"

This is not a real problem: only some international characters may display incorrectly. To fix it:

Terminal
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8

If the locale-gen command is not found, first install the locales package with sudo apt install -y locales.

I get a ulimit error (no permission / can not open file)

Set the open files limit to 2048, the value recommended by Valve. For the current session, before launching the server:

Terminal
ulimit -n 2048

With systemd, add this line to the [Service] section of the service file, then reload and restart:

Configuration
LimitNOFILE=2048
Terminal
sudo systemctl daemon-reload
sudo systemctl restart cs2.service