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).
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
quit2. 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_TOKENCode: Select all
.\cs2.exe -dedicated +map de_dust2 +sv_setsteamaccount YOUR_TOKENLaunch 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.
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.
Source
[1] Counter-Strike 2 Dedicated Servers, Valve Developer Community