Technology Encyclopedia Home >How to Host a CS2 (Counter-Strike 2) Server on a Cloud Server — Your Own Dedicated Match Server

How to Host a CS2 (Counter-Strike 2) Server on a Cloud Server — Your Own Dedicated Match Server

A few friends and I wanted to do private scrimmages without matchmaking — specific maps, specific rules, practice scenarios with bots. Official servers don't give you that level of control.

Setting up a CS2 dedicated server is more involved than most game servers: SteamCMD for installation, a GSLT token from Steam (which is the thing most guides don't mention clearly and without it the server won't connect), and careful port configuration. But once it's running, it's stable and the private server experience is exactly what you'd want.

This guide covers the complete setup on Ubuntu 22.04 from scratch.

I run game servers on Tencent Cloud Lighthouse. For CS2, pick the region closest to your players — latency matters a lot in a competitive FPS, and Lighthouse's global data center footprint (US, Europe, Singapore, Tokyo, and more) gives you options. The fixed monthly pricing also makes game server hosting cost-predictable: no per-GB charges for match traffic, just a flat monthly rate regardless of how many hours you play.


Table of Contents

  1. Server Requirements
  2. Prerequisites
  3. Part 1 — Provision the Server
  4. Part 2 — Install SteamCMD and CS2 Server
  5. Part 3 — Configure the Server
  6. Part 4 — Create a Steam Game Server Login Token
  7. Part 5 — Start the Server with systemd
  8. Part 6 — Open Firewall Ports
  9. Part 7 — Connect and Verify
  10. Part 8 — Useful Server Configurations
  11. The Gotcha: GSLT Token Is Required
  12. Server Admin Commands

  • Key Takeaways
  • Use the appropriate Lighthouse application image to skip manual installation steps where available
  • Lighthouse snapshots provide one-click full-server backup before major changes
  • OrcaTerm browser terminal lets you manage the server from any device
  • CBS cloud disk expansion handles growing storage needs without server migration
  • Console-level firewall + UFW = two independent protection layers

Server Requirements {#requirements}

Component Minimum Recommended
CPU 2 vCPU 4 vCPU
RAM 2 GB 4 GB
Disk 30 GB 50 GB (CS2 server files are large)
Bandwidth 10 Mbps 50 Mbps+ (for 10+ players)

CS2 dedicated server is lighter than Palworld but needs good bandwidth for smooth gameplay.


Prerequisites {#prerequisites}

Requirement Notes
Cloud server Tencent Cloud Lighthouse Ubuntu 22.04
4 GB+ RAM Recommended for reliable operation
Steam account For obtaining the Game Server Login Token (GSLT)
UDP ports 27015, 27020 open CS2's default ports

Cost: The Basic plan (2 vCPU / 4 GB RAM) works for small groups. Check current promotions.


Part 1 — Provision the Server {#part-1}

ssh ubuntu@YOUR_SERVER_IP
sudo apt update && sudo apt upgrade -y

# Enable 32-bit support (SteamCMD requirement)
sudo dpkg --add-architecture i386
sudo apt update

# Install dependencies
sudo apt install -y lib32gcc-s1 wget curl git

Part 2 — Install SteamCMD and CS2 Server {#part-2}

# Install SteamCMD
sudo apt install -y steamcmd

# Create dedicated user
sudo adduser --disabled-password --gecos "" csgo
sudo su - csgo
# As csgo user: install CS2 dedicated server
/usr/games/steamcmd \
  +login anonymous \
  +force_install_dir ~/cs2-server \
  +app_update 730 validate \
  +quit

App ID 730 is Counter-Strike 2 (CS:GO's app ID, now runs CS2).

The download is large (~30 GB) and takes 20-60 minutes depending on your connection speed.

ls ~/cs2-server/
# Should show: cs2, game/, bin/, etc.

exit  # Back to ubuntu user

Part 3 — Configure the Server {#part-3}

CS2 uses a configuration file for server settings:

# Create server config directory and file
sudo -u csgo mkdir -p /home/csgo/cs2-server/game/csgo/cfg
sudo -u csgo nano /home/csgo/cs2-server/game/csgo/cfg/server.cfg
// CS2 Server Configuration

// Server identity
hostname "My CS2 Server"
sv_password ""              // Leave empty for public, or set a password

// Gameplay
sv_cheats 0
sv_lan 0

// Performance
fps_max 64                  // Server tick rate (64 or 128)
sv_maxupdaterate 64
sv_minupdaterate 10
sv_mincmdrate 10
sv_maxcmdrate 64

// Logging
log on
sv_logbans 1
sv_logecho 1
sv_logfile 1

// RCON admin access
rcon_password "your_rcon_password"

// Anti-cheat
sv_pure 1

// Map voting
mp_endmatch_votenextmap 1

// Round settings
mp_timelimit 30
mp_maxrounds 30
mp_roundtime 1.92

Part 4 — Create a Steam Game Server Login Token {#part-4}

CS2 servers require a Game Server Login Token (GSLT) to be visible on the Steam server browser and to use VAC anti-cheat.

  1. Go to steamcommunity.com/dev/managegameservers
  2. Log in with your Steam account
  3. Under "Create a new game server account":
    • App ID: 730 (CS2)
    • Memo: "My CS2 Server"
  4. Click Create
  5. Copy the generated token

You'll use this token in the server start command.


Part 5 — Start the Server with systemd {#part-5}

sudo nano /etc/systemd/system/cs2server.service
[Unit]
Description=CS2 Dedicated Server
After=network.target

[Service]
Type=simple
User=csgo
WorkingDirectory=/home/csgo/cs2-server
ExecStart=/home/csgo/cs2-server/game/bin/linuxsteamrt64/cs2 \
  -dedicated \
  -port 27015 \
  +sv_setsteamaccount YOUR_GSLT_TOKEN \
  +game_type 0 \
  +game_mode 1 \
  +map de_dust2 \
  +maxplayers 10
Restart=on-failure
RestartSec=15s

[Install]
WantedBy=multi-user.target

Map options: de_dust2, de_mirage, de_inferno, de_nuke, de_overpass, de_ancient, de_vertigo, cs_office, cs_italy

Game type/mode options:

  • Competitive: +game_type 0 +game_mode 1
  • Casual: +game_type 0 +game_mode 0
  • Deathmatch: +game_type 1 +game_mode 2
  • Wingman (2v2): +game_type 0 +game_mode 2
sudo systemctl daemon-reload
sudo systemctl enable cs2server
sudo systemctl start cs2server

# Monitor startup
sudo journalctl -u cs2server -f
# Wait for: VAC enabled, sv_pure = 1, etc.

Part 6 — Open Firewall Ports {#part-6}

In the Lighthouse console firewall and UFW:

sudo ufw allow 27015/udp    # Game port
sudo ufw allow 27015/tcp    # Game port (TCP, also needed)
sudo ufw allow 27020/udp    # SourceTV (optional)
sudo ufw allow ssh
sudo ufw enable

Part 7 — Connect and Verify {#part-7}

From CS2 client

  1. Open CS2
  2. Open the console: ~ key
  3. Type: connect YOUR_SERVER_IP:27015
  4. If password protected: connect YOUR_SERVER_IP:27015; password yourpassword

Find in community server browser

  1. Play → Community Server Browser
  2. Search by server name or IP
  3. Your server should appear (may take a few minutes to appear after startup)

Command-line verification

# Check if server is listening
sudo ss -tlnp | grep 27015

# Test connection
nc -zv YOUR_SERVER_IP 27015

Part 8 — Useful Server Configurations {#part-8}

Workshop maps

To use custom maps from the Steam Workshop:

# In the ExecStart line, add:
+host_workshop_map WORKSHOP_MAP_ID

# Or create a mapcycle file:
sudo -u csgo nano /home/csgo/cs2-server/game/csgo/mapcycle.txt
de_dust2
de_mirage
de_inferno
de_nuke

Practice mode (for aim training)

Create /home/csgo/cs2-server/game/csgo/cfg/practice.cfg:

sv_cheats 1
mp_limitteams 0
mp_autoteambalance 0
mp_roundtime 60
mp_roundtime_defuse 60
mp_maxmoney 65535
mp_startmoney 65535
mp_buy_anywhere 1
mp_buytime 9999
sv_infinite_ammo 1
give weapon_knife
bot_kick
mp_restartgame 1

Execute it in-game: exec practice

Auto-update script

CS2 updates frequently. Create an update script:

sudo -u csgo nano ~/update_cs2.sh
#!/bin/bash
/usr/games/steamcmd \
  +login anonymous \
  +force_install_dir ~/cs2-server \
  +app_update 730 validate \
  +quit
echo "CS2 update complete: $(date)"
chmod +x /home/csgo/update_cs2.sh

# Run weekly via cron (as csgo user)
sudo crontab -u csgo -e
# Add: 0 4 * * 1 /home/csgo/update_cs2.sh

The Gotcha: GSLT Token Is Required {#gotcha}

Without a valid Game Server Login Token, CS2 servers receive a VAC error at startup and may not appear in the server browser or work correctly with Steam authentication.

Error without GSLT:

GSLT authentication failed
Server will not be listed in server browser

The fix: get a GSLT from the Valve Developer page (Part 4) and add it to the start command with +sv_setsteamaccount YOUR_TOKEN.

GSLT tokens can be blocked if you get too many VAC bans from your server or violate Valve's game server policies. Each server should have its own token.


Server Admin Commands {#commands}

Connect to the server console via RCON:

# Install rcon tool
sudo apt install -y rcon

# Connect to server console
rcon -H YOUR_SERVER_IP -P 27015 -p your_rcon_password

Common admin commands:

status              // Show connected players
kick "PlayerName"   // Kick a player
banid 0 "SteamID"   // Ban by Steam ID
changelevel de_mirage  // Change map
mp_restartgame 1    // Restart the round
bot_add             // Add a bot
bot_kick            // Remove all bots
exec competitive.cfg  // Load a config file

Troubleshooting {#troubleshooting}

Issue Likely Cause Fix
Connection refused Service not running or wrong port Check systemctl status SERVICE and verify firewall rules
Permission denied Wrong file ownership or permissions Check file ownership with ls -la and use chown/chmod to fix
502 Bad Gateway Backend service not running Restart the backend service; check logs with journalctl -u SERVICE
SSL certificate error Certificate expired or domain mismatch Run sudo certbot renew and verify domain DNS points to server IP
Service not starting Config error or missing dependency Check logs with journalctl -u SERVICE -n 50 for specific error
Out of disk space Logs or data accumulation Run df -h to identify usage; clean logs or attach CBS storage
High memory usage Too many processes or memory leak Check with htop; consider upgrading instance plan if consistently high
Firewall blocking traffic Port not open in UFW or Lighthouse console Open port in Lighthouse console firewall AND sudo ufw allow PORT

Frequently Asked Questions {#faq}

What server size do I need for a CS2 dedicated server server?
Check the requirements section in this guide. Generally: more RAM = more players. Start with the recommended specs and monitor actual usage with htop before scaling up.

How do I keep the CS2 dedicated server server running when I close my SSH session?
Use screen, tmux, or systemd to run the server as a background process. The guide covers setting up a systemd service for automatic startup and crash recovery.

How do I update the CS2 dedicated server server software?
Stop the server, download the new version, replace the old binary or files, and restart. Always back up your world/save data first. Check the game's official documentation for version-specific migration notes.

How do I protect my server from unwanted players?
Use password protection and/or whitelist mode (if supported). Restrict the server port in UFW to known IP addresses if it's a private server for a small group.

What region should I choose for the server?
Choose the Lighthouse data center closest to where most of your players are located. Latency is directly tied to geographic distance from the server.

Host your CS2 server today:
👉 Tencent Cloud Lighthouse — Low-latency VPS for game servers
👉 View current pricing and promotions
👉 Explore all active deals and offers