How to Add Workshop Addons to a Garry's Mod Server
Workshop collections are the easiest way to run addons on a Garry's Mod server. Instead of uploading files by hand, you point the server at one collection and it downloads everything on startup.
Create the collection
- Subscribe to nothing on your own account; instead open the Steam Workshop for Garry's Mod and click Collections, then Create.
- Add every addon, map and content pack you want, then set the collection visibility to Public or Unlisted so the server can read it.
- Copy the numeric ID from the end of the collection URL.
Point the server at it
Garry's Mod uses a launch parameter for this. Add the following to your startup command, replacing the number with your collection ID:
- +host_workshop_collection 123456789
Depending on your setup you may also need a Steam Web API key passed with -authkey. If Workshop items fail to download, check that this is set. Ask us on Discord if you are not sure where the startup command lives in your panel.
Apply the change
- Stop the server from the Console tab.
- Update the startup variables or command in your panel.
- Start the server and watch the Console for Workshop download lines.
The first start after adding a large collection can take a while, so be patient before assuming it is stuck.
Make clients download content
Collections are mounted on the server, but players only get the files if you tell them to. In a Lua file under garrysmod/lua/autorun/server/ you can call resource.AddWorkshop with the Workshop item ID for each addon that has models, materials or sounds. Without this, players may see missing textures or purple-and-black ERROR models.
Tips
- Keep collections small. Every addon adds load time and potential conflicts.
- Remove addons one at a time when debugging errors, rather than guessing.
- Maps from the Workshop must also be in the collection if you want to switch to them.
- After the Workshop updates an addon, restart the server to pull the new version.