Adding Steam Workshop Addons and Collections
How to configure Workshop collections, Steam Web API keys, and force client downloads using resource.AddWorkshop in Lua.
How Workshop Addons Work
GMod servers load Workshop addons from a Steam collection. When the server starts, it downloads any addons in the collection that are not already cached, then sends the addon list to connecting clients so they can download the same content.
Workshop cache is stored at:
garrysmod/cache/workshop/
Getting Your Collection ID
- Create a Steam Workshop collection at
steamcommunity.com/workshop/browse/?appid=4020 - Add all desired addons to the collection and set it to public
- The collection ID is the numeric portion of the URL:
steamcommunity.com/sharedfiles/filedetails/?id=<ID>
The collection must be public. Private collections cannot be downloaded by the server.
Steam Web API Key
Workshop downloads require a Steam Web API key alongside the collection ID. Obtain one at steamcommunity.com/dev/apikey. The key is tied to your Steam account.
Configuring in Pterodactyl
Set these startup variables in your panel:
| Variable | Value |
|---|---|
WORKSHOP_ID |
Your numeric collection ID |
| Launch flag appended automatically | -authkey <your_api_key> |
If your egg does not have a dedicated API key variable, add -authkey <key> directly to the startup command line in the panel.
Manual Launch Flags
+host_workshop_collection 1234567890 -authkey YOURAPIKEY1234567890ABCDEF
Both flags must be present together. The collection flag without the authkey causes Workshop download timeouts.
Forcing Client Downloads with Lua
Workshop collections handle server-side downloading, but clients connecting mid-session may not automatically download all addons. To force clients to download a specific addon, add a Lua file:
garrysmod/lua/autorun/server/workshop.lua
With content such as:
-- Force clients to download specific Workshop addons
resource.AddWorkshop("123456789")
resource.AddWorkshop("987654321")
The string passed to resource.AddWorkshop is the addon's numeric Workshop ID. This is different from the collection ID — it is the ID of each individual addon within the collection.
Finding Individual Addon IDs
Navigate to the addon's Workshop page. The ID is in the URL:
steamcommunity.com/sharedfiles/filedetails/?id=123456789
^^^^^^^^^
This number
Adding New Addons
- Add the addon to your Workshop collection on Steam
- Restart the server — Workshop addons do not hot-reload
- Clients will be prompted to download on next connection
If an addon update breaks your server, temporarily remove it from the collection and restart. The cached version in garrysmod/cache/workshop/ will no longer be used once removed from the collection.
Addon Load Order
Addons load alphabetically by folder/addon name. If one addon depends on another (e.g., ULX depends on ULib), ensure ULib's name sorts before ULX alphabetically, or use explicit dependency handling in Lua. ULib (557962238) and ULX (557962280) are designed to handle this automatically when both are in the collection.
Troubleshooting Workshop Downloads
Timeout on startup:
- Verify
-authkeyis set and the key is valid - Confirm the collection is set to public
- Check outbound UDP ports 27020, 26901, and 1200 are open
Addons not appearing in-game:
- Confirm the collection ID matches the one in your launch flags
- Check
garrysmod/cache/workshop/— files should appear after restart - Look for download errors in the startup console output