Setting up a Counter-Strike 2 dedicated server from Valve's docs: SteamCMD, login token, launch line

A forum for players to discuss different multiplayer servers, share server IPs, and organize games.
Post Reply
ice
Site Admin
Posts: 35
Joined: Tue Aug 27, 2024 5:17 am

Setting up a Counter-Strike 2 dedicated server from Valve's docs: SteamCMD, login token, launch line

Post by ice »

This is a plain walkthrough for getting a Counter-Strike 2 dedicated server running, based on Valve's own documentation. It covers the install, the login token that lets other players join, and the launch line.

Before you start
  • Operating system: Windows 10/11, or Linux with Glibc 2.31. Valve notes that this means Ubuntu 20.04, Debian 11 or Enterprise Linux 9 at minimum.
  • Disk space: Valve lists the download at roughly 60GB.
  • A Steam account to generate the login token (explained below).
1. Install the server with SteamCMD
The CS2 dedicated server and the game client are one package now, Steam app ID 730. In the old CS:GO setup the client was 730 and the server was 740, so older tutorials may point you at the wrong ID.

At the Steam> prompt in SteamCMD:

Code: Select all

force_install_dir /full/path/to/cs2-ds/
login anonymous
app_update 730 validate
quit
Use "validate" on the first install or when you want to check file integrity. For a plain update later, run "app_update 730" without it. You need to repeat the update every time the game is updated. Valve also notes that on some Linux distributions the install path cannot contain capital letters, so keep it lowercase.

2. Create a Game Server Login Token (GSLT)
Other players cannot join your server without one. Go to steamcommunity.com/dev/managegameservers, generate a token with 730 as the game ID, and pass it at launch with +sv_setsteamaccount followed by the token. Treat the token as private.

3. Start the server
On Linux, go into the "game" subfolder of your install and use the cs2.sh script. Do not run the binary in game/bin/linuxsteamrt64/ directly, because the script does setup the server needs.

Code: Select all

./cs2.sh -dedicated +map de_dust2 +sv_setsteamaccount YOUR_TOKEN
On Windows, the executable is game/bin/win64/cs2.exe, and you launch it from a terminal:

Code: Select all

.\cs2.exe -dedicated +map de_dust2 +sv_setsteamaccount YOUR_TOKEN
Without the -dedicated parameter, the command launches the game client instead of a server. Valve also says Steam needs to be installed on the machine, and that the server starts in competitive mode by default.

Launch parameters and cvars from Valve's page
  • -ip 1.2.3.4 binds the server to a specific IP address.
  • -port 27015 sets the game and query port.
  • -maxplayers 64 sets the number of slots.
  • -insecure turns VAC off.
  • hostname "My CS2 Server" sets the server name.
  • sv_lan 0 makes the server a normal internet server. With sv_lan set to 1 it is a LAN server with no heartbeat and no authentication.
  • sv_logfile 1 writes server information to a log file.
Valve marks the parameter and cvar sections of that page as stubs, so treat them as a starting point rather than a full list.

If players cannot find or join the server
  • Check that the launch line includes a valid token after +sv_setsteamaccount.
  • Check that -dedicated is present.
  • Check that the port you set with -port is open on your firewall and router. Valve points to its general SRCDS page for the ports to forward.
If you run a server and want to compare launch lines or config files, post them below. Remove your token before pasting anything.

Source
[1] Counter-Strike 2 Dedicated Servers, Valve Developer Community
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests