Counter-Strike 2 server.cfg generator

server.cfg is a list of console commands, and the catch is that some settings cannot be applied from it at all.

Start from a preset

Visual Settings

source Format
Identity

Server name in the browser. Quote it — this format separates command and value with a space, not an equals sign.

Gameplay

Rounds per map. 0 means unlimited.

Minutes per map. 0 disables the time limit.

Seconds of buy time at the start of each round.

Round length in minutes. Competitive uses 1.92, which is 115 seconds.

Money cap per player.

Team damage.

Lets both teams hear each other on voice.

Cheat commands. Leave off on anything public.

Players & Access

Join password. Blank means public.

Network

Game server login token from your Steam account. Without it the server works but never appears in the community browser — this, not your ports, is usually why a reachable server is unlisted.

LAN mode. On, the server will not answer external queries at all.

RCON & Query

Remote console password. Change it, and do not leave the RCON port open to the internet.

server.cfg

rcon_passwordThis is still the example RCON password. Change it, and keep the RCON port off the public internet.
sv_setsteamaccountWithout a game server login token the server will not appear in the public browser, however your ports are configured.
hostname "Spawnly CS2"
sv_password ""
rcon_password "changeme"
sv_setsteamaccount 
mp_maxrounds 24
mp_timelimit 40
mp_freezetime 15
mp_roundtime 1.92
mp_maxmoney 16000
mp_friendlyfire 1
sv_alltalk 0
sv_cheats 0
sv_lan 0

How server.cfg syntax works

Each line is a command and its value separated by a space, not an equals sign. Values with spaces need quotes; numbers do not. Booleans are 1 and 0. An unrecognised command produces no error — the console simply moves on, which is why typos are so easy to miss here.

The mistake that costs people hours

Several settings only take effect if they are given at launch rather than in server.cfg, because the server has already used them by the time it reads the file. The starting map is the usual example. If a setting works when typed into the console but not from server.cfg, that is what you are hitting.

Support & Help