We are your new 5-Star Hosting Company. At least according to ★ Trustpilot

Following along with a Garry's Mod server? Deploy yours in minutes.

All servers come with a 24-Hour Trial, Free Backups, and 40Gbps DDoS Protection included!

Use code SAVE15 to take 15% OFF Your First Invoice with ChicagoServers! Limited Time!
Garry's Mod guide

Garry's Mod server.cfg: Essential Settings Explained

By the ChicagoServers team · Updated · 7 min read

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.

Quick answer
  • sv_allowcslua and sv_downloadurl are the core lines you edit in server.cfg. hostname, sv_password and rcon_password are set from the Server name, Join password and RCON password fields on the Startup tab.
  • Set sv_allowcslua 0 on public servers. It defaults to 1, which lets clients run client-side Lua commands.
  • An empty rcon_password means 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 -tickrate launch 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
  1. Where server.cfg lives and when it runs
  2. How to edit these settings on a ChicagoServers server
  3. What belongs on the launch line instead
  4. The core settings in server.cfg
  5. Starter server.cfg
  6. FastDL and downloads: sv_downloadurl in practice
  7. Tickrate and network rates
  8. Frequently asked questions

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

  1. 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.

  2. 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.

  3. Launch settings with no field

    For a launch option that has no Startup field, such as -tickrate or an extra +convar on 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.

SettingLaunch formWhere it lives on ChicagoServers
Gamemode+gamemode sandboxGamemode field on the Startup tab. Gamemode folder name.
Map+map gm_constructMap field on the Startup tab. File name without .bsp.
Player count+maxplayers 32Player 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 27015Assigned 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

SettingWhat it doesNotes
hostnameServer name in the browser.Documented as "Hostname for server". On ChicagoServers it comes from the Server name field on the Startup tab.
sv_passwordPassword to join. Empty means open.Standard Source engine join password. On ChicagoServers it comes from the Join password field on the Startup tab.
rcon_passwordPassword 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_allowcsluaLets clients run lua_openscript_cl and lua_run_cl.Default 1. Set to 0 on public servers.
sv_kickerrornumDisconnects clients that exceed this many client-side Lua errors.Default 0, which disables it.
sv_downloadurlBase URL of a FastDL web server.Needs matching folder structure; see below. Set it in server.cfg on the Configs tab.
sv_allowdownload, sv_allowuploadValve'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_autoupdateWhen above 0, updates Workshop addons on server start.Default 1.
hide_serverHides the server from the master server list.Default 0.
mapcyclefileName of the map cycle text file.Used by multiplayer map rotation.
sv_regionRegion 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

A minimal starting point (paste into the Text view of server.cfg, then Save and Restart)
// 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 1

FastDL 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:

  1. Host a web server

    You need your own HTTP host with enough disk for the downloadable content.

  2. Mirror the folder structure

    Copy files starting at the game folder, so that garrysmod/maps/mymap.bsp on the game server is available at /garrysmod/maps/mymap.bsp on the web server. In server.cfg on the Configs tab, point sv_downloadurl at the web folder that contains maps/, materials/ and so on, ending with a slash.

  3. Optionally compress with bzip2

    Clients request a .bz2 compressed copy first and fall back to the plain file. Compression reduces both storage and download time.

  4. List the files

    Mark files with resource.AddFile or resource.AddSingleFile in a serverside Lua file (create it on the Files tab, for example under garrysmod/lua/autorun/server/). Only mark addons that contain non-Lua files.

  5. Debug on the client

    If files keep re-downloading, run download_debug 1 and developer 1 in 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.

We are your new 5-Star Hosting Company. At least according to ★ Trustpilot

Following along with a Garry's Mod server? Deploy yours in minutes.

All servers come with a 24-Hour Trial, Free Backups, and 40Gbps DDoS Protection included!

We offer quality support, a detailed knowledgebase, video tutorials on most topics, and even live support in case you prefer a live human.

Use code SAVE15 to take 15% OFF Your First Invoice with ChicagoServers! Limited Time!