01
Where to type commands: server console and RCON
The commands in this guide come from Counter-Strike 2's command list. They are written without a slash and can be typed in two places.
The server console. With the cs2 service from the guide creating a Counter-Strike 2 server, the server runs in the background, with no keyboard. For an admin session, stop the service and start the server in a tmux session, reusing your service's ExecStart line:
sudo systemctl stop cs2
sudo -iu cs2 tmux new -s cs2
cd /opt/cs2/serveur/game
./cs2.sh -dedicated -port 27015 -maxplayers 10 +game_alias competitive +map de_dust2 +sv_setsteamaccount GSLT_TOKEN
Leave the session without stopping the server with Ctrl+B then D, and come back with sudo -iu cs2 tmux attach -t cs2. Connecting to the VPS is explained in connecting to a VPS over SSH.
RCON (remote console). Add a long, unique password to game/csgo/cfg/server.cfg, as in the guide configuring a CS2 server, then restart the server:
rcon_password "un-long-mot-de-passe-unique"
In the game, enable the developer console in the game settings, open it, then type:
rcon_address 203.0.113.10:27015
rcon_password un-long-mot-de-passe-unique
rcon status
Replace the address with your VPS's. Valve describes rcon_address as the address used to send commands without being connected to the server: this is the most reliable method, since administrators report that RCON responds poorly from a match in progress on that same server. Each command is then typed with rcon in front. On Linux, if the server does not respond at all, add the -usercon option to the launch line, which many administrators report as necessary.
- The port: RCON uses port 27015 over TCP. Open it to your IP address only, for example
sudo ufw allow from 198.51.100.7 to any port 27015 proto tcp.
- No protection against guessing: the settings that banned wrong passwords in older Source games (
sv_rcon_banpenalty, sv_rcon_maxfailures) are development-only in CS2. The firewall is your real protection.
- Without RCON: leave
rcon_password empty and the port closed if you use the console or a plugin.
02
Maps, game mode and Workshop
changelevel de_mirage: changes map while keeping players connected;
map de_mirage: loads a new map;
maps: shows the list of available maps.
The game mode is changed with game_alias (competitive, casual, wingman, deathmatch, custom) or with the game_type and game_mode pair. It only applies when a map loads:
game_alias deathmatch
changelevel de_mirage
The full table of values and each mode's rule files are in configuring a CS2 server.
Workshop maps. A map's number is the number after ?id= in its Workshop page address.
host_workshop_map 123456789: downloads the latest version of the map and runs it on the server;
host_workshop_collection 123456789: hosts a public collection as a map group;
ds_workshop_listmaps: lists the Workshop maps on the server;
ds_workshop_changelevel map_name: switches to one of those maps by name.
To start straight on a Workshop map or collection, put +host_workshop_map or +host_workshop_collection followed by the number on the launch line, instead of +map. The first download of a large collection can take a while.
03
Managing the match and bots
mp_restartgame 1: restarts the game after the given number of seconds;
mp_warmup_end: ends warmup immediately; mp_warmup_start starts it again;
mp_warmup_pausetimer 1: keeps the server in warmup with no time limit, while you wait for every player; 0 restarts the countdown;
mp_pause_match: pauses the match at the next freeze time (the start of a round); mp_unpause_match resumes it;
mp_swapteams: swaps the two teams and restarts the game; mp_scrambleteams shuffles them and restarts the game.
Bots:
bot_add, bot_add_t, bot_add_ct: add a bot, to the chosen team for the last two;
bot_kick: removes bots, all of them or those matching the given criteria (team, name);
bot_quota 0: sets the total number of bots in the game;
bot_difficulty 2: sets their skill, from 0 (easy) to 3 (expert).
To keep these settings after a map change, put them in your mode's gamemode_<mode>_server.cfg file rather than in the console.
sv_cheats. sv_cheats 1 allows commands flagged as cheats, such as noclip (flying through walls) or god (invincibility). The change is announced to players. Keep it for practice servers and set sv_cheats 0 afterwards.
04
Players: status, kick and kickid
status: shows the server status and the list of connected players, with their number (userid);
kick Pseudo: kicks a player by name;
kickid 3 "AFK trop longtemps": kicks a player by number, with a message. Safer than a name with spaces or special characters;
say Redémarrage dans 5 minutes: sends a message to all players.
A kicked player can come straight back. The base game has no usable ban: the commands inherited from CS:GO (banid, banip, writeid) are development-only in the public version of CS2. To ban for good you need an admin plugin (next section), or a password with sv_password for a private server.
If a command answers "Unknown command", check its spelling; for startup and connection errors, see CS2 server errors.
05
Admin commands from CounterStrikeSharp plugins
In-game admin commands (bans, admin menu, chat commands) are not part of CS2. They need Metamod:Source, then CounterStrikeSharp, then an admin plugin. Installation is covered in CounterStrikeSharp on CS2.
CounterStrikeSharp on its own handles permissions, with no punishment commands. Admins are declared in addons/counterstrikesharp/configs/admins.json, with their Steam ID and permissions starting with @:
{
"Pseudo": {
"identity": "76561190000000000",
"flags": ["@css/generic", "@css/kick", "@css/ban", "@css/changemap"]
}
}
Its own commands: css_plugins list (loaded plugins), css_admins_reload (reread the file after a change) and css_admins_list (admins and permissions). A plugin command named css_kick can also be typed in chat as !kick, or /kick to keep it hidden from other players (the PublicChatTrigger and SilentChatTrigger settings in core.json).
An admin plugin, such as CS2-SimpleAdmin, adds the punishment commands. Its documentation requires, on top of CounterStrikeSharp, the PlayerSettings, AnyBaseLibCS2 and MenuManagerCS2 plugins, plus a MySQL database (SQLite is experimental). Its main commands:
css_admin: opens the admin menu;
css_kick #3 "raison": kicks a player, by number (#) or by name;
css_ban #3 1440 "raison": bans for a duration in minutes, 0 for a permanent ban; css_addban bans an offline Steam ID, css_unban lifts the ban;
css_gag and css_mute: block a player's text chat or voice;
css_map, css_wsmap, css_rr: change map, start a Workshop map, restart the game;
css_rcon status: runs a server command from the game, with the @css/rcon permission.
Command names and permissions depend on the plugin and its version: follow its documentation, and keep CounterStrikeSharp's FollowCS2ServerGuidelines option enabled so you do not put your GSLT tokens at risk.
06
On CloudFive
CloudFive has no ready-made Counter-Strike 2 plan: the server is installed on a VPS, and you administer it as in this guide. The Ryzen VPS, from €5.99 per month, is well suited:
- an AMD Ryzen 9 9950X, with DDR5 memory and NVMe storage: the CS2 server computes most of the match on one core; pick a tier with enough disk for the game, which needs 65 GB according to Valve;
- a Linux container (LXC) with root access and a dedicated IPv4 address;
- basic anti-DDoS protection included (see protecting a game server from DDoS).
The servers are in France, monthly with no commitment, with support in French 7 days a week by ticket and on Discord. To choose the VPS size, see which VPS for a game server; for the ports to open, game server ports.
07
Frequently asked questions
How do I use RCON on a CS2 server?
Put rcon_password followed by a long password in server.cfg and restart the server. In the game console, type rcon_address followed by the server's address and port 27015, then rcon_password and the password, and finally rcon followed by the command. Valve intends rcon_address for sending commands without being connected to the server.
How do I change the map on a Counter-Strike 2 server?
Type changelevel followed by the map name in the server console or over RCON, for example changelevel de_mirage. For a Workshop map, use host_workshop_map followed by its number, and for a collection host_workshop_collection.
How do I ban a player on a CS2 server?
The base game can only kick, with kick or kickid: CS:GO's ban commands are development-only in CS2. To ban, install CounterStrikeSharp and an admin plugin such as CS2-SimpleAdmin, which adds css_ban with a duration in minutes.
How do I end warmup on a CS2 server?
Type mp_warmup_end in the server console or over RCON. To keep warmup going with no limit while you wait for every player, use mp_warmup_pausetimer 1, then mp_warmup_end once everyone is there.
How do I become an admin on a CS2 server?
CS2 has no in-game admin list. With CounterStrikeSharp, add your Steam ID and your permissions, such as @css/generic or @css/ban, to configs/admins.json, then type css_admins_reload. Punishment commands then come from an admin plugin.