Published on · last updated on
Where the server.cfg is and when it takes effect
The server.cfg sits in the server's cfg directory and is run automatically at startup - but before the mode configs are loaded. That is the decisive point.
Counter-Strike 2 loads configurations roughly in this order:
- command-line startup parameters
server.cfg- the mode config matching
game_modeandgame_type - everything you reload yourself via
exec
This leads to the most common disappointment: a value you write into the server.cfg can be overwritten by the mode config. If you want to be sure, reload your values at the end via a config of your own.
CS2 server hosting from €5.99 / month
Prepaid without a contract, DDoS protection up to 250 Gbit/s.
View plans & pricesThe basic setup
A sensible minimum for a public server:
hostname "My CS2 Server"
sv_setsteamaccount "YOUR_GSLT"
rcon_password "secure-password"
sv_password ""
sv_lan 0
sv_cheats 0
sv_setsteamaccount- without a valid token, the server is not publicly visible. See create a GSLT.sv_lan 0- if the value stays at 1, the server is only reachable in the local network.sv_password ""- leave it empty for an open server, otherwise nobody gets in without a password.rcon_password- should be set and not passed on. See RCON commands.
Game rules: rounds, time and money
The values that determine the flow of the game. They usually belong in a config of their own, because otherwise the mode config overwrites them:
| Convar | Meaning |
|---|---|
mp_maxrounds | rounds until the end of the game |
mp_overtime_enable | overtime in case of a tie |
mp_roundtime / mp_roundtime_defuse | round length in minutes |
mp_freezetime | buy phase at the start of the round |
mp_startmoney / mp_maxmoney | starting and maximum money |
mp_friendlyfire | damage within your own team |
mp_autoteambalance | automatic team balancing |
For changes to round values to take effect immediately, mp_restartgame 1 helps - otherwise many only apply at the next half.
Your own configs via exec
The clean way for everything that should not be overwritten: create a file of your own in the cfg folder and load it specifically.
exec myserver.cfg
It is practical to keep one file per mode of operation - for example competitive.cfg, practice.cfg and dm.cfg - and run the matching one when switching. A ready-made practice config is shown in create a practice config.
Two rules that save a lot of trouble: do not forget the file extension and give the file name without a path - exec searches relative to the cfg directory.
Uploading and safely changing configs
The files sit in the cfg directory of the server installation, i.e. under game/csgo/cfg/. You edit them via the WebFTP file manager or via SFTP - the same access you use to manage demos and plugins.
- Make a copy before every larger change. A second file next to the active one costs nothing and saves the evening if in doubt. There are no automatic backups; backups are self-service throughout.
- Use plain text files. An editor that writes formatting into the file turns a valid config into an unreadable one.
- Change one thing per round. Anyone who touches five values at once and then sees an error searches five times as long.
- Use meaningful file names.
competitive.cfganddm.cfgstill tell you in six months what is inside -test2.cfgdoes not.
A changed file does not take effect by itself: the server still holds the old version. Reload it via exec or restart the server. Troubleshooting fails surprisingly often exactly here - the file has long been correct, it just was never read in again.
Test a config before you build it in permanently
The fastest way to a config that does what it should leads via RCON: set values while running, check the behavior and only then take them over into the file. The reverse way - write, restart, wonder - costs a server start for every attempt.
- Set the value via RCON and check in the game whether it brings the desired result.
- Enter the convar name without a value - the server outputs the current state.
- For round values, follow with
mp_restartgame 1, otherwise they only take effect at the next half. - Take the confirmed value over into the file and reload the config once completely.
- Restart the server and cross-check - only that proves the value survives the load order.
The last step is the most important, because values set via RCON usually do not survive the next map change. What is meant to apply permanently has to come from a file that is read at every start.
The whole practice builds on this separation: one mode of operation, one file, one command to switch. How this results in one config each for competitive, practice and deathmatch and how switching works on a match day is shown in the tournament and LAN setup. Bot values belong in a file of their own for the same reason, see set up bots.
Common mistakes
- The value is overwritten - it is in the server.cfg, and the mode config sets it again afterwards. Solution: reload via exec.
- Unclosed quotation marks in the
hostname- makes the following lines ineffective. - Comments with the wrong character - in CS2 configs, comments start with
//. - The convar no longer exists - CS2 removed some CS:GO values, above all everything around the tick rate. See sub-tick explained.
Whether a value has actually arrived, you check in the console by entering the convar name without a value - the server then outputs the current state.
Frequently asked questions
Rent your own CS2 server
Sub-tick optimized hardware, unlimited slots, Workshop maps, Metamod:Source & CounterStrikeSharp - prepaid, made in Germany.
View plans & pricesCS2 server hosting
from €5.99 / month
Prepaid without a contract, DDoS protection up to 250 Gbit/s, hosted in Frankfurt am Main.
View plans & pricesRead more
- CS2 server - overview
- Create & enter a GSLT
- RCON commands
- Practice config
- Sub-tick explained
- All CS2 guides
- Set up a Wingman server
- Set up a Rush server
Discover more