How to Set Up a Garry's Mod Dedicated Server

A Garry's Mod dedicated server keeps your gamemode running whether or not you are playing, with its own addons and rules. There are three ways to run one: by hand, in Docker, or managed on Flux.

Option 1: by hand with SteamCMD

The dedicated server is a free, anonymous download from Steam (application 4020), about 7 GB, with native builds for Linux and Windows. It is the Source engine's srcds, configured by its launch line and by cfg/server.cfg.

  1. Install SteamCMD, then run: +login anonymous +force_install_dir ./gmod +app_update 4020 validate +quit
  2. Start it: ./srcds_run -game garrysmod +maxplayers 16 +gamemode sandbox +map gm_construct +host_workshop_collection <id> +rcon_password <password>
  3. Write garrysmod/cfg/server.cfg for everything else: hostname, sv_password, sandbox limits, and exec banned_user.cfg so bans survive a restart.
  4. Open port 27015 for UDP (game and query) and TCP (RCON) in your firewall, and forward it on your router.

Option 2: Docker

runonflux/garrysmod-server-flux, our image (source on GitHub, RunOnFlux/garrysmod-server-flux), installs and updates the server with SteamCMD on every start and builds the launch line from environment variables: GMOD_HOSTNAME, GMOD_GAMEMODE, GMOD_MAP, GMOD_MAXPLAYERS, GMOD_WORKSHOP_COLLECTION, GMOD_RCON_PASSWORD and GAME_PORT.

  • Mount /mnt/gmod/server on a volume: the install is about 7 GB.
  • Mount /mnt/gmod/server/garrysmod on a volume of its own: your server.cfg, addons, gamemodes, data and the logs live there.
  • srcds writes its console only to a terminal: a plain container goes silent once the map is up. The image runs it in one, so the console reaches docker logs, and keeps rotated copies in garrysmod/flux/logs.
  • It always adds +exec banned_user.cfg, or bans written with writeid are gone after a restart.

Option 3: managed on Flux

Deploy a Garry's Mod server on the Flux decentralized cloud, on that same image, with the launch line as a form, the port opened and routed for you, DDoS protection included, and a dashboard with an RCON console, server.cfg as a form, a file browser, a live terminal and backups. Plans start at $4.99 a month.

  1. Pick the 16, 32 or 64-player plan.
  2. Choose a region close to your players.
  3. Name the server, pick the gamemode and map, paste your Workshop collection and deploy. The first start downloads about 7 GB of server files.
  4. Find it by name in Garry's Mod's server browser, or connect with the address from the dashboard.

Frequently asked questions

Is the Garry's Mod dedicated server free?

Yes. It is a free, anonymous download from Steam (application 4020); you do not need to own the game to run it. What costs money is the machine that runs it.

Does the Garry's Mod server run on Linux?

Yes, natively: srcds_run on Linux is what Docker images such as runonflux/garrysmod-server-flux run.

How long does a Garry's Mod server take to start?

The first start downloads about 7 GB; in our tests it was up in three and a half minutes, then downloaded its Workshop collection. After that a restart takes about half a minute.

Related Garry's Mod guides