Open your hosting company

Enzonic for Resellers

Open your hosting company

How to host a Garry's Mod server for your community

Install a Garry's Mod dedicated server, set up server.cfg and launch options, load a Workshop collection, add ULX admins, and keep addons backed up.

Enzonic teamUpdated 7 minute read

A Garry's Mod server is a small software project. You choose a game mode, add a Workshop collection of maps and addons, install an admin mod, set rules, and then keep all of it working as addons update and your community grows. Get the basics right and the rest becomes routine.

This guide covers installing the dedicated server, the launch options and server.cfg settings you will use, getting Workshop content to your players, admins and permissions, backups, updates and performance. If you are interested in selling GMod servers instead, read starting a Garry's Mod hosting business.

Installing the dedicated server

The Garry's Mod dedicated server is free through SteamCMD, app ID 4020. Players need to own the game on Steam; the server does not.

steamcmd +force_install_dir /srv/gmod +login anonymous +app_update 4020 validate +quit

Run the same command to update. Everything that matters to you lives under /srv/gmod/garrysmod/:

  • cfg/: config files, including server.cfg and mount.cfg.
  • addons/: addons installed by hand, one folder each.
  • gamemodes/: game modes such as sandbox and terrortown (TTT), and any you add, like DarkRP.
  • lua/: Lua that runs outside of addons, including lua/autorun/server/.
  • data/: data files written by addons.
  • sv.db: a SQLite database that many addons and game modes use for persistent data.

Launch options

Garry's Mod uses the Source dedicated server program, srcds. A typical start command:

./srcds_run -game garrysmod -console -port 27015 \
  +maxplayers 32 \
  +gamemode sandbox \
  +map gm_construct \
  +host_workshop_collection 1234567890
  • -game garrysmod is required.
  • -port sets the game port. 27015 is the Source default.
  • +maxplayers sets the player limit. It has to be on the command line, not in server.cfg.
  • +gamemode picks the game mode folder name: sandbox, terrortown, darkrp and so on.
  • +map is the starting map. It must exist on the server, from the base game, an addon or the Workshop.
  • +host_workshop_collection is the ID of a Steam Workshop collection the server downloads at startup.

Some admins also set -tickrate. Garry's Mod's default is fine for most servers; lowering it reduces CPU use on very busy sandbox servers at the cost of responsiveness.

server.cfg basics

garrysmod/cfg/server.cfg runs every time a map loads. A clean starting file:

hostname "Our Community | Sandbox"
sv_password ""
rcon_password "use-a-long-random-password"
sv_allowupload 0
sv_allowdownload 0
sv_loadingurl ""
sbox_maxprops 150
  • hostname is the server list name.
  • sv_password makes the server private when set.
  • rcon_password enables remote console. Use a long random value, or leave it empty to disable RCON entirely if you manage the server from a panel console.
  • sv_allowupload 0 stops players uploading sprays and custom files to the server.
  • sv_allowdownload controls direct downloads from the game server itself, which are slow. Most servers turn it off and use the Workshop or a FastDL web server.
  • sv_loadingurl can point to a loading screen page.
  • sbox_maxprops caps props per player on sandbox-based modes. On build servers this is your main lag control.

Getting Workshop content to players

This is where most new GMod admins get stuck. There are two separate steps:

  1. The server downloads the content. +host_workshop_collection makes the server download every item in your collection on startup.
  2. Clients are told to download it. The server must also call resource.AddWorkshop for each item, or players will see missing textures and error models.

Create a file such as garrysmod/lua/autorun/server/workshop.lua:

resource.AddWorkshop("1234567890")
resource.AddWorkshop("2345678901")

Use the ID of each Workshop item (not the collection) that has models, materials or sounds players need. Lua-only addons do not need it.

For content that is not on the Workshop, such as a custom map, set sv_downloadurl to a web server that mirrors your server's files (usually compressed). That is called FastDL.

Some popular maps and addons expect Counter-Strike: Source content. You can install the CS:S dedicated server files and mount them through cfg/mount.cfg, but players still need that content on their side too.

Keep your collection lean. Every item adds join time for new players, and a smaller collection is easier to keep working.

Admins and permissions

Garry's Mod's built-in admin system is basic, so nearly every community installs an admin mod. ULX (with its library ULib) is the long-standing free choice; others exist, and DarkRP ships its own FAdmin. The examples below use ULX.

Install ULib and ULX as folders in garrysmod/addons/, restart, then make yourself superadmin from the server console:

ulx adduser "YourName" superadmin

From then on, manage groups in game. A typical structure:

  • superadmin: the owner and maybe one trusted co-owner.
  • admin: experienced staff who can ban.
  • operator or a custom moderator group: can kick, mute, slay and spectate, but not ban permanently.
  • user: everyone else.

Give each group only the commands it needs. Keep a staff channel and a written list of what each rank may do. Most drama on GMod servers comes from staff using powers inconsistently, not from the software.

Choosing and installing a game mode

  • Sandbox and TTT ship with the game.
  • DarkRP is installed as its own game mode folder in gamemodes/, plus a separate modification addon for your custom jobs and settings. Keep your customizations in that modification addon so you can update DarkRP without losing them.
  • Prop Hunt, Murder, deathrun and many others are on the Workshop or community sites.

Change the mode with +gamemode and pick a matching map. Many modes only work on maps built for them, often recognisable by a prefix such as ttt_ or rp_.

Backups

Back up anything you changed by hand:

  • cfg/ (your configs and mount setup)
  • addons/ and any custom game mode folders
  • lua/ (including your Workshop download file)
  • data/ and sv.db (player data, ranks, money, bans in many setups)

Take a backup before installing or updating addons, before a GMod update, and on a daily schedule. The sv.db file and data/ folder are what your players will miss most if they are lost.

Updates

Garry's Mod receives updates through Steam, and the server must match the client version. Update the server with SteamCMD or your panel when Steam does. After a major update, check the console for Lua errors, because some addons need fixes from their authors. Workshop items update automatically when the server restarts.

Performance

Garry's Mod is mostly limited by single-core CPU speed. The usual causes of lag:

  • Props and physics. Large contraptions and prop spam are the top cause on build servers. Use prop limits and anti-spam tools in your admin mod.
  • Heavy addons. Lua code that runs on every tick for every player adds up. If performance drops after an addon change, roll it back.
  • Too many entities on roleplay servers. Printers, NPCs and dropped items pile up over a long session.
  • Big collections. These cost join time and memory more than tick time.

A reasonable starting point is to watch CPU and memory on a busy evening with your full addon set, then remove or replace the worst offenders before you add hardware. A daily restart at a quiet hour also clears built-up entities.

Common problems and quick checks

  • The server does not show in the browser. Check that the game port is open for UDP and that sv_password is empty if you expect a public listing. Players can always connect directly by address while you debug.
  • It starts on the wrong mode. The +gamemode value must match the folder name in gamemodes/ exactly.
  • Workshop downloads stall on startup. One broken or removed item in a collection can hold things up. Check the console, remove the item from the collection and restart.
  • Ranks disappeared. Admin mods store ranks in data/ or sv.db. If you restored only part of a backup, restore those too.
  • Console flooded with Lua errors. Read the first error, not the last. It names the addon file; disable that addon and test again.

Running it through a branded panel

If you want staff to manage the server from a web panel, you can run it through a panel with your community's name and colors using Enzonic for Resellers. Panel-only mode serves just sign-in and the panel, for communities that do not sell anything.

With Enzonic for Resellers, Garry's Mod runs on Enzonic nodes in Europe, North America and Asia and on your own Pterodactyl or Pelican Wings nodes, so you can sell it without running any hardware.

You can also connect your own machine running Pterodactyl Wings or Pelican Wings, described in bringing your own Wings nodes. Staff get a live console, file manager and SFTP for addons and Lua, scheduled backups and restores, scheduled tasks for restarts, and their own subuser logins with two-factor sign-in.

If your community also plays other Source games, the guides on hosting Team Fortress 2 and hosting Insurgency use the same srcds foundations.

Frequently asked questions

Why do players see purple and black textures on my server?

The server has the content but clients were not told to download it. Add resource.AddWorkshop lines for each Workshop item with models or materials, or set up FastDL for content that is not on the Workshop.

How do I make myself superadmin?

With ULX installed, run ulx adduser "YourName" superadmin in the server console, then manage other ranks in game. Other admin mods have their own equivalent command.

Where do I put the player limit?

Use +maxplayers on the launch command line. Setting it in server.cfg does not work.

What should I back up on a DarkRP server?

Your cfg, addons, gamemodes, lua and data folders, plus sv.db. Player money, ranks and many addon settings live in that database and data folder.

#garrys-mod#srcds#workshop#ulx