Skip to content
Run a Server

How to Make a Garry's Mod Dedicated Server

Set up a Garry's Mod dedicated server with SteamCMD on Windows or Linux. Install app 4020, use the 64-bit branch, write a start script and keep it updated.

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
steamcmd

Download 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 +quit

The 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_GSLT

On 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

OptionWhat it does
-consoleRuns the server in a text console
-game garrysmodLoads Garry's Mod
-port 27015Sets the port the server uses. 27015 is the default
+maxplayers 32Sets the number of player slots
+gamemode sandboxSets the gamemode, by its folder name in garrysmod/gamemodes/
+map gm_constructSets the first map, by its file name without .bsp
+sv_setsteamaccountLogs the server in with your GSLT
+host_workshop_collectionDownloads a Workshop collection at startup
-tickrateSets 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:27015

Players 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_flatgrass

Update 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

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

More in Run a Server

View all