In short
To set up a Garry's Mod server, download GMod Dedicated Server (app ID 4020) with SteamCMD, get a GSLT (Game Server Login Token) from Steam for App ID 4000, edit garrysmod/cfg/server.cfg and start the server with the +gamemode, +map and +sv_setsteamaccount parameters. Add +host_workshop_collection for Workshop content; players connect at IP:27015.
In this guide
- First decision: picking a gamemode
- 1. Install the server files
- 2. Get a GSLT (Steam Game Server Login Token)
- 3. Write your server.cfg
- 4. Set up Workshop content
- 5. Start the server
- 6. Ports and first connection
- 7. Give yourself admin rights
- Ready-made panel or your own VDS?
- How much RAM and CPU do you need?
- Common setup mistakes
- First checklist after the server is up
- Next step: get your server running in minutes
Setting up a Garry's Mod (GMod) server takes less than an hour if you do it in the right order: download the server files, pick a gamemode, write your server.cfg, get a GSLT token from Steam and start the server with the right launch parameters. This guide covers the steps for both a ready-made game panel and your own VDS.
First decision: picking a gamemode
A gamemode is the Lua-based mod that sets your server's game rules. Resource needs, addon count and admin workload depend heavily on this choice.
| Gamemode | Folder / parameter name | Best for | Load |
|---|---|---|---|
| Sandbox | sandbox | Free building, groups of friends | Depends on prop count |
| Trouble in Terrorist Town | terrortown | Round-based, competitive communities | Low to medium |
| DarkRP | darkrp | Roleplay servers | High, depending on addons |
| Prop Hunt, Murder, etc. | The mod's folder name | Casual fun servers | Low |
Sandbox and TTT ship with the game. Community gamemodes like DarkRP are downloaded separately; we walk through the setup step by step in the GMod DarkRP server setup guide.
1. Install the server files
On a ready-made game panel, this step is handled by automatic setup. On your own Linux VDS, this SteamCMD command is all you need:
steamcmd +force_install_dir /home/gmod/server +login anonymous +app_update 4020 validate +quit
4020 is the Steam app ID for Garry's Mod Dedicated Server, and it can be downloaded with an anonymous login. Don't run the server as root; create a separate gmod user. On Linux, SteamCMD needs 32-bit libraries; on Debian- and Ubuntu-based systems you may need to install those packages.
When the install finishes, the folder structure should look like this:
/home/gmod/server/
srcds_run -> Linux launch script
garrysmod/
addons/ -> addons
cfg/server.cfg -> server settings
gamemodes/ -> gamemode folders
lua/autorun/server/ -> server-side Lua files
maps/ -> non-Workshop maps
To update the server, just run the same SteamCMD command again while the server is stopped. When a game update comes out, players may not be able to join a server that hasn't been updated.
2. Get a GSLT (Steam Game Server Login Token)
A GSLT is a key that ties your server to your Steam account. The server will run without a token, but it may not show up properly in the internet server list, and Workshop content may not work as expected.
- Sign in with your Steam account at
steamcommunity.com/dev/managegameservers. - In the App ID field, enter
4000. Note: even though the server app ID is 4020, the token is created for 4000, the game itself. - Fill in the memo with a name you'll recognize the server by, then create the token.
- Use a separate token for each server and never share your token.
Steam's requirements apply to getting a token, such as your Steam account not being limited and having a phone number attached.
3. Write your server.cfg
The file lives at garrysmod/cfg/server.cfg; create it if it doesn't exist. The server runs this file automatically every time it starts.
hostname "Sunucu Adınız | Sandbox"
sv_password ""
rcon_password "GucluBirSifre123"
sv_lan 0
sv_region 3
sv_allowupload 0
sv_allowdownload 0
sv_loadingurl ""
net_maxfilesize 64
sbox_maxprops 150
sbox_noclip 0
hostname: The name shown in the server list.sv_password: Leave it empty to make the server public.rcon_password: The remote admin password; make it something no one can guess.sv_lan 0: Tells the server it's open to the internet.sv_region 3: The Europe region; the right choice for players in Türkiye.sv_allowupload 0/sv_allowdownload 0: Turn off player spray uploads and direct downloads from the server. Using the Workshop or FastDL for content delivery is more efficient.sbox_maxprops: Per-player prop limit in Sandbox; keeping it low reduces the risk of lag.
4. Set up Workshop content
Maps, models and addons usually come from the Steam Workshop. The cleanest approach is to create a Workshop collection for your server and add its ID to the launch parameters. The number after ?id= in the collection URL is the collection ID.
The server downloading the collection doesn't mean players will download it automatically too; for models and materials you need to use resource.AddWorkshop. You'll find the details in the guide to adding a GMod Workshop collection to your server.
5. Start the server
Sample launch command for Linux:
./srcds_run -game garrysmod -console -port 27015 +maxplayers 24 +map gm_construct +gamemode sandbox +host_workshop_collection 1234567890 +sv_setsteamaccount GSLT_TOKENINIZ
On Windows, use the same parameters with srcds.exe:
srcds.exe -game garrysmod -console -port 27015 +maxplayers 24 +map gm_construct +gamemode sandbox +host_workshop_collection 1234567890 +sv_setsteamaccount GSLT_TOKENINIZ
What the parameters mean: options starting with - are engine options, and those starting with + are console commands run at startup. On a web panel, these values usually appear as separate fields on the startup settings screen; just enter the map, gamemode, player count and token there.
6. Ports and first connection
A GMod server uses port 27015 by default. Game traffic runs over UDP; RCON uses the TCP side of the same port. On a VDS, open these ports in the firewall:
sudo ufw allow 27015/udp
sudo ufw allow 27015/tcp
To connect, open the developer console in game (Options > Keyboard > Advanced > Enable developer console) and type:
connect SUNUCU_IP:27015
If the server doesn't show up in the internet list, first check that the GSLT was entered correctly and that sv_lan 0 is set, then look for Steam connection errors in the console output.
7. Give yourself admin rights
GMod's built-in permission system is limited; most servers use an admin mod. After the initial setup, you can make yourself superadmin from the server console (the command depends on the admin mod you use). To compare admin mods, check out our ULX vs. SAM guide.
Ready-made panel or your own VDS?
You can do every step above on your own VDS; that route gives you full control, but OS updates, the firewall, backups and restarting the server after a crash are all on you. With a ready-made game server, file setup is automatic, launch parameters show up as form fields in the panel, and you edit files from your browser. For admins running a single GMod server who'd rather spend their time on the community, a ready-made server is usually more practical; if you'll run several games and bots on the same machine, a VDS is more flexible.
How much RAM and CPU do you need?
A GMod server depends heavily on single-core performance; Lua code and physics calculations mostly run on a single thread. Memory needs grow with the amount of addons and Workshop content. As a general guideline, a Sandbox or TTT server with few addons runs comfortably on modest resources, while busy roleplay servers with lots of addons need more RAM.
For a mid-sized community starting out with a Workshop collection and dozens of addons, the OB-GMOD-3 Garry's Mod server plan with 4 CPUs and 8 GB RAM is a balanced choice. If you're planning a smaller or larger setup, compare all Garry's Mod server plans.
Common setup mistakes
- Token created with the wrong App ID: Use 4000, not 4020.
- Wrong gamemode name: The
+gamemodevalue must match the folder name undergarrysmod/gamemodes(for example,terrortownfor TTT). - Map not found: If you use a Workshop map, make sure the map is in the collection and the server has finished downloading the collection.
- Lua errors: Incompatible addons throw red errors in the console. The error line usually includes the problem addon's folder name; confirm it by temporarily removing the addon and restarting the server.
- Server starts and shuts down right away: Check the last lines of the console output; a broken addon or a missing map file is usually the cause.
First checklist after the server is up
- Make sure the RCON password is strong and only admins have it.
- Check that the name and player count show correctly in the server list.
- Connect with a second account or a friend to test that Workshop content downloads.
- Take regular backups: the
garrysmod/datafolder and thesv.dbfile hold player data and the records of many addons.
Next step: get your server running in minutes
Setting everything up by hand on your own VDS is a great way to learn, but if you want to focus on building a community, a ready-made server where you manage files and launch parameters from a web panel saves time. OyunBulut Garry's Mod servers run in our Istanbul data center; plans include DDoS protection, automatic setup and a web panel, and you can open a support ticket anytime. For a server with Workshop content, start with the 8 GB RAM OB-GMOD-3 plan.
Frequently asked questions
Which App ID do I use to get a GSLT for a GMod server?
Create the GSLT with 4000, the app ID of the Garry's Mod game. 4020 is only the ID used to download the dedicated server files with SteamCMD.
What port does a GMod server use?
The default port is 27015. Game traffic uses it over UDP and RCON over TCP; to use a different port, add the -port parameter to the launch line.
Where is the server.cfg file?
The file is at garrysmod/cfg/server.cfg. If it doesn't exist, you can create it; the server runs it automatically every time it starts.
My GMod server doesn't show up in the server list. What should I do?
Check that the GSLT token was entered correctly, that sv_lan is set to 0 and that port 27015 is open. In the meantime, players can connect directly with the connect IP:27015 command.
How much RAM does a GMod server need?
Sandbox or TTT servers with few addons run on modest resources; RAM needs grow as Workshop content and addon count increase. For mid-sized communities with addons, 8 GB is a good starting guideline.