EN · $ USD
Survival and Sandbox Servers

How to Set Up a Garry's Mod Server

7 min read Updated: OyunBulut technical team

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
  1. First decision: picking a gamemode
  2. 1. Install the server files
  3. 2. Get a GSLT (Steam Game Server Login Token)
  4. 3. Write your server.cfg
  5. 4. Set up Workshop content
  6. 5. Start the server
  7. 6. Ports and first connection
  8. 7. Give yourself admin rights
  9. Ready-made panel or your own VDS?
  10. How much RAM and CPU do you need?
  11. Common setup mistakes
  12. First checklist after the server is up
  13. 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.

GamemodeFolder / parameter nameBest forLoad
SandboxsandboxFree building, groups of friendsDepends on prop count
Trouble in Terrorist TownterrortownRound-based, competitive communitiesLow to medium
DarkRPdarkrpRoleplay serversHigh, depending on addons
Prop Hunt, Murder, etc.The mod's folder nameCasual fun serversLow

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.

  1. Sign in with your Steam account at steamcommunity.com/dev/managegameservers.
  2. 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.
  3. Fill in the memo with a name you'll recognize the server by, then create the token.
  4. 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 +gamemode value must match the folder name under garrysmod/gamemodes (for example, terrortown for 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

  1. Make sure the RCON password is strong and only admins have it.
  2. Check that the name and player count show correctly in the server list.
  3. Connect with a second account or a friend to test that Workshop content downloads.
  4. Take regular backups: the garrysmod/data folder and the sv.db file 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.

For this guide

Recommended plans

OyunBulut Garry's Mod servers come with automatic setup and a web panel so you can configure GSLT, gamemode and Workshop settings in minutes, and OB-GMOD-3's 8 GB RAM gives a community with addons plenty of room.

OB-GMOD-1

Recommended

4 GB RAM

$3.54/mo

+VAT

  • Processor4 CPU
  • Disk30 GB NVMe
  • LocationIstanbul
  • DDoS Protection
  • Automatic Setup
  • Web Panel
  • 7/24 Support

6 GB RAM

$5.31/mo

+VAT

  • Processor4 CPU
  • Disk35 GB NVMe
  • LocationIstanbul
  • DDoS Protection
  • Automatic Setup
  • Web Panel
  • 7/24 Support

8 GB RAM

$7.47/mo

+VAT

  • Processor4 CPU
  • Disk45 GB NVMe
  • LocationIstanbul
  • DDoS Protection
  • Automatic Setup
  • Web Panel
  • 7/24 Support

Garry’s Mod — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.