The launch line
These are set once at start. On Flux they are the fields of Deployment Settings, and a change is applied with a redeploy.
| Setting | Launch option | Notes |
|---|---|---|
| Server name | +hostname "..." | What the server browser shows |
| Gamemode | +gamemode sandbox | The gamemode's folder name: terrortown for TTT, darkrp for DarkRP |
| Map | +map gm_construct | Without .bsp |
| Max players | +maxplayers 16 | Up to 128 |
| Workshop collection | +host_workshop_collection <id> | Downloaded on every start |
| Join password | +sv_password "..." | Empty for a public server |
| RCON password | +rcon_password "..." | Needed for any RCON tool |
| Steam token | +sv_setsteamaccount <token> | Optional, a better server-browser ranking |
server.cfg: sandbox limits
Per-player limits, and the main tool against lag on a build server. The defaults: sbox_maxprops 200, sbox_maxragdolls 10, sbox_maxvehicles 4, sbox_maxsents 100, sbox_maxeffects 200, sbox_maxballoons 100, sbox_maxthrusters 50, sbox_maxwheels 50, sbox_maxlamps 3, sbox_maxlights 5. sbox_noclip and sbox_playershurtplayers switch noclip and PvP.
server.cfg: Trouble in Terrorist Town
- ttt_roundtime_minutes 10, ttt_preptime_seconds 30 and ttt_firstpreptime 60 set the round clock; ttt_haste 1 starts it short and adds time with every death.
- ttt_round_limit 6 and ttt_time_limit_minutes 75 decide when the map changes.
- ttt_traitor_pct 0.25, ttt_detective_pct 0.13 and ttt_detective_min_players 8 decide the roles.
- ttt_karma 1 makes players who kill innocents deal less damage.
server.cfg: downloads and the browser
- sv_loadingurl: a web page shown while players join.
- sv_downloadurl: a FastDL web server for custom content that is not on the Workshop.
- sv_region: the region the browser files the server under (255 is the world).
- sv_allowcslua 0: keep it off unless you need it; it lets players run their own Lua.
Frequently asked questions
Where is server.cfg on a Garry's Mod server?
In garrysmod/cfg/server.cfg. A fresh install does not have one; the server runs without it. On Flux the Server Settings tab creates it on the first save.
Why does my hostname in server.cfg not change?
It does, and it overrides the one on the launch line: server.cfg runs after the launch line, on every map load. Keep the name in one place only.
Do I need to restart after changing server.cfg?
A map change or a restart applies it, because srcds reads server.cfg when a map loads. The RCON command exec server.cfg applies most cvars on the spot.