01
Create the Steam Workshop collection
A Garry's Mod server does not read a hand-written list of addons: it reads a collection, a list of Workshop items published on Steam. To create one:
- Open the Garry's Mod Workshop on Steam, go to the collections section, and choose to create a collection.
- Give it a title and a description, then set its visibility to public or unlisted. A private or friends-only collection cannot be read by the server.
- Add the addons, from the collection or with the add-to-collection button on each item's page.
- Publish the collection.
The collection ID is the number at the end of its address:
https://steamcommunity.com/sharedfiles/filedetails/?id=1234567890
Be careful not to confuse it with an addon's ID, which looks the same: you need the one from the collection's page. Put everything the server needs in the collection, gamemode included if it comes from the Workshop, and nothing else. If your server does not exist yet, start with the guide create a Garry's Mod server.
02
Declare the collection to the server
The collection is declared in the server's launch line, with +host_workshop_collection. For example, on a Linux server:
./srcds_run -game garrysmod +maxplayers 32 +gamemode darkrp +map rp_downtown_v4c_v2 +host_workshop_collection 1234567890 +sv_setsteamaccount VOTRE_JETON
At startup, the server downloads every item in the collection and loads them as if they were in the addons folder. At each restart, it fetches the new versions published by the authors.
The Steam Web API key. Depending on the documentation you follow and the server version, a Steam Web API key may be required to download the collection. If the server ignores the collection for no visible reason, create a key on Steam's dedicated page (steamcommunity.com/dev/apikey), logged in with your account, and add it to the launch line:
-authkey VOTRE_CLE_API
This key is personal: do not publish it or put it in a shared file. Addons you prefer to keep off the Workshop are still extracted into garrysmod/addons; never put the same addon in both places.
03
Make players download the addons
The server now has the addons, but players do not receive their content automatically. The Lua code is sent to them by the server; models, textures, sounds and maps, however, have to be downloaded on their side. Without that, they see purple and black checkerboard textures and models replaced by a big red ERROR.
Create a file in garrysmod/lua/autorun/server/, for example workshop.lua, with one line per addon to download:
resource.AddWorkshop("1234567891") -- pack de modèles
resource.AddWorkshop("1234567892") -- carte
resource.AddWorkshop("1234567893") -- véhicules
- Each line takes the ID of an addon, in quotes, not the collection's ID.
- Only list addons that have content (models, textures, sounds, maps). An addon made only of Lua code does not need to be there: adding it would just lengthen loading.
- Players download these addons through Steam on their first connection, then keep them in cache. Subscribing to your collection beforehand spares them the wait on their first visit.
Restart the server after changing this file.
04
FastDL, collection size and loading times
Content outside the Workshop. A private map, custom sounds or textures do not go through resource.AddWorkshop. They are declared with resource.AddFile in the same kind of Lua file, and served through a FastDL: a web address, set with sv_downloadurl in server.cfg, that mirrors the garrysmod folder structure. Without FastDL, players download these files from the game server itself, much more slowly. Step-by-step setup is in the guide web hosting for a GMod server.
Collection size. Every content addon added to resource.AddWorkshop adds to a new player's download. A collection of several gigabytes means long minutes of waiting on the first connection, and many players give up before arriving. A few rules:
- remove addons nobody uses, and duplicates (two model packs for the same purpose);
- be wary of very heavy maps and vehicle packs: they weigh the most;
- show the collection's size and the link to subscribe to it on your Discord or loading screen.
A DarkRP server loaded with player models and vehicles is especially exposed: see also create a DarkRP server.
05
Updates and common errors
Updates. The Workshop always serves an addon's latest version. The server fetches it at startup, players through Steam. As a result:
- after an important addon is updated, restart the server so it and the players have the same version;
- an update published by an author can break your server overnight. Read the console after each restart, and keep a backup of your configuration files;
- an abandoned addon often ends up producing Lua errors as the game is updated: replace it.
Common errors:
- The server downloads nothing: private or friends-only collection, an addon's ID instead of the collection's,
+host_workshop_collection missing from the launch line or misspelled, or an -authkey key needed.
- Purple checkerboards and red
ERRORs: the content did not reach the player. Add the addon with resource.AddWorkshop, or the file with resource.AddFile and FastDL.
- Lua errors at startup: an addon incompatible with the gamemode, with another addon, or broken by an update. Remove addons one at a time until you find the culprit.
- An addon behaves oddly: it is present twice, in the collection and in
addons. Keep a single copy.
- Unknown admin commands: ULX depends on ULib, which must be in the collection too. See the guide ULX and ULib.
For a TTT server, maps and models go through the same method: see create a TTT server.
06
On a CloudFive server
On our Garry's Mod hosting plans, from €2 per month, you do not edit the launch line by hand: everything starts from the client area manager.cloudfive.fr.
- Workshop collection in one click: paste your collection's address on the server's page; its title, item count and size are shown before you apply it.
- DarkRP and ULX in one click: the gamemode and the admin tool install from the same page.
- Files: create
lua/autorun/server/workshop.lua with the file manager or over SFTP.
- Console: it shows the collection download and Lua errors live.
- Backups: make one before changing collection, so you can roll back if an addon breaks the server.
Servers run in France on AMD Ryzen 9 9950X, DDR5 memory and NVMe storage, on our own network, with Anti-DDoS Premium included and a profile specific to the game. Monthly, no commitment, and support in French 7 days a week.
07
Frequently asked questions
How do I add a Workshop collection to a Garry's Mod server?
Create a public or unlisted collection on the Garry's Mod Workshop, note the ID at the end of its address, then add +host_workshop_collection followed by that ID to the server's launch line. The server downloads the collection at every startup.
Why do players see purple textures and ERROR models?
The addons' content did not reach them. Declare each addon containing models, textures, sounds or maps with resource.AddWorkshop in a file in lua/autorun/server, or serve files outside the Workshop through a FastDL, then restart the server.
Do I need a Steam API key for a Garry's Mod server?
Not always. If the server ignores the Workshop collection for no visible reason, create a Steam Web API key with your Steam account and add -authkey followed by the key to the launch line. Keep this key private.
How do I reduce a GMod server's loading time?
Remove unused or duplicate addons, especially very heavy maps and packs, and only list addons with content in resource.AddWorkshop. Also suggest players subscribe to the collection beforehand: Steam then downloads the content before they connect.
How do I update a Garry's Mod server's Workshop addons?
Just restart the server: it fetches the latest version of every item in the collection at startup. Then read the console, as an update published by an author can cause Lua errors.