Overview
Counter-Strike 2 (CS2) is one of the most popular competitive FPS games. Hosting a dedicated server lets you run custom matches, tournaments, or community servers.
Requirements
- A Breeze with at least 4 GB RAM and 2 CPU cores
- 40 GB free disk space
- Ubuntu 22.04
Step 1: Install SteamCMD
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y steamcmdStep 2: Create a Server User
sudo useradd -r -m -d /opt/cs2 cs2serverStep 3: Install CS2 Server
sudo -u cs2server steamcmd +force_install_dir /opt/cs2/server \
+login anonymous \
+app_update 730 validate \
+quitStep 4: Get a Game Server Login Token (GSLT)
You need a GSLT from Steam Game Server Account Management. Use App ID 730.
Step 5: Create a Start Script
sudo -u cs2server tee /opt/cs2/start.sh <<'EOF'
#!/bin/bash
cd /opt/cs2/server
./game/bin/linuxsteamrt64/cs2 -dedicated \
+map de_dust2 \
+game_type 0 \
+game_mode 1 \
-maxplayers 10 \
-port 27015 \
+sv_setsteamaccount YOUR_GSLT_HERE \
-console
EOF
chmod +x /opt/cs2/start.shStep 6: Create a Systemd Service
sudo tee /etc/systemd/system/cs2.service <<EOF
[Unit]
Description=Counter-Strike 2 Server
After=network.target
[Service]
User=cs2server
WorkingDirectory=/opt/cs2
ExecStart=/opt/cs2/start.sh
Restart=on-failure
RestartSec=15
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now cs2Step 7: Open Firewall Ports
sudo ufw allow 27015/tcp
sudo ufw allow 27015/udp
sudo ufw allow 27020/udpGame Modes
| Mode | game_type | game_mode |
|---|---|---|
| Casual | 0 | 0 |
| Competitive | 0 | 1 |
| Deathmatch | 1 | 2 |
| Arms Race | 1 | 0 |