Advertisement

Generate a Garry's Mod server.cfg

Garry's Mod loads server.cfg like other Source servers do, yet the settings people usually care about are controlled by the gamemode, not the engine.

Start from a preset

Visual Settings

source Format
Identity

Server name in the browser.

Gameplay

Props each player may spawn. Without a sensible limit, players will find the ceiling for you and take the server with it.

Ragdolls per player.

Vehicles per player.

Lets players noclip. Sandbox-only — these limits do nothing on other gamemodes.

Players cannot be hurt.

Everyone hears everyone on voice.

Cheat commands. Note that gamemodes and addons often set their own values after this file runs, so a setting here can be overridden at runtime.

Players & Access

Join password.

Slot limit. Note this is normally set on the command line rather than here.

Network

Game server login token, required for the server to appear in the public browser.

RCON & Query

Remote console password. Change it.

server.cfg

rcon_password — This is still the example RCON password. Change it, and keep the RCON port off the public internet.
sv_setsteamaccount — Without a game server login token the server will not appear in the public browser, however your ports are configured.
hostname "My GMod"
sv_password ""
rcon_password "changeme"
sv_setsteamaccount 
maxplayers 16
sbox_maxprops 5000
sbox_maxragdolls 50
sbox_maxvehicles 10
sbox_noclip 1
sbox_godmode 0
sv_alltalk 1
sv_cheats 0

Advertisement

The server.cfg format

Syntax is the Source norm: command, space, value, quotes when a value contains spaces, 1 and 0 for on and off. Note that sandbox limit commands are defined by the sandbox gamemode itself — on a server running any other gamemode they do not exist, so setting them has no effect.

Advertisement

The mistake that wastes an evening

Addons and gamemodes often override server.cfg while the server is running. DarkRP, for instance, applies many values from its own config files after server.cfg has already been read, so an edit here can be applied perfectly and then replaced a moment later. Look at the gamemode's config before concluding the file was ignored.

Rather not run the server yourself?

These tools are free and funded by the two hosting services we run. If you want a server that is already set up, here they are.

Advertisement