Prérequis
- Un serveur avec minimum 4 Go de RAM
- Ubuntu 22.04, Debian 12 ou AlmaLinux 9
- Accès root
- Un token Steam GSLT (Game Server Login Token)
Counter-Strike 2 est le successeur de CS:GO. Ce guide vous permet d'installer votre propre serveur dédié pour organiser des matchs compétitifs ou casual.
1. Obtenir un token GSLT
Avant de commencer, vous devez obtenir un Game Server Login Token (GSLT) :
- Allez sur steamcommunity.com/dev/managegameservers
- Connectez-vous avec votre compte Steam
- App ID : 730 (Counter-Strike 2)
- Entrez un mémo descriptif
- Cliquez sur 'Create'
Token requis
Sans GSLT valide, votre serveur ne sera pas visible dans la liste des serveurs et les joueurs ne pourront pas se connecter facilement.
2. Préparer le système
dpkg --add-architecture i386
apt update
apt install -y lib32gcc-s1 lib32stdc++6 curldnf install -y glibc.i686 libstdc++.i686 curl3. Créer l'utilisateur CS2
useradd -m -r -s /bin/bash -d /opt/cs2 cs2
mkdir -p /opt/cs2/{server,steamcmd}
chown -R cs2:cs2 /opt/cs24. Installer SteamCMD et CS2
su - cs2
cd /opt/cs2/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
# Installer CS2 Server (App ID: 730)
/opt/cs2/steamcmd/steamcmd.sh +force_install_dir /opt/cs2/server +login anonymous +app_update 730 validate +quit5. Configuration du serveur
mkdir -p /opt/cs2/server/game/csgo/cfg
cat > /opt/cs2/server/game/csgo/cfg/server.cfg << 'EOF'
// Nom du serveur
hostname "Mon Serveur CS2"
// Mot de passe RCON
rcon_password "votre_mot_de_passe_rcon"
// Mot de passe serveur (vide = public)
sv_password ""
// Paramètres de base
sv_cheats 0
sv_lan 0
// Taux de tick
sv_maxrate 0
sv_minrate 128000
// Chat
sv_alltalk 0
sv_deadtalk 1
// Logs
log on
sv_logbans 1
sv_logecho 1
sv_logfile 1
// Anti-cheat VAC
sv_pure 1
sv_pure_kick_clients 1
EOF6. Script de démarrage
cat > /opt/cs2/start_server.sh << 'EOF'
#!/bin/bash
cd /opt/cs2/server/game/bin/linuxsteamrt64
# Configuration
GSLT="VOTRE_TOKEN_GSLT_ICI"
IP="0.0.0.0"
PORT="27015"
MAP="de_dust2"
MAXPLAYERS="16"
GAMETYPE="0" # 0=casual, 1=competitive
GAMEMODE="0" # 0=casual, 1=competitive, 2=wingman
./cs2 -dedicated \
+sv_setsteamaccount $GSLT \
-ip $IP \
-port $PORT \
+map $MAP \
+maxplayers $MAXPLAYERS \
+game_type $GAMETYPE \
+game_mode $GAMEMODE \
+mapgroup mg_active
EOF
chmod +x /opt/cs2/start_server.shImportant
Remplacez VOTRE_TOKEN_GSLT_ICI par le token obtenu à l'étape 1 !
7. Modes de jeu
Casual: game_type 0, game_mode 0
Competitive: game_type 0, game_mode 1
Wingman: game_type 0, game_mode 2
Deathmatch: game_type 1, game_mode 2
Arms Race: game_type 1, game_mode 0
Demolition: game_type 1, game_mode 18. Service systemd
exit
cat > /etc/systemd/system/cs2.service << 'EOF'
[Unit]
Description=Counter-Strike 2 Dedicated Server
After=network.target
[Service]
Type=simple
User=cs2
Group=cs2
WorkingDirectory=/opt/cs2/server
ExecStart=/opt/cs2/start_server.sh
Restart=on-failure
RestartSec=15
LimitNOFILE=100000
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable cs29. Configurer le pare-feu
ufw allow 27015/tcp # RCON, queries
ufw allow 27015/udp # Gameplay
ufw allow 27020/udp # SourceTV
ufw allow 27005/udp # Client portfirewall-cmd --permanent --add-port=27015/tcp # RCON, queries
firewall-cmd --permanent --add-port=27015/udp # Gameplay
firewall-cmd --permanent --add-port=27020/udp # SourceTV
firewall-cmd --permanent --add-port=27005/udp # Client port
firewall-cmd --reload
# Vérifier
firewall-cmd --list-ports10. Démarrer et se connecter
systemctl start cs2
journalctl -u cs2 -fPour se connecter :
- Lancez CS2
- Ouvrez la console (~)
- Tapez : connect IP:27015
- Ou : connect IP:27015; password motdepasse
Commandes RCON
rcon_password votre_mot_de_passe_rcon
rcon changelevel de_mirage
rcon mp_restartgame 1
rcon kick "NomJoueur"
rcon ban "NomJoueur"
rcon mp_warmuptime 60
rcon mp_maxrounds 30Serveur CS2 prêt !
Votre serveur Counter-Strike 2 est maintenant opérationnel. Invitez vos amis et commencez les matchs !