Windows

SteamCMD

The first time you run it it will update and you will be left at a STEAM> console. You will want to log in. You can log into an anonymous account by typing:

login anonymous

Installing & Updating Garry's Mod Dedicated Server

If you want to specify a download folder then before you update enter this command:

NOTE

This is known to cause problems when updating your server to a newer version. If your server fails to update, try not using the force_install_dir feature, or try reinstalling your server into another folder

force_install_dir c:\my_garrysmod_server\

You can then install or update the Garry's Mod Dedicated Server by using the command:
app_update 4020

It will slowly download or update.

If you wish to verify your server, enter this instead of the above:
app_update 4020 -validate

Once it's done you can type quit at the console to exit or just close the SteamCMD window.

Automated

You probably don't want to do that every time you want to install/update a server. Don't worry - it supports command lines too.

macOS

macOS dedicated servers are not officially supported, but they can still be used.
This command launches a basic dedicated server but more parameters can be added.
cd ~/Library/Application\ Support/Steam/SteamApps/common/GarrysMod
./srcds_run -game garrysmod -maxplayers 16 +gamemode sandbox +map gm_flatgrass

The Experimental Branches

To update your server to the development branch, you'll have to launch your SteamCMD and enter these commands manually: