Hosting A Dedicated Server

From Garry's Mod
Jump to: navigation, search




Dedicated servers are now downloaded using SteamCMD. This is a command line version of Steam.

You can download it from this page.

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.


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.

steamcmd.exe +login anonymous +app_update 4020 validate +quit

The development branch

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

login anonymous app_update 4020 -beta dev validate quit

The development branch is updated extremely regularly.

Mac OS X

There are essentially two options for running a server. You could run it directly from the install directory in SteamApps (usually ~/Library/Application Support/Steam/SteamApps/common/GarrysMod). Or you may opt to have a separate copy of the game by copying it either from the SteamApps/common directory or from a SteamCMD install on a Windows or Linux system (assuming Mac binaries are available from it).


You can download the srcds binaries here.

Place the srcds_osx and srcds_run files from it into the server's root directory. Copy the files from the bin directory to the bin directory of the server root as well.

Once the files from the package have been extracted/copied, you can run the server by navigating to the server root directory in Terminal: cd ~/Library/Application\ Support/Steam/SteamApps/common/GarrysMod/ Then you can start the server by running srcds_run with the game name, map, and any other options you'd like: ./srcds_run -game garrysmod +map gm_construct -maxplayers 16 +rcon_password password


Main article: Linux Dedicated Server Hosting


Here's a useful script that will download SteamCMD into ~/Steam/ then extract and install it - and then install the Garry's Mod Dedicated Server.

mkdir ~/Steam cd ~/Steam wget tar -xvzf steamcmd_linux.tar.gz ./ +login anonymous +force_install_dir ../gmodds +app_update 4020 validate +quit

The server is now available in ~/gmodds/

cd ~/gmodds/ ./srcds_run -game garrysmod +maxplayers 32 +map gm_construct


If you get the error message ./ line 29: /home/$USER/Steam/linux32/steamcmd: No such file or directory You are most likely running 64 a bit system and missing 32 bit libraries.

If the output of this command is x86_64, you are running a 64 bit system and need 32 bit libraries. uname -m See this article on the valve wiki. 32-bit libraries on 64-bit Linux systems

Personal tools