This guide will walk you through setting up a Counter-Strike 2 (CS2) server using LinuxGSM on a Linux system.
curl
, wget
, tar
, lib32gcc-s1
).Ensure your system is up to date:
sudo apt update && sudo apt upgrade -y
Install the required dependencies for SteamCMD and LinuxGSM:
sudo apt install curl wget tar lib32gcc-s1
SteamCMD is required to download the CS2 server files.
mkdir ~/steamcmd && cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
./steamcmd.sh
Exit SteamCMD by typing quit
.
LinuxGSM simplifies the installation and management of game servers.
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh
./linuxgsm.sh cs2server
./cs2server install
This will download and set up the CS2 server files using SteamCMD.
nano ~/lgsm/config-lgsm/cs2server/cs2server.cfg
hostname
: Server name.rcon_password
: Remote console password.sv_password
: Server password (if you want a private server).map
: Default map (e.g., de_dust2
).Start the server using LinuxGSM:
./cs2server start
Check the server status:
./cs2server details
Allow traffic on the default CS2 port (UDP 27015):
sudo ufw allow 27015/udp
sudo ufw reload
connect YOUR_SERVER_IP:27015
Replace YOUR_SERVER_IP
with your server's public IP address.
To ensure the server starts automatically on system reboot, create a systemd service:
sudo nano /etc/systemd/system/cs2server.service
[Unit]
Description=Counter-Strike 2 Server
After=network.target
[Service]
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME
ExecStart=/home/YOUR_USERNAME/cs2server start
ExecStop=/home/YOUR_USERNAME/cs2server stop
Restart=always
[Install]
WantedBy=multi-user.target
Replace YOUR_USERNAME
with your Linux username.
sudo systemctl enable cs2server
sudo systemctl start cs2server
~/lgsm/log
for errors.server.cfg
file located in the CS2 server directory.Let me know if you need further assistance!