GamingAugust 4, 20264 min read

How to Set Up a Garry's Mod Server on a VPS

Install and run a dedicated Garry's Mod server on a Linux VPS with SteamCMD, set your gamemode and map, and keep it online with systemd.

NBy Nxeon

Garry's Mod is a sandbox built on the Source engine, and a dedicated server is what turns it into a shared playground — Sandbox builds, TTT rounds, DarkRP towns, prop hunt lobbies. This guide gets a GMod dedicated server running on a Linux VPS and keeps it online.

What you need

  • A VPS: Ubuntu 22.04 or Debian 12, 2 vCPU and 4 GB RAM is a good starting point for 16–24 players. Addon-heavy servers (DarkRP with lots of content) want more.
  • SteamCMD: the Garry's Mod dedicated server is App ID 4020 and installs anonymously — no Steam login needed.
  • Ports: GMod uses UDP 27015 (game) and UDP 27005 (client). A public server also benefits from a GSLT.

Step 1: User and dependencies

sudo adduser --disabled-password --gecos "" gmod
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32gcc-s1 lib32stdc++6 steamcmd

Step 2: Install Garry's Mod with SteamCMD

sudo su - gmod
steamcmd +force_install_dir /home/gmod/server +login anonymous +app_update 4020 validate +quit

Many gamemodes expect Counter-Strike: Source content (textures, props). You can mount CS:S by installing App ID 232330 and pointing GMod at it, but for a plain Sandbox server you can skip that for now.

Deploying a new server with the Nxeon one-click deploy wizard
Deploying a new server with the Nxeon one-click deploy wizard

Step 3: Open the firewall

sudo ufw allow 27015/udp
sudo ufw allow 27005/udp
sudo ufw reload

Open the same ports in your provider's network firewall if it has one.

Step 4: Start the server

The Source dedicated server launcher is srcds_run. Start a Sandbox server on gm_construct:

cd /home/gmod/server
./srcds_run -console -game garrysmod \
  +gamemode sandbox \
  +map gm_construct \
  +maxplayers 24 \
  +host_workshop_collection 0 \
  -port 27015

To run a different gamemode, change +gamemode — common values are sandbox, terrortown (TTT), darkrp, and prop_hunt (each gamemode must be installed as an addon). To run DarkRP, install the DarkRP addon into garrysmod/gamemodes first, then set +gamemode darkrp.

Step 5: Keep it online with systemd

Create /etc/systemd/system/gmod.service:

[Unit]
Description=Garry's Mod Dedicated Server
After=network.target

[Service]
Type=simple
User=gmod
WorkingDirectory=/home/gmod/server
ExecStart=/home/gmod/server/srcds_run -console -game garrysmod +gamemode sandbox +map gm_construct +maxplayers 24 -port 27015
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now gmod
sudo journalctl -u gmod -f

The server config file

Edit /home/gmod/server/garrysmod/cfg/server.cfg:

hostname "My Nxeon GMod Server"
sv_password ""
rcon_password "change-this-strong-password"
sv_lan 0
gamemode "sandbox"
sv_loadingurl ""

Set a strong rcon_password and leave sv_lan 0 so the internet can reach you.

Adding content

The best part of GMod is addons — weapons, maps, gamemodes, and prop packs from the Steam Workshop. Rather than hand-copying files, most servers use a Workshop collection. We cover the whole process in how to install addons on a Garry's Mod server, including setting up a Workshop collection ID and using a content GMA mount.

Hardware and next steps

A 4 GB plan runs a lively Sandbox or TTT server well; DarkRP with heavy addons and 40+ players wants 6–8 GB and strong single-thread speed. See Game Server Specs Explained: CPU, RAM and Bandwidth to size correctly, and if you also want a shooter on the same box, our CS2 dedicated server guide uses the same SteamCMD workflow.

Mounting Counter-Strike: Source content

Many popular gamemodes and maps expect CS:S assets, and without them you'll see purple-and-black error textures. Install CS:S with SteamCMD and mount it:

steamcmd +force_install_dir /home/gmod/css +login anonymous +app_update 232330 validate +quit

Then edit garrysmod/cfg/mount.cfg to point at the CS:S content:

"cstrike" "/home/gmod/css/cstrike"

Restart and the missing textures disappear.

Performance tuning for busy servers

GMod's single Lua thread is the bottleneck on a packed DarkRP or TTT server. A few habits keep it smooth:

  • Keep your addon count lean — every active addon runs Lua each tick. Remove what you don't use.
  • Watch tick health in the console; a healthy server holds close to its tickrate.
  • Schedule a nightly restart to clear accumulated entities and Lua state — see automate game server restarts with systemd and cron.

Before you pile on content, set up automatic backups of your garrysmod folder and any gamemode database — how to back up your game server automatically makes a bad addon update easy to roll back.

FAQ

What App ID is the Garry's Mod dedicated server?

App ID 4020. It installs anonymously through SteamCMD with +app_update 4020 validate.

Do I need Counter-Strike: Source content?

Only for gamemodes and maps that reference CS:S assets (you'll see purple-and-black error textures otherwise). Mount CS:S by installing App ID 232330 and adding it to your mount.cfg.

Why is my server missing from the browser?

Set sv_lan 0, confirm UDP 27015 is open on both firewalls, and add a Steam Game Server Login Token for a stable public listing.

How many players can a GMod server hold?

The engine allows up to 128, but practical limits depend on the gamemode and your hardware. Sandbox at 24–32 players is smooth on a modest VPS; DarkRP is far heavier per player.

Get started on an NVMe game server VPS from Nxeon — full root access, one-click Linux images, and the headroom GMod addons love.

#garrys mod#gmod#dedicated server#steamcmd#game servers#seobatch

Deploy your first server in under a minute

Creating an account is free and takes no card details. You pay when you deploy — choose a billing term and pay from your wallet or by card at checkout.