To make a Garry's Mod dedicated server, install SteamCMD and download app 4020 with app_update 4020 validate. Then start srcds with a gamemode, a map and your GSLT. The server runs on its own, with no copy of the game open.
What You Need
- A Windows or Linux PC, or a rented VPS, that can stay switched on.
- About 7 GB of disk space for the server files, plus room for addons and maps.
- A Steam account that owns Garry's Mod, for the Game Server Login Token.
- Enough upload bandwidth for your players. Upload matters more than download.
You don't need to own a second copy of Garry's Mod. SteamCMD downloads the server anonymously.
Install SteamCMD
SteamCMD is Valve's command-line Steam client. It downloads and updates dedicated servers.
Download SteamCMD from Valve: https://client-update.steamstatic.com/installer/steamcmd.zip. Make a folder such as C:\steamcmd and extract the zip into it.
Open Command Prompt and run it once. It updates itself and stops at a Steam> prompt. Type quit to close it.
cd C:\steamcmd
steamcmdDownload the Server Files
The Garry's Mod dedicated server is Steam app 4020. Set the install folder before you log in, which is the order Valve recommends.
steamcmd.exe +force_install_dir C:\gmodserver +login anonymous +app_update 4020 -beta x86-64 validate +quitThe download takes a while the first time. When SteamCMD says the app is fully installed, the files are ready.
The x86-64 Branch
-beta x86-64 installs Facepunch's 64-bit branch. A 64-bit server can use far more memory than a 32-bit one, which matters once you run lots of addons. Facepunch's other branches are dev and prerelease, which get changes before everyone else.
Leave out -beta x86-64 for the default 32-bit branch. To go back to it after using a beta, run the update with -beta public. Removing -beta alone isn't enough, because SteamCMD stays on the last branch you picked.
Start the Server
Put the start command in a script so you don't have to type it each time. Replace YOUR_GSLT with your Game Server Login Token.
Save this as start.bat in C:\gmodserver:
@echo off
cd /d C:\gmodserver
srcds_win64.exe -console -game garrysmod -port 27015 +maxplayers 32 +gamemode sandbox +map gm_construct +sv_setsteamaccount YOUR_GSLTOn the default 32-bit branch, the program is srcds.exe instead of srcds_win64.exe. Double-click start.bat to run it. Windows Firewall may ask whether to allow the server: allow it.
Start Options
| Option | What it does |
|---|---|
-console | Runs the server in a text console |
-game garrysmod | Loads Garry's Mod |
-port 27015 | Sets the port the server uses. 27015 is the default |
+maxplayers 32 | Sets the number of player slots |
+gamemode sandbox | Sets the gamemode, by its folder name in garrysmod/gamemodes/ |
+map gm_construct | Sets the first map, by its file name without .bsp |
+sv_setsteamaccount | Logs the server in with your GSLT |
+host_workshop_collection | Downloads a Workshop collection at startup |
-tickrate | Sets the server tick rate. The default is about 66.67 |
Options with - are launch options. Options with + run a console command or set a console variable once the server starts. Put everything else in server.cfg.
Check It Works
The console prints the map loading and then sits waiting. Type status into it to see the server name, map and players.
To join from Garry's Mod on the same PC, open the developer console and connect to it:
connect 127.0.0.1:27015Players on other networks need your public IP and an open port. The ports guide covers that.
To change map without a restart, type changelevel and the map name into the server console:
changelevel gm_flatgrassUpdate the Server
Some Garry's Mod updates stop players joining a server until the server updates too. Update yours whenever the game updates.
Stop the server, then run the same SteamCMD command you used to install it. The Linux update fails while the server is still running.
validate checks every file and puts back any default file you changed. Valve suggests using it on the first install and when files look broken. Leave it out of routine updates if you've edited any of the server's own files.
Keep It Running
srcds_run restarts the server by itself if it crashes. It doesn't start the server after the machine reboots.
Open Task Scheduler and create a task with an At startup trigger that runs your start.bat. Set it to run whether or not you're logged in.
Troubleshooting
SteamCMD is a 32-bit program. On 64-bit Linux, install the 32-bit libraries, such as lib32gcc-s1 on Ubuntu and Debian, and run it again.
An invalid or expired token stops the server from starting. Check the token on Steam's game server page and regenerate it if needed. Changing your Steam password invalidates every token you own.
Two servers are using the same GSLT. Every server needs its own token.
Valve's fix is to regenerate the token, or create a new one, and update your +sv_setsteamaccount line.
Linux file names are case-sensitive. Old addons with capital letters in their folder names can fail to load. Rename the folders to lower case.
Read GSLT and Port Forwarding. Most missing servers come down to a closed port or a missing token.
Next Steps
Name your server and set passwords in server.cfg. Then add Workshop addons and install DarkRP.
Want to see a big DarkRP server running? Join Justified: justified.gg

