Garry's Mod server.cfg: Essential Settings Explained
Garry's Mod reads garrysmod/cfg/server.cfg when a dedicated server starts and on every map start. On ChicagoServers you edit it as the server.cfg file on the Configs tab. Put security and download settings there. The server name, join password and RCON password are Startup tab fields, and launch-only things such as the gamemode, map, player count, tickrate and login token are launch settings, not server.cfg lines.
Descriptions below come from the Facepunch Garry's Mod wiki and the Valve Developer Community wiki. Where the wikis do not document a value, this guide says so rather than guessing.
sv_allowcsluaandsv_downloadurlare the core lines you edit in server.cfg.hostname,sv_passwordandrcon_passwordare set from the Server name, Join password and RCON password fields on the Startup tab.- Set
sv_allowcslua 0on public servers. It defaults to 1, which lets clients run client-side Lua commands. - An empty
rcon_passwordmeans RCON authentication is refused. Use a long unique one in the RCON password field and never post your cfg publicly. The Console tab handles RCON for you. - Tickrate is set with the
-tickratelaunch option (default 66.6666, suggested range 30 to 128), not in server.cfg. There is no Startup field for it, so contact support to change it. - server.cfg runs on every map start, so the ConVars it sets are reapplied after a map change.
On this page
Where server.cfg lives and when it runs
The file is garrysmod/cfg/server.cfg (the server.cfg file on the Configs tab). Valve's documentation says server.cfg runs when a server starts in dedicated mode and by default on every map start, which means any ConVar it sets is reapplied after a map change. A second file, autoexec.cfg, in the same folder is the other common place for startup commands (open it on the Files tab); the Facepunch wiki uses it for sv_loadingurl.
A few settings cannot be applied from a cfg because they are needed before the server finishes starting. The wiki's -multirun note is an example: sv_lan 1 has to be set before the server starts (or followed by a changelevel) because server.cfg is too late. When in doubt, check whether the wiki documents something as a launch option, and contact support if it has no Startup field.
How to edit these settings on a ChicagoServers server
- Startup tab fields
Open the Startup tab and change Server name, Join password, RCON password, Gamemode, Map, Workshop collection ID or Game server login token. Click Save startup, then Restart at the top of the page.
- server.cfg on the Configs tab
Open the Configs tab and pick server.cfg. Edit it in the Settings view, or switch to Text for the whole file and paste the lines from this guide. Click Save, then Restart.
- Launch settings with no field
For a launch option that has no Startup field, such as
-tickrateor an extra+convaron the launch line, contact support. Customers cannot edit the launch command line.
What belongs on the launch line instead
On ChicagoServers the panel builds the launch line for you from the Startup tab, so you never type these. The table shows the launch form and where each one lives in the panel.
| Setting | Launch form | Where it lives on ChicagoServers |
|---|---|---|
| Gamemode | +gamemode sandbox | Gamemode field on the Startup tab. Gamemode folder name. |
| Map | +map gm_construct | Map field on the Startup tab. File name without .bsp. |
| Player count | +maxplayers 32 | Player slots are set by the panel from your plan. |
| Workshop collection | +host_workshop_collection <id> | Workshop collection ID field on the Startup tab. Public or unlisted collections only. |
| Login token | +sv_setsteamaccount <token> | Game server login token field on the Startup tab. Listed as mandatory on the Facepunch wiki. |
| Tickrate | -tickrate <value> | No Startup field; contact support. Default 66.6666, suggested range 30 to 128. |
| Port | -port 27015 | Assigned by the panel and shown under Network on the Startup tab. Default game port 27015. |
| Any ConVar | +<convar> <value> | Sets it after the game starts. Put ConVars you want on every start in server.cfg instead, or contact support for one that must be on the launch line. |
The core settings in server.cfg
| Setting | What it does | Notes |
|---|---|---|
hostname | Server name in the browser. | Documented as "Hostname for server". On ChicagoServers it comes from the Server name field on the Startup tab. |
sv_password | Password to join. Empty means open. | Standard Source engine join password. On ChicagoServers it comes from the Join password field on the Startup tab. |
rcon_password | Password for remote console access. | If empty, RCON authentication is refused. RCON uses TCP on the game port (27015 by default). On ChicagoServers it comes from the RCON password field on the Startup tab. |
sv_allowcslua | Lets clients run lua_openscript_cl and lua_run_cl. | Default 1. Set to 0 on public servers. |
sv_kickerrornum | Disconnects clients that exceed this many client-side Lua errors. | Default 0, which disables it. |
sv_downloadurl | Base URL of a FastDL web server. | Needs matching folder structure; see below. Set it in server.cfg on the Configs tab. |
sv_allowdownload, sv_allowupload | Valve's FastDL instructions set both to 1. | Used with sv_downloadurl. The Facepunch wiki warns that sv_allowdownload opens you up to exploits, so only enable it if you need it. |
host_workshop_autoupdate | When above 0, updates Workshop addons on server start. | Default 1. |
hide_server | Hides the server from the master server list. | Default 0. |
mapcyclefile | Name of the map cycle text file. | Used by multiplayer map rotation. |
sv_region | Region the server browser reports. | Default 255 (world); Valve notes it may be deprecated. |
sv_region accepts 0 to 7 for US East, US West, South America, Europe, Asia, Australia, Middle East and Africa, and 255 for the world. A server set to a specific region appears when that region or all regions is selected in the browser.
Starter server.cfg
// garrysmod/cfg/server.cfg
// hostname, sv_password and rcon_password are set on the Startup tab
// (Server name, Join password, RCON password) and written at every start.
// Security
sv_allowcslua 0
sv_kickerrornum 0
// Downloads (FastDL)
sv_downloadurl "https://example.com/garrysmod/"
sv_allowdownload 1
sv_allowupload 1
// Workshop updates on start
host_workshop_autoupdate 1FastDL and downloads: sv_downloadurl in practice
Players need custom content that is not already on their machine. The Facepunch wiki ranks the methods from fastest to slowest: Steam Workshop downloads, FastDL over HTTP, then the server's own built-in transfer, which it calls obsolete and slow. For Workshop content, use resource.AddWorkshop (the Workshop addons file on the Configs tab) and skip FastDL.
For your own maps, models and sounds, FastDL works like this:
- Host a web server
You need your own HTTP host with enough disk for the downloadable content.
- Mirror the folder structure
Copy files starting at the game folder, so that
garrysmod/maps/mymap.bspon the game server is available at/garrysmod/maps/mymap.bspon the web server. In server.cfg on the Configs tab, pointsv_downloadurlat the web folder that containsmaps/,materials/and so on, ending with a slash. - Optionally compress with bzip2
Clients request a
.bz2compressed copy first and fall back to the plain file. Compression reduces both storage and download time. - List the files
Mark files with
resource.AddFileorresource.AddSingleFilein a serverside Lua file (create it on the Files tab, for example undergarrysmod/lua/autorun/server/). Only mark addons that contain non-Lua files. - Debug on the client
If files keep re-downloading, run
download_debug 1anddeveloper 1in the client console and look for red "Error Downloading" lines.
Be aware that FastDL downloads files one at a time, so a very large number of small files is slow, and clients do not re-check files they already have, so updated files may not re-download. Hosting with ChicagoServers? The Garry's Mod server hosting page lists what is included, such as Steam Workshop collection support, free server backups and SFTP file access. Contact support if you want help with FastDL.
Tickrate and network rates
Source servers simulate in discrete ticks. Garry's Mod's default tickrate is 66.6666, set with the -tickrate launch option, with a suggested range of 30 to 128. There is no Startup field for it, so contact support if you want to change it. Valve advises against going above 66 on typical servers, because higher tickrates raise CPU load substantially, and says players should usually only need to adjust their own rate.
Servers constrain what clients request with sv_minrate, sv_maxrate, sv_minupdaterate and sv_maxupdaterate. The Facepunch wiki does not document defaults for these, so leave them at the engine defaults unless you are testing a specific problem. More often, lag comes from a heavy Lua addon, so check the addon list first.
Frequently asked questions
Where is the Garry's Mod server.cfg file?
On ChicagoServers, open your server, then the Configs tab, and pick server.cfg (on the server it is garrysmod/cfg/server.cfg). It runs when the server starts and on every map start, so ConVars it sets are reapplied after map changes. Click Save, then Restart after editing.
What should sv_allowcslua be set to?
On a public server, 0. The default is 1, which lets clients run lua_openscript_cl and lua_run_cl, and that is rarely wanted outside private or testing servers. Set it in server.cfg on the Configs tab.
How do I change the tickrate on a Garry's Mod server?
Tickrate is the -tickrate launch option, not a server.cfg line, and there is no Startup field for it, so contact support. The default is 66.6666 and the suggested range is 30 to 128, but higher values raise CPU load.
Do I need FastDL if I use Workshop collections?
Usually not. Workshop downloads are the fastest method, so serve addon content with resource.AddWorkshop and use FastDL only for files you cannot put on the Workshop.