
For over two decades, Counter-Strike has offered an elite competitive experience, one shaped by millions of players from across the globe. And now the next chapter in the CS story is about to begin. This is Counter-Strike 2.
Here's what you need to run a Counter-Strike 2 dedicated server.
Small server, 2-10 players
Medium server, 10-24 players
Large server, 24-64 players
Start hosting from your own computer
Run a Counter-Strike 2 server on your desktop, laptop, VPS, or dedicated machine — GameCP automates Docker setup, resource allocation, and Counter-Strike 2 configuration instantly. Automatic port forwarding means your friends can connect without touching your router. Start local, scale to a VPS when you're ready.
Skip the manual SteamCMD installation, port forwarding, and systemd configuration. Install on your own computer and start hosting instantly.
The full manual process to host a Counter-Strike 2 dedicated server on a VPS. Or install GameCP on your own computer and skip all of this.
Set your server settings, then install Docker, SteamCMD, and pull the Counter-Strike 2 container image.
# Update system and install Docker sudo apt update && sudo apt install -y docker.io sudo systemctl enable --now docker # Create game server directory sudo mkdir -p /opt/gameserver # Install SteamCMD sudo mkdir -p /opt/steamcmd curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | sudo tar zxvf - -C /opt/steamcmd # Server configuration export MAX_PLAYERS="12" export VAC_ENABLED="1" export RCON_ENABLED="0" export SRCDS_MAP="de_dust2" export GAME_MODE="1" export GAME_TYPE="0" export BOT_QUOTA="0" export BOT_QUOTA_MODE="fill" export BOT_DIFFICULTY="1" export AUTO_UPDATE="1" # Pull the container image docker pull ghcr.io/ptero-eggs/steamcmd:sniper
Download the Counter-Strike 2 dedicated server using Steam App ID 730.
# Download Counter-Strike 2 server files (App ID: 730) /opt/steamcmd/steamcmd.sh \ +force_install_dir /opt/gameserver \ +login anonymous \ +app_update 730 validate \ +quit
Counter-Strike 2 requires 2 ports to be open for game traffic and queries.
sudo ufw allow 27015/both sudo ufw allow 27020/both
Start the Counter-Strike 2 server using the configuration from Step 1.
Create the startup script
# Create the startup script
cat > /opt/gameserver/start.sh << 'EOF'
#!/bin/bash
# 1. Setup Environment
export LD_LIBRARY_PATH="/game/bin/linuxsteamrt64:"
# 2. Build Argument Array
PARAMS=(
"-dedicated"
"-ip" "0.0.0.0"
"-port" "27015"
"-tv_port" ""
"-maxplayers" "12:-12}"
)
# 3. Add Conditional Arguments
[[ "1" == "1" ]] || PARAMS+=("-insecure")
[[ "0" == "1" ]] && PARAMS+=("-usercon")
# 4. Add CVARs
PARAMS+=(
"+game_mode" "1:-1}"
"+game_type" "0:-0}"
"+map" "de_dust2:-de_dust2}"
"+hostname" ""
"+sv_password" ":-}"
"+rcon_password" ""
"+bot_quota" "0:-0}"
"+bot_quota_mode" "0_MODE:-fill}"
"+bot_difficulty" "1:-1}"
)
# 5. Workshop Collection\n[[ -n \"\" ]] && PARAMS+=(\"+host_workshop_collection\" \"\")\n[[ -n \"\" ]] && PARAMS+=(\"+workshop_start_map\" \"\")\n\n# 6. GSLT Logic
[[ -n "" ]] && PARAMS+=("+sv_setsteamaccount" "")
# 7. Execution Loop (Auto-Restart on Crash)
echo "Starting CS2 Server: "
until ./game/bin/linuxsteamrt64/cs2 "[@]}"; do
echo "Server crashed with exit code $?. Respawning in 5 seconds..."
sleep 5
done
EOF
chmod +x /opt/gameserver/start.shRun the container
docker run -d \ --name counter-strike-2-server \ -p 27015:27015/both \ -p 27020:27020/both \ -e MAX_PLAYERS="12" \ -e VAC_ENABLED="1" \ -e RCON_ENABLED="0" \ -e SRCDS_MAP="de_dust2" \ -e GAME_MODE="1" \ -e GAME_TYPE="0" \ -e BOT_QUOTA="0" \ -e BOT_QUOTA_MODE="fill" \ -e BOT_DIFFICULTY="1" \ -e AUTO_UPDATE="1" \ -v /opt/gameserver:/opt/gameserver \ -w /opt/gameserver \ ghcr.io/ptero-eggs/steamcmd:sniper \ ./start.sh
Alternative startup profiles:
GameCP lets you switch between these profiles with one click.
GameCP automates every step above: Docker, SteamCMD, port forwarding, startup, and config. Install on your own PC and deploy a Counter-Strike 2 server in under 5 minutes.
Deploy with GameCPExplore step-by-step setup guides for other popular games supported by GameCP.
Install GameCP on your own computer and start hosting in minutes. Automatic port forwarding, zero config — your friends connect instantly.
No credit card required · Free tier available · Install local, scale later