Docs / Game Servers / How to Set Up a Garry's Mod Server

How to Set Up a Garry's Mod Server

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 24 views · 2 min read

Overview

Garry's Mod (GMod) is a sandbox game built on the Source engine. It supports custom game modes like TTT, DarkRP, and Prop Hunt, making it one of the most modded games on Steam.

Requirements

  • A Breeze with at least 2 GB RAM (4 GB for addons)
  • 15 GB disk space

Step 1: Install the Server

sudo useradd -r -m -d /opt/gmod gmodserver
sudo -u gmodserver steamcmd +force_install_dir /opt/gmod/server \
  +login anonymous \
  +app_update 4020 validate \
  +quit

Step 2: Create a Start Script

sudo -u gmodserver tee /opt/gmod/start.sh <<'EOF'
#!/bin/bash
cd /opt/gmod/server
./srcds_run -game garrysmod \
  +maxplayers 24 \
  +map gm_construct \
  +gamemode sandbox \
  +host_workshop_collection YOUR_COLLECTION_ID \
  -authkey YOUR_STEAM_API_KEY \
  +sv_setsteamaccount YOUR_GSLT
EOF
chmod +x /opt/gmod/start.sh

Step 3: Create a Systemd Service

sudo tee /etc/systemd/system/gmod.service <<EOF
[Unit]
Description=Garry's Mod Server
After=network.target

[Service]
User=gmodserver
WorkingDirectory=/opt/gmod
ExecStart=/opt/gmod/start.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now gmod

Firewall

sudo ufw allow 27015/tcp
sudo ufw allow 27015/udp

Popular Game Modes

ModeDescription
SandboxFree building, default mode
TTTTrouble in Terrorist Town — social deduction
DarkRPRoleplaying framework
Prop HuntHide and seek with props
MurderMystery game mode

Adding Workshop Addons

Create a Steam Workshop collection and use the +host_workshop_collection parameter with your collection ID. You will need a Steam Web API key.

Was this article helpful?