NewSchokr 13 is here. A whole new UI, seven locations, snapshots and more. Read more →

How to set up FastDL for a Garry's Mod server

Speed up custom content downloads on your Garry's Mod server with FastDL, using sv_downloadurl and an external web host, or use Workshop instead.

Updated · 2 min read

FastDL makes players download custom content from a web server over HTTP instead of from the slow game server connection. You copy your content files to a web host, set sv_downloadurl in server.cfg to that address, and tell the server which files players need.

Do you need FastDL?

Probably not, if your content is on the Steam Workshop. resource.AddWorkshop lets players download addons straight from Steam, which is fast and needs no web hosting. See Workshop collections.

FastDL is useful for content that isn't on the Workshop, such as custom maps, private models or sounds you made yourself.

What you need

  • A web host that serves static files over HTTP or HTTPS. Schokr game servers don't serve web files to players, so this has to be somewhere else, for example a static file host or a web server you run.
  • Your custom content files, keeping the same folder structure as in garrysmod/.

Step 1: upload files to the web host

Copy content using the Garry's Mod folder structure:

maps/my_custom_map.bsp
materials/mymod/texture.vmt
materials/mymod/texture.vtf
models/mymod/thing.mdl
sound/mymod/sound.wav

So that, for example, https://fastdl.example.com/gmod/maps/my_custom_map.bsp downloads the map.

Optionally, compress each file with bzip2 and upload it with .bz2 added to the name, such as my_custom_map.bsp.bz2. Players download the smaller compressed file and the game unpacks it. Keep the uncompressed originals on the game server.

Step 2: point the server at it

In garrysmod/cfg/server.cfg:

sv_downloadurl "https://fastdl.example.com/gmod/"
sv_allowdownload 0

The URL should point at the folder that contains maps, materials and so on, with a trailing slash.

Step 3: tell the server what to send

Garry's Mod only sends files you list. Create garrysmod/lua/autorun/server/fastdl.lua:

resource.AddFile("materials/mymod/texture.vmt")
resource.AddFile("models/mymod/thing.mdl")
resource.AddFile("sound/mymod/sound.wav")

resource.AddFile on a .mdl or .vmt also adds the files that go with it, such as the model's other parts or the material's texture. The current map is sent automatically.

Restart the server.

Testing

  1. Delete the custom content from your own game's download folder, or test with a friend who's never joined.
  2. Connect to the server and watch the loading screen. Files should download quickly.
  3. If they don't, open the URL of one file in a web browser. If it doesn't download there, the path or web host is wrong.

Common problems

  • Files download from the game server slowly: sv_downloadurl is wrong or missing the trailing slash.
  • Missing textures after joining: the file wasn't added with resource.AddFile, or its path on the web host doesn't match.
  • Map won't download: the map file isn't in the maps folder on the web host, or its name differs in case. Paths are case sensitive.

Still stuck?

Share your sv_downloadurl and one file URL in the Schokr Discord and someone can help check the paths.