Counter-Strike 2/Dedicated Servers: Difference between revisions
(→Launch Parameters: added stub as table is not complete) |
(Clarify GSLT) |
||
(24 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar|title=Counter-Strike 2 - Dedicated Servers}} | ||
{{update}} | |||
[[File:Event Header - Counter-Strike 2.png|thumb|550px|right|Counter-Strike 2 - Event Header]] | |||
This page outlines how to setup and run an {{cs2|4}} Dedicated Server. | This page outlines how to setup and run an {{cs2|4}} Dedicated Server. | ||
Line 5: | Line 8: | ||
== Recommended system requirements == | == Recommended system requirements == | ||
{{stub|section=1}} | {{stub|section=1}} | ||
=== Hardware === | |||
* Minimum RAM: 2GB | * Minimum RAM: 2GB | ||
* Storage: | * Storage: 65GB | ||
* | * CPU: x86-64-v2 (with POPCNT/SSE4.2) | ||
=== Operating System === | |||
* Windows 10/11 | |||
* Linux (requires Glibc 2.31) | |||
{{note|The Glibc requirement means a minimum of Ubuntu 20.04, Debian 11, or Enterprise Linux 9 is required.}} | {{note|The Glibc requirement means a minimum of Ubuntu 20.04, Debian 11, or Enterprise Linux 9 is required.}} | ||
== Download the CS2 Dedicated server == | == Download the CS2 Dedicated server == | ||
{{note|The {{cs2|1|nt=0}} dedicated server and game client have been merged together (appid 730). Previously the {{csgo|1|nt=0}} client (appid 730) and dedicated server (appid 740) were separate. {{important|The total size of {{cs2|1}} download is approximately | {{note|The {{cs2|1|nt=0}} dedicated server and game client have been merged together (appid 730). Previously the {{csgo|1|nt=0}} client (appid 730) and dedicated server (appid 740) were separate. {{important|The total size of {{cs2|1}} download is approximately 60GB}}}} | ||
This describes the process of installing/updating the CS2 dedicated server. These steps are required every time the game is updated. To automate this process for future updates, see [[SteamCMD#Automating SteamCMD]]. | This describes the process of installing/updating the CS2 dedicated server. These steps are required every time the game is updated. To automate this process for future updates, see [[SteamCMD#Automating SteamCMD]]. | ||
Line 21: | Line 26: | ||
2. Start SteamCMD. At the {{code|Steam>}} prompt, set your CS2 Dedicated Server install directory. | 2. Start SteamCMD. At the {{code|Steam>}} prompt, set your CS2 Dedicated Server install directory. | ||
{{bug|On some Linux distributions the path cannot contain any capital letters}} | {{bug|hidetested=1|On some Linux distributions the path cannot contain any capital letters}} | ||
Examples: | Examples: | ||
Line 30: | Line 35: | ||
force_install_dir /full/path/to/cs2-ds/ | force_install_dir /full/path/to/cs2-ds/ | ||
3. Install or Update CS2. | 3. Login into Steam | ||
You need to login into Steam anonymously, or using your account. | |||
Examples: | |||
login anonymous | |||
4. Install or Update CS2. | |||
If this is your first time installing or if you are trying to verify the integrity of the server files: | If this is your first time installing or if you are trying to verify the integrity of the server files: | ||
app_update 730 validate | app_update 730 validate | ||
Line 39: | Line 50: | ||
== Registering Game Server Login Token == | == Registering Game Server Login Token == | ||
In order for other players to be able to join your server, you must generate and include the Game Server Login Token (GSLT). | |||
To create one, go to http://steamcommunity.com/dev/managegameservers and generate a token using 730 for the game ID. | |||
Once you have a GSLT, include it in your launch parameters with '''+sv_setsteamaccount <TOKEN>''' while you launch it. | |||
For example | |||
.\cs2.exe -dedicated +sv_setsteamaccount AD2FA80401F0A64821F91AA62671EF65 +map de_dust2 | |||
== Starting the Server == | == Starting the Server == | ||
Line 46: | Line 63: | ||
{{note|Default gamemode when starting the server is competitive. See [[#Game_Modes_&_Types]] for all game modes}} | {{note|Default gamemode when starting the server is competitive. See [[#Game_Modes_&_Types]] for all game modes}} | ||
{{note|You need to add the parameter -dedicated for it to launch the dedicated server, else it launches the game.}} | {{note|You need to add the parameter -dedicated for it to launch the dedicated server, else it launches the game.}} | ||
=== {{ | {{note|Steam needs to be installed on the system in order to launch the dedicated server.}} | ||
=== {{win|4}} === | |||
Head to the folder where you downloaded the application and open a terminal there. | Head to the folder where you downloaded the application and open a terminal there. | ||
Line 62: | Line 81: | ||
./cs2 -dedicated +map de_dust2 | ./cs2 -dedicated +map de_dust2 | ||
== | == Command-Line Parameters == | ||
{{stub|section=1}} | {{stub|section=1}} | ||
A list of useful [[Command_line_options|command-line parameters]] related to Counter-Strike 2 dedicated servers. | |||
Command-line parameters are additional arguments specified before the program starts and can be set by appending them after the {{code|./cs2}}/{{code|.\cs2.exe}} executable file. | |||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
! Parameter !! Description | ! Parameter !! Example !!Description | ||
|- | |- | ||
| {{code|-dedicated}} || Allows Counter-Strike 2 to launch as a dedicated server. | | {{code|-dedicated}} || n/a || Allows Counter-Strike 2 to launch as a dedicated server. | ||
|- | |- | ||
| {{code|-ip}} || Allows the server IP to be set. Useful if a CS2 server needs to be bound to a specific IP address. | | {{code|-ip}} || {{code|-ip 1.2.3.4}} || Allows the server IP to be set. Useful if a CS2 server needs to be bound to a specific IP address. | ||
|- | |- | ||
| {{code|-insecure}} || Allows VAC to be disabled. | | {{code|-insecure}} || n/a || Allows VAC to be disabled. | ||
|- | |- | ||
| {{code|-maxplayers}} || Set the number of slots for the game server | | {{code|-maxplayers}} || {{code|-maxplayers 64}} || Set the number of slots for the game server. | ||
|- | |- | ||
| {{code|-port}} || Set the game server game/query port. | | {{code|-port}} || {{code|-port 27015}} || Set the game server game/query port. | ||
|} | |||
== Console Variables (cvars) == | |||
{{stub|section=1}} | |||
A list of useful [[Console_variable|cvars]] related to Counter-Strike 2 dedicated servers. | |||
{{code|cvars}} can be loaded from a config file, by including them with command-line parameters using {{code|+}} e.g {{code|+map de_dust2}} or from the console. | |||
{| class="wikitable sortable" | |||
|- | |||
! Console Variable (cvar) !! Example !! Description | |||
|- | |||
| {{code|hostname}} || {{code|hostname "My CS2 Server"}} || Hostname for server. | |||
|- | |||
| {{code|map}} || {{code|map de_dust2}} || map <mapname> :Load a new map. | |||
|- | |||
| {{code|game_alias}} || {{code|game_alias deathmatch}} || Set the configuration of game type and mode based on game alias like 'deathmatch'. | |||
|- | |||
| {{code|sv_lan}} || {{code|sv_lan 0}} || Server is a lan server ( no heartbeat, no authentication, no non-class C addresses ). | |||
|- | |||
| {{code|sv_logfile}} || {{code|sv_logfile 1}} || Log server information in the log file. | |||
|} | |} | ||
Line 141: | Line 182: | ||
=== {{linux|4}} === | === {{linux|4}} === | ||
==== | ==== Failed to load module '/home/your_user/.steam/sdk64/steamclient.so' ==== | ||
This is a common issue with a fairly easy fix. | This is a common issue with a fairly easy fix. | ||
The reason for this error is that [[SteamCMD]] doesnt place the file in the folder it should, as the games typically look for it there. So what you need | The reason for this error is that [[SteamCMD]] doesnt place the file in the folder it should, as the games typically look for it there. So what you need to do is the following. And you might even have to create the ~/.steam/sdk64 directories. | ||
Create a symlink (shortcut) to the file like this: | |||
ln -s /home/your_user/PATHTOYOUR/steamcmd/linux64/steamclient.so /home/your_user/.steam/sdk64/ | |||
Replace {{code|your_user}} with the username you are using. | Replace {{code|your_user}} with the username you are using. | ||
{{note|If you are using multiple steam instances make sure the accounts that run them have also done the steps for above.}} | {{note|If you are using multiple steam instances make sure the accounts that run them have also done the steps for above.}} | ||
=== {{win|4}} === | |||
==== Failed to initialize Steamworks SDK for gameserver. Failed to load module 'C:\Program Files (x86)\Steam\steamclient64.dll' ==== | |||
In order to lauch the current version steam has to be installed. | |||
{{note|The terminal closes right after getting this error which makes it hard to identify.}} | |||
{{Cs2-navbox}} |
Latest revision as of 23:21, 31 July 2025

Remember to check for any notes left by the tagger at this article's talk page.
This page outlines how to setup and run an Counter-Strike 2 Dedicated Server.
Recommended system requirements
Hardware
- Minimum RAM: 2GB
- Storage: 65GB
- CPU: x86-64-v2 (with POPCNT/SSE4.2)
Operating System
- Windows 10/11
- Linux (requires Glibc 2.31)

Download the CS2 Dedicated server


This describes the process of installing/updating the CS2 dedicated server. These steps are required every time the game is updated. To automate this process for future updates, see SteamCMD#Automating SteamCMD.
1. Download and install SteamCMD.
2. Start SteamCMD. At the Steam> prompt, set your CS2 Dedicated Server install directory.

Examples:
- Windows:
force_install_dir c:\cs2-ds\ force_install_dir .\cs2-ds\
- Linux:
force_install_dir /full/path/to/cs2-ds/
3. Login into Steam You need to login into Steam anonymously, or using your account.
Examples:
login anonymous
4. Install or Update CS2. If this is your first time installing or if you are trying to verify the integrity of the server files:
app_update 730 validate
If this is simply an update to an existing CS2 dedicated server:
app_update 730
4. Once finished, type quit at the Steam> prompt to properly log off of the Steam servers.
Registering Game Server Login Token
In order for other players to be able to join your server, you must generate and include the Game Server Login Token (GSLT).
To create one, go to http://steamcommunity.com/dev/managegameservers and generate a token using 730 for the game ID.
Once you have a GSLT, include it in your launch parameters with +sv_setsteamaccount <TOKEN> while you launch it.
For example
.\cs2.exe -dedicated +sv_setsteamaccount AD2FA80401F0A64821F91AA62671EF65 +map de_dust2
Starting the Server




Windows
Head to the folder where you downloaded the application and open a terminal there.
Head to the executable for the server that is stored in game/bin/win64/cs2.exe
- But don't click on it as it will just launch the game.
In the terminal run the following command to start the server:
.\cs2.exe -dedicated +map de_dust2
Linux
Head to the folder where you downloaded the application.
Head to the executeable that is stored in game/bin/linuxsteamrt64/cs2
Run the following command to start the server:
./cs2 -dedicated +map de_dust2
Command-Line Parameters
A list of useful command-line parameters related to Counter-Strike 2 dedicated servers. Command-line parameters are additional arguments specified before the program starts and can be set by appending them after the ./cs2/.\cs2.exe executable file.
Parameter | Example | Description |
---|---|---|
-dedicated | n/a | Allows Counter-Strike 2 to launch as a dedicated server. |
-ip | -ip 1.2.3.4 | Allows the server IP to be set. Useful if a CS2 server needs to be bound to a specific IP address. |
-insecure | n/a | Allows VAC to be disabled. |
-maxplayers | -maxplayers 64 | Set the number of slots for the game server. |
-port | -port 27015 | Set the game server game/query port. |
Console Variables (cvars)
A list of useful cvars related to Counter-Strike 2 dedicated servers.
cvars can be loaded from a config file, by including them with command-line parameters using + e.g +map de_dust2 or from the console.
Console Variable (cvar) | Example | Description |
---|---|---|
hostname | hostname "My CS2 Server" | Hostname for server. |
map | map de_dust2 | map <mapname> :Load a new map. |
game_alias | game_alias deathmatch | Set the configuration of game type and mode based on game alias like 'deathmatch'. |
sv_lan | sv_lan 0 | Server is a lan server ( no heartbeat, no authentication, no non-class C addresses ). |
sv_logfile | sv_logfile 1 | Log server information in the log file. |
Game Modes & Types

Remember to check for any notes left by the tagger at this article's talk page.


Competitive: game_alias competitive <- sets both game mode and game type commands game_mode 1 game_type 0 Wingman game_alias wingman <- sets both game mode and game type commands game_mode 2 game_type 0 Casual game_alias casual <- sets both game mode and game type commands game_mode 0 game_type 0 Deathmatch game_alias deathmatch <- sets both game mode and game type commands game_mode 2 game_type 1 Custom game_alias custom <- sets both game mode and game type commands game_mode 0 game_type 3
Tools and Helpers
Docker
If your server is running Docker, you can simply use:
docker run -d --name=cs2 -p 27015:27015 -p 27020:27020 joedwards32/cs2
The container will automatically update the game on startup, so if there is a game update just restart the container.
The config is located within the container here: /home/steam/cs2-dedicated/cs2/cfg
You can find the associated Docker Hub page
CS2 Multiserver
A launch and update script for Linux and WSL to run multiple game servers on one machine. It was originally made to run CS:GO LAN tournaments as painlessly and efficiently as possible.
It includes:
- Guided setup and game update (cs2-server setup, cs2-server update)
- Game files are shared between instances, saving disk space and bandwidth
- Additional control upon launch via environment variables (MAP="de_inferno" cs2-server @lan01 start)
- Console access and support for logfiles
More Info and Download: CS2 Multiserver on GitHub. Testing, feedback and contributions are welcome!
Advanced Configuration
[Todo]
Troubleshooting
Linux
Failed to load module '/home/your_user/.steam/sdk64/steamclient.so'
This is a common issue with a fairly easy fix.
The reason for this error is that SteamCMD doesnt place the file in the folder it should, as the games typically look for it there. So what you need to do is the following. And you might even have to create the ~/.steam/sdk64 directories.
Create a symlink (shortcut) to the file like this:
ln -s /home/your_user/PATHTOYOUR/steamcmd/linux64/steamclient.so /home/your_user/.steam/sdk64/
Replace your_user with the username you are using.

Windows
Failed to initialize Steamworks SDK for gameserver. Failed to load module 'C:\Program Files (x86)\Steam\steamclient64.dll'
In order to lauch the current version steam has to be installed.

|