Garry's Mod Server Configuration
GMod configuration has two layers: startup parameters decide how the server boots, while garrysmod/cfg/server.cfg applies persistent console variables. Keeping those layers separate makes “it works in the console but not after restart” failures much easier to diagnose.
Last verified: September 1, 2026. Facepunch's command-line reference warns that sv_lan must be set before startup or followed by a changelevel. A value added only to server.cfg can be too late for initial server behavior.
Recommended startup baseline
./srcds_run -game garrysmod -console \
+maxplayers 16 \
+gamemode sandbox \
+map gm_construct \
-port 27015Add one change at a time. Workshop collections, a GSLT, and a custom gamemode should be tested after a stock map boots.
Useful startup flags
| Flag | Purpose | When to use it |
|---|---|---|
-game garrysmod | Loads the GMod game directory. | Every GMod dedicated-server launch. |
+map MAP | Chooses the first map. | Use a stock map for troubleshooting. |
+gamemode MODE | Selects the gamemode. | Set it before testing gamemode-specific addons. |
+maxplayers N | Sets player slots. | Start small; size for Lua/addon load, not a generic maximum. |
+host_workshop_collection ID | Fetches a public/unlisted Workshop collection. | After vanilla setup passes; see the Workshop guide. |
-noaddons / -noworkshop | Disables addon or Workshop loading. | Isolation tests for startup and join failures. |
+sv_lan 1 | Starts as LAN-only. | Set at startup for LAN testing, not only in server.cfg. |
Keep server.cfg small and explicit
Create garrysmod/cfg/server.cfg with only settings you have verified for your gamemode:
hostname "My GMod Server"
sv_lan 0
sv_password ""
sv_cheats 0
sv_contact "admin@example.com"
// Keep RCON credentials out of public repositories and chat.
Use the Facepunch command reference for a variable's current behavior. Unknown, obsolete, or gamemode-specific cvars can be silently ignored or produce misleading diagnostics.
Passwords, RCON, and operator safety
sv_passwordcontrols player access; leave it empty for a public server.- Use a separate strong RCON secret, restrict access to trusted administrators, and rotate it if exposed.
- Publish truthful server name, gamemode, map, and rules. Facepunch's operator rules require accurate server information and prohibit malicious actions toward players.
Map and gamemode changes
Use changelevel MAP after changing a setting that needs a new map, including the documented sv_lan timing case. Keep a known-good map and gamemode pair in the startup script so a bad Workshop item cannot leave the server without a boot path.
Configuration troubleshooting
- If a setting disappears after restart, confirm it belongs in
server.cfgrather than the startup command. - If LAN/browser behavior is wrong, set
sv_lanbefore launch or changelevel, then retest. - If the stock map works but the custom stack fails, restart with
-noaddonsand-noworkshop. - If players join but see missing content, use the Workshop download guide; config alone cannot fix an absent delivery path.
Related Garry's Mod guides
- Dedicated-server setup with app 4020
- Workshop collections and addons
- Connection troubleshooting
- Admin commands and RCON safety
- Server cost and sizing
Need a managed config, Workshop collection, and backup workflow? Launch Garry's Mod hosting and keep these flags in your deployment notes.