On this page
- What does a Counter-Strike 2 server need?
- How do I prepare SteamCMD and the steam user?
- How do I download the server files?
- What is a Game Server Login Token and how do I get one?
- How do I configure the server?
- How do I run it as a service?
- Which ports does the game server need?
- How do I keep it running well?
- Questions
What does a Counter-Strike 2 server need?
Counter-Strike 2 ships its dedicated server inside the same app id as the game, 730, and SteamCMD can download it anonymously. The files are large (several tens of gigabytes), so disk space is the first thing to plan, followed by fast cores for the 64 tick simulation. A F2-4 instance (2 vCPU, 4 GB RAM, 128 GB NVMe) is a comfortable home for one competitive or casual server, with enough disk for the game files and later updates. Two or three servers side by side, or community servers with many plugins, fit better on F3-8.
Place the server where your players are, because ping decides how fair duels feel. The game servers page and the city list help with that choice.
How do I prepare SteamCMD and the steam user?
Follow the SteamCMD guide first: it enables the 32 bit architecture, installs the package and creates a steam system user with its home in /opt/steam. A quick check before downloading:
id steam
sudo -u steam -H /usr/games/steamcmd +quit
df -h /optKeeping the server under this account is important for a game that accepts connections from strangers. If a crafted packet ever finds a hole in the server binary, the attacker lands in an unprivileged account instead of root.
How do I download the server files?
Point SteamCMD at a new folder and fetch app 730 with validation. The first download takes a while; later updates only transfer changed files.
sudo -u steam -H /usr/games/steamcmd \
+force_install_dir /opt/steam/cs2 \
+login anonymous \
+app_update 730 validate \
+quit
ls /opt/steam/cs2/game/bin/linuxsteamrt64/cs2The server also needs the Steam client library in the 64 bit SDK folder. Without it, startup fails with a steamclient.so error:
sudo -u steam -H mkdir -p /opt/steam/.steam/sdk64
sudo -u steam -H find /opt/steam -path "*linux64/steamclient.so"
sudo -u steam -H ln -sf /opt/steam/.local/share/Steam/steamcmd/linux64/steamclient.so /opt/steam/.steam/sdk64/steamclient.so
ls -l /opt/steam/.steam/sdk64/If find prints a different location, use that path in the link.
What is a Game Server Login Token and how do I get one?
A GSLT ties a public server to a Steam account so that it appears in the community browser and players can connect from the internet. Without a token the server still runs, but only for LAN style play. Sign in on the Steam game server account management page (steamcommunity.com/dev/managegameservers), enter app id 730 and a memo such as the server name, and copy the token. The account must meet the requirements shown on that page, and each running server needs its own token.
Treat the token like a password: it lives in the launch command or an environment file readable only by the steam user, and you can regenerate it on the same page if it leaks.
How do I configure the server?
Settings go in game/csgo/cfg/server.cfg, which runs on every map load. Create it as the steam user:
sudo -u steam tee /opt/steam/cs2/game/csgo/cfg/server.cfg <<EOF
hostname "example.net scrims"
sv_password "joinpass"
rcon_password "use-a-long-random-string"
sv_lan 0
sv_cheats 0
mp_autoteambalance 1
EOFGame type and mode decide the ruleset: +game_type 0 +game_mode 1 is competitive, 0 0 is casual, and 1 2 is deathmatch. Workshop maps load with +host_workshop_map ID when the server has a token. Generate a strong RCON password with openssl rand -base64 24 and never reuse the join password.
How do I run it as a service?
A systemd unit updates the files on each start and brings the server back after a crash or reboot. Keep the token in a separate environment file:
echo "GSLT=PASTE_TOKEN_HERE" | sudo tee /etc/cs2.env
sudo chown root:steam /etc/cs2.env && sudo chmod 640 /etc/cs2.env
sudo tee /etc/systemd/system/cs2.service <<EOF
[Unit]
Description=Counter-Strike 2 dedicated server
After=network-online.target
Wants=network-online.target
[Service]
User=steam
Environment=HOME=/opt/steam
EnvironmentFile=/etc/cs2.env
WorkingDirectory=/opt/steam/cs2
ExecStartPre=/usr/games/steamcmd +force_install_dir /opt/steam/cs2 +login anonymous +app_update 730 +quit
ExecStart=/opt/steam/cs2/game/bin/linuxsteamrt64/cs2 -dedicated -usercon -port 27015 -maxplayers 10 +game_type 0 +game_mode 1 +map de_dust2 +sv_setsteamaccount \${GSLT}
Restart=on-failure
TimeoutStartSec=900
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now cs2
sudo journalctl -u cs2 -fThe escaped \${GSLT} keeps the variable literal inside the file, and systemd fills it from the environment file at start. Look for a line confirming the Steam connection and the map load.
Which ports does the game server need?
Players connect over UDP 27015. RCON tools talk to TCP 27015, so allow that only from your own address, or skip it and administer through the in-game console after logging in with rcon_password.
sudo ufw allow 27015/udp
sudo ufw allow from 203.0.113.50 to any port 27015 proto tcp
sudo ufw status
sudo ss -ulnp | grep 27015Test from a game client with the console command connect 198.51.100.24:27015; password joinpass. The ufw guide covers rule order and logging if you need more control.
How do I keep it running well?
Restart the service once a day at a quiet hour so it picks up updates, since Counter-Strike clients refuse to join a server on an older build. A small timer does it:
sudo tee /etc/systemd/system/cs2-restart.timer <<EOF
[Timer]
OnCalendar=*-*-* 05:00
[Install]
WantedBy=timers.target
EOF
sudo tee /etc/systemd/system/cs2-restart.service <<EOF
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart cs2
EOF
sudo systemctl daemon-reload && sudo systemctl enable --now cs2-restart.timerWatch the logs after each big game update; config variables occasionally change names. If players report a version mismatch, run the restart by hand. When a message says the token is invalid, check that it is not used by a second server and that it belongs to app 730.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Counter-Strike 2 dedicated server
Can I still host Counter-Strike: Source or 1.6?
Yes. Source uses app id 232330 and starts with srcds_run -game cstrike; the same SteamCMD workflow and separate user apply.
How many players can one server hold?
Set -maxplayers for your mode, usually 10 for competitive and up to around 32 for casual or deathmatch. More slots mean more CPU work per tick.
Do I need a token for a private practice server?
For connections over the internet the server should run with a GSLT. Without one it behaves like a LAN server.
Can plugins be added?
Community frameworks exist for CS2, such as Metamod together with CounterStrikeSharp. Install them as the steam user and expect to update them after big game patches.
Why does the download stop near the end?
Most often the disk filled up. Check df -h; a F2-4 has room for one install with spare space for patches.