Install it with SteamCMD
The Garry's Mod dedicated server app ID is 4020. Log in anonymously and install:
steamcmd.exe +login anonymous +force_install_dir c:\my_garrysmod_server\ +app_update 4020 validate +quit- Linux:
steamcmd +login anonymous +force_install_dir ../gmodds +app_update 4020 validate +quit
Facepunch attach a warning to force_install_dir that is worth reading before you hit an update failure: it is known to cause problems when updating a server. If yours fails to update, try without it, try a different folder, or try entering force_install_dir before the login command rather than after.
On 64-bit Linux the first error most people meet is /home/$USER/Steam/linux32/steamcmd: No such file or directory. Run uname -m; if it answers x86_64, you are missing 32-bit libraries and SteamCMD needs them. macOS servers are no longer shipped at all.
Start it
Run srcds.exe directly, or give it a command line:
- Windows:
srcds.exe -console +maxplayers 20 +gamemode sandbox +map gm_construct +sv_setsteamaccount <your token> - Linux:
./srcds_run -game garrysmod +maxplayers 32 +map gm_construct +sv_setsteamaccount <your token>
The gamemode is the folder name as it appears in garrysmod/gamemodes/, or in the gamemodes/ folder of any addon, Workshop addons included. If you do not know a Workshop gamemode's folder name, it is usually in the addon description, and if it is not, ask the author. The map is the .bsp filename without the extension. To change map cleanly while the server runs, use changelevel gm_flatgrass rather than restarting.
The main configuration file is garrysmod/cfg/server.cfg. Set hostname there along with anything else you do not want on the command line.
The token you cannot skip
A Steam Game Server Login Token, set with sv_setsteamaccount, is not optional. Facepunch state plainly that this is mandatory and that a server's ranking is penalised without one. Get it out of the way before you spend time on anything else; we wrote a separate walkthrough for creating a login token.
Two smaller settings belong in the same first pass. sv_location tells the browser where your server is, and it takes an ISO 3166-1 alpha-2 country code matching a flag icon in materials/flags16/, up to five characters. sv_location us shows the USA flag, eu is a special case for the European Union. And hide_server 1 keeps the server out of the browser entirely, if you want it join-by-address only.
Ports
| Port | Protocol | Used for |
|---|---|---|
| 27015 | TCP and UDP | Game traffic, pings and remote console. Change it with -port. |
| 27020 | UDP | SourceTV. |
| 27005 | UDP | Client port. Change it with -clientport. |
| 26900 | UDP | Steam port, outgoing. Change it with -sport. |
27015 is the one that has to reach the outside world. Start there, confirm somebody outside your network can join, and add the rest only if you need them.
Workshop addons, and the sharing setting that breaks them
A dedicated server can install addons straight from a Workshop collection. Create a collection, find its ID, and append +host_workshop_collection 123456789 to the startup command line. The server downloads the collection at startup and mounts everything in it.
One condition decides whether this works at all: the collection has to be public or unlisted. A private collection is invisible to the server, and the failure is silent rather than loud. If your addons are not appearing and the ID is right, check that first.
Two behaviours follow from a mounted collection. If the current map is in the collection, by .bsp name, the server marks it for client download and prints Making workshop map available for client download. If the gamemode declares a Workshop ID in its .txt file, the same happens for the gamemode, with its own console line. Those two messages are the quickest way to confirm the collection actually loaded.
Workshop content updates on every server start by default. You can stop that with host_workshop_autoupdate 0, which protects you from an addon changing under you, at the cost of falling behind on map updates and locking players out when their copy no longer matches. There is no free answer there; pick the failure you would rather have. If addons are misbehaving, our guide on Workshop and mod content not loading goes further.
Keeping it alive, and the branch that sticks
On Linux, srcds_run restarts the server if it crashes, but it does not survive a reboot and it dies with your terminal. The documented fix is a crontab line: crontab -e, then @reboot /home/steam/server_1/srcds_run +maxplayers 12 +map gm_flatgrass. Facepunch note there are better approaches and that they get complicated quickly; this one works.
Turn the server off before updating, or the update fails. And if you ever put the server on a beta branch with -beta dev, -beta prerelease or -beta x86-64, remember how to get back. Facepunch are emphatic: removing the -beta parameter is not sufficient, because SteamCMD keeps updating to the last branch you activated. You have to run app_update 4020 -beta public validate to return to stable.
One Linux quirk worth knowing before it wastes your evening: legacy addons with capital letters in their folder names can fail, and the fix is to rename the directories to lowercase and update any Lua that points at them.
Self-hosting or renting
Garry's Mod runs happily on a modest machine, and if you have one that stays on, self-hosting is free and gives you every file. For a sandbox server for friends, that is often the right answer.
The costs are the ordinary ones. The machine has to be awake whenever anyone wants to play, and it should not be the computer you are playing on. Many home connections cannot accept incoming connections at all, whatever you do to the router. Every update, crash and Workshop change is yours to catch. And the login token, the collection and the addon list still need looking after wherever the files sit.
Renting moves those chores rather than removing them. The gamemode, the collection, the config and the backups you actually keep are still your decisions.
Where RadarHost fits
RadarHost rents Garry's Mod servers hosted in Beauharnois, Quebec, Canada. There are three plans, Standard, Premium and Diamond, priced in Canadian dollars, with no setup fee and cancel any time. Renting changes who keeps the machine on; the gamemode, the collection and the login token above are still yours to choose. After payment, our team reviews the order and emails setup details or next steps within 24 hours. Current plans and prices are on the Garry's Mod availability page.