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 \
+quitStep 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.shStep 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 gmodFirewall
sudo ufw allow 27015/tcp
sudo ufw allow 27015/udpPopular Game Modes
| Mode | Description |
|---|---|
| Sandbox | Free building, default mode |
| TTT | Trouble in Terrorist Town — social deduction |
| DarkRP | Roleplaying framework |
| Prop Hunt | Hide and seek with props |
| Murder | Mystery 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.