Garry's Mod

PlatformSupportNotes
Linux✅ NativeFull support
Windows✅ NativeFull support

Garry's Mod

Garry's Mod (GMod) is a physics sandbox with community gamemodes like DarkRP, TTT (Trouble in Terrorist Town), and custom game types. This guide covers installation, configuration, addon management, and administration.

  • RAM: 2GB minimum, 4GB+ recommended
  • vCPU: 2+ cores (higher performance for higher player counts)
  • Disk Space: 15GB+ (game ~2GB, addons and maps vary)
  • Network: Stable connection, ~3-5 Mbps for 32 players

Server performance scales well with hardware. Even modest VPS runs smooth GMod servers. Addon count and player complexity affect CPU more than RAM.

02

Prerequisites

  • Linux server (Ubuntu 20.04+ recommended)
  • SSH access
  • Steam account (free)
  • Basic Linux knowledge
03

Step 1: Install Dependencies

bash
sudo apt update
sudo apt upgrade -y
sudo apt install -y lib32gcc-s1 lib32stdc++6 curl wget unzip tmux
04

Step 2: Create Game User

bash
sudo useradd -m -s /bin/bash gmod
sudo passwd gmod

Switch to the user:

bash
su - gmod
05

Step 3: Install SteamCMD

bash
mkdir -p ~/steamcmd
cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzf steamcmd_linux.tar.gz
./steamcmd.sh +quit
06

Step 4: Install Garry's Mod Server

Download using SteamCMD (AppID 4020):

bash
cd ~/steamcmd
./steamcmd.sh +force_install_dir ~/gmod-server +login anonymous \
  +app_update 4020 validate +quit

This takes 5-10 minutes. Verify:

bash
ls -la ~/gmod-server/

You should see srcds_linux and other files.

07

Step 5: Basic Server Configuration

Create the server startup script:

bash
cat > ~/gmod-startup.sh << 'EOF'
#!/bin/bash

cd ~/gmod-server

# Core server settings
HOSTNAME="My Garry's Mod Server"
GAMEMODE="sandbox"           # sandbox, darkrp, ttt, prop_hunt, etc.
MAP="gm_construct"           # Start map
MAXPLAYERS="32"
TICKRATE="66"
PORT="27015"
RCON_PASSWORD="your_rcon_password_here"

# Start server
./srcds_linux \
  -game garrysmod \
  -port $PORT \
  +maxplayers $MAXPLAYERS \
  +map $MAP \
  +gamemode $GAMEMODE \
  +hostname "$HOSTNAME" \
  +rcon_password "$RCON_PASSWORD" \
  +sv_lan 0 \
  +sv_region 0 \
  -tickrate $TICKRATE \
  -norestart

EOF

chmod +x ~/gmod-startup.sh

Key Startup Parameters

  • -game garrysmod: Game mode (required)
  • -port 27015: Server port (default is 27015)
  • +maxplayers: Slot count (typical: 16, 32, 64)
  • +map: Starting map
  • +gamemode: Gamemode (sandbox, darkrp, ttt, etc.)
  • +sv_lan 0: Internet server (1 for LAN only)
  • -tickrate: Server update rate (66 or 100, higher = more CPU)
  • +hostname: Server name in browser
  • +rcon_password: RCON admin password
08

Step 6: Server Configuration Files

Create the main server.cfg:

bash
mkdir -p ~/gmod-server/garrysmod/cfg
cat > ~/gmod-server/garrysmod/cfg/server.cfg << 'EOF'
// Garry's Mod Server Configuration

// Server Information
hostname "My Garry's Mod Server"
sv_region "0"                          // 0=USA, 1=EU, 2=Asia, 3=Australia

// Player Settings
sv_password ""                         // Leave empty for public, set for private
sv_lan 0                              // 0=Internet, 1=LAN only
mp_maxplayers 32                      // Player slots

// Gameplay
mp_friendlyfire 0                     // Enable/disable friendly fire
mp_falldamage 1                       // Enable/disable fall damage
mp_flashlight 1                       // Allow flashlights
mp_footsteps 1                        // Footstep sounds

// Gravity and Physics
sv_gravity 600                        // World gravity (default 600)
sv_defaultdeploydelay 0
sv_deploydelay 0

// Network Settings
sv_mincmdrate 10
sv_maxcmdrate 100
sv_minupdaterate 10
sv_maxupdaterate 100
tick_interp_ratio 2                   // Interpolation ratio
sv_client_min_interp_ratio 1
sv_client_max_interp_ratio 2

// Timeout and Lag
sv_timeout 300                        // Client timeout in seconds
sv_timeout_zombie 300
sv_client_cmdrate_difference 40
sv_client_predict_disable 0

// Autosave
autosave_interval 300                 // Save every 5 minutes

// Logging and Reporting
log on                                // Enable logging
sv_logecho 1
sv_log_onefile 0
sv_logdir logs
sv_logbans 1

// Admin RCON
rcon_password "your_strong_rcon_password"

// Rules and Info
sv_contact "admin@tuodominio.com"
sv_downloadurl ""                     // FastDL URL (optional)
sv_allowdownload 1
sv_allowupload 1

// Limits
sv_maxrate 30000
sv_minrate 5000
sv_maxunlag 1.0

// Source Engine Limits
sv_parallel_packentities 1
sv_parallel_sendsnapshot 1

// Game-specific
gmod_allow_html_scripts 1             // Allow HTML panels in addons
gmod_allow_thirdperson 0              // Disable third-person camera
sv_alltalk 0                          // Voice communication (0=team only, 1=all)

EOF
09

Step 7: Add RCON User (Optional, Advanced)

For enhanced admin control, edit server.cfg and ensure:

bash
rcon_password "YourStrongPassword123"

Connect via RCON console (see admin section below).

10

Step 8: Create Systemd Service

Exit to root and create service:

bash
exit  # Exit gmod user
sudo tee /etc/systemd/system/gmod.service > /dev/null << 'EOF'
[Unit]
Description=Garry's Mod Dedicated Server
After=network.target
Wants=network-online.target

[Service]
Type=simple
User=gmod
WorkingDirectory=/home/gmod
ExecStart=/home/gmod/gmod-startup.sh
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal

# Resource limits
MemoryLimit=4G
CPUQuota=300%

[Install]
WantedBy=multi-user.target
EOF

Enable and start:

bash
sudo systemctl daemon-reload
sudo systemctl enable gmod
sudo systemctl start gmod

Check status:

bash
sudo systemctl status gmod
sudo journalctl -u gmod -f  # Live logs
11

Step 9: Install and Configure Addons

Addon Structure

GMod addons are stored in garrysmod/addons/:

bash
mkdir -p ~/gmod-server/garrysmod/addons

Install Addon Method 1: Steam Workshop (Automated)

Use mount.cfg to load Workshop addons:

bash
cat > ~/gmod-server/garrysmod/cfg/mount.cfg << 'EOF'
"mountcfg"
{
  "hl2"       "1"
  "tf"        "1"
  "episodic"  "1"
  "hl2mp"     "1"
}
EOF

For Workshop items, add to server startup:

bash
+host_workshop_collection 123456789

(Replace with actual collection ID)

Install Addon Method 2: Manual Download

Download addon ZIPs from github.com or facepunch.com and extract:

bash
cd ~/gmod-server/garrysmod/addons
unzip /path/to/addon.zip

Verify structure (should have addon.json or similar):

bash
ls -la addons/YourAddonName/

Popular Addons and Dependencies

Admin/Moderation:

Gamemodes:

Quality of Life:

Install ULX Admin Mod (Recommended)

bash
cd ~/gmod-server/garrysmod/addons

# Download ULib (dependency)
git clone https://github.com/Nayruden/ULib.git ulibmod

# Download ULX
git clone https://github.com/Nayruden/ULX.git ulxmod

# Or use releases
# wget https://github.com/Nayruden/ULib/releases/download/.../ULib.zip
# unzip ULib.zip

Always install addon dependencies first. Most complex addons require ULib/ULX or Wire Mod. Check addon documentation for requirements before installing.

  • ULX (Ulysses Admin Mod) - Essential admin tools
  • ULib - ULX dependency
  • DarkRP - Advanced roleplay with jobs
  • Trouble in Terrorist Town (TTT) - Traitor game
  • Prop Hunt - Hide and seek with props
  • Murder - One killer, others are investigators
  • Advanced Duplicator - Save/load contraptions
  • Wire Mod - Advanced electronics/logic gates
  • Easier Lua - Better Lua environment
12

Step 10: Install Gamemode (Example: DarkRP)

DarkRP is a popular roleplay gamemode:

bash
cd ~/gmod-server/garrysmod/addons

# Clone DarkRP
git clone https://github.com/DarkRP/DarkRP.git darkrpmod
git clone https://github.com/DarkRP/DarkRP-Modification.git darkrpmodification

Modify startup script to use DarkRP:

bash
# Edit ~/gmod-startup.sh
+gamemode darkrp
+map rp_downtown_v2c

Popular DarkRP maps: rp_downtown_v2c, rp_evocity_v2d, rp_bangcok

13

Step 11: Firewall Configuration

GMod uses port 27015 (TCP/UDP):

bash
sudo ufw allow 27015/tcp comment "GMod"
sudo ufw allow 27015/udp comment "GMod"

Or with iptables:

bash
sudo iptables -A INPUT -p tcp --dport 27015 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 27015 -j ACCEPT
14

Step 12: Server Administration

Connect via In-Game Console

RCON Console Access (Remote)

Install an RCON client (HLDSUpdateTool, Sourcemod, or CLI):

bash
# Install hlsw (optional GUI tool)
# Or use telnet for raw RCON
telnet tuodominio.com 27015

In-Game Admin Commands (with ULX)

After installing ULX, admins can use:

!help # List all commands !kick [player] # Kick player !ban [player] [minutes] # Temporarily ban !permaban [player] # Permanent ban !unban [steamid] # Unban player !mute [player] # Mute player !gag [player] # Gag voice chat !slay [player] # Kill player !slaybots # Kill all bots !map [mapname] # Change map !ulx rcon [command] # Execute console command !addgroup [groupname] # Create admin group !adduser [steamid] [group] # Add user to group !motd [message] # Set message of the day !ulx help # Full ULX command list

User Groups and Permissions

ULX stores admin data in garrysmod/data/ulx/users.txt:

bash
cat ~/gmod-server/garrysmod/data/ulx/users.txt

Add admin manually by Steam ID:

bash
echo "76561198999999999 superadmin" >> ~/gmod-server/garrysmod/data/ulx/users.txt

Restart server to apply changes.

  • Launch GMod locally
  • Create a localhost server or connect to your server
  • Open console: ~ key
  • Type: connect tuodominio.com:27015
15

Step 13: Monitoring and Maintenance

Check Server Status

bash
sudo systemctl status gmod
sudo ps aux | grep srcds_linux

Monitor Logs

bash
sudo journalctl -u gmod -f
tail -f ~/gmod-server/garrysmod/console.log

Update Server

bash
sudo systemctl stop gmod
cd ~/steamcmd
./steamcmd.sh +force_install_dir ~/gmod-server +login anonymous \
  +app_update 4020 validate +quit
sudo systemctl start gmod

Keep srcds updated to maintain version compatibility with clients. Old srcds versions prevent modern clients from connecting. Check for updates weekly.

16

Step 14: Optimize Performance

Reduce Server Load

Network Optimization

bash
# Edit server.cfg
sv_maxrate 30000           # Max bandwidth per player
sv_minrate 5000            # Min bandwidth per player
tick_interp_ratio 2        # Reduce lag compensation
  • Limit maxplayers based on hardware (16-32 typical for 2vCPU)
  • Reduce tickrate to 33 on limited hardware
  • Disable unnecessary addons
  • Monitor memory with htop
17

Troubleshooting

Server won't start

bash
cd ~/gmod-server
./srcds_linux -game garrysmod +map gm_construct

Check for missing dependencies or syntax errors in server.cfg.

Players can't connect

Verify firewall:

bash
sudo netstat -tuln | grep 27015

Check sv_lan setting (should be 0 for internet).

High CPU usage

Addons causing crashes

Remove suspect addon from addons/ folder and restart:

bash
mv ~/gmod-server/garrysmod/addons/suspected-addon ~/suspected-addon-backup
sudo systemctl restart gmod
  • Reduce player count
  • Disable/optimize addons
  • Lower tickrate to 33
  • Disable complex gamemodes temporarily
18

Backup and Server Data

Backup Configuration and Addons

bash
tar -czf ~/gmod-backup-$(date +%Y%m%d).tar.gz ~/gmod-server/garrysmod/cfg ~/gmod-server/garrysmod/addons
19

Windows Server Setup

Step 1: Download Server on Windows

cmd
steamcmd +force_install_dir "C:\GMod-Server" +login anonymous +app_update 4020 validate +quit

Step 2: Create Startup Batch File

Create C:\GMod-Server\start-server.bat:

batch
@echo off
cd /d C:\GMod-Server
srcds.exe -game garrysmod -console -port 27015 +maxplayers 32 +map gm_construct +hostname "My Server" +rcon_password "password"
pause

Step 3: Run as Service (Optional)

Use NSSM to run as Windows service:

powershell
nssm install GModServer "C:\GMod-Server\srcds.exe" "-game garrysmod -console -port 27015 +exec server.cfg"
nssm start GModServer

Step 4: Configure Firewall

Open firewall port in Windows:

powershell
netsh advfirewall firewall add rule name="GMod Game Port" dir=in action=allow protocol=udp localport=27015
netsh advfirewall firewall add rule name="GMod Game Port" dir=in action=allow protocol=tcp localport=27015
20

Tips & Tweaks

Server.cfg Rate Settings

CVarValueImpact
sv_maxrate30000Maximum bandwidth per client
sv_minrate5000Minimum bandwidth (prevents throttling)
sv_maxupdaterate100Server updates per second (higher = more CPU)
sv_minupdaterate10Client minimum update rate
tick_interp_ratio2Interpolation ratio (stability over precision)
sv_timeout300Client timeout seconds

Essential ULX Commands Reference

CommandSyntaxPurpose
!kick!kick [player]Kick player from server
!ban!ban [player] [minutes]Temporary ban
!permaban!permaban [player]Permanent ban
!unban!unban [steamid]Remove ban
!map!map [mapname]Change map
!mute!mute [player]Mute chat
!gag!gag [player]Mute voice
!slay!slay [player]Kill player
!freezeplayer!freezeplayer [player]Freeze position
!say!say [message]Admin broadcast
!addgroup!addgroup [name]Create admin group
!adduser!adduser [steamid] [group]Add group member

FastDL Setup (Bandwidth Optimization)

FastDL serves custom content (maps, models, sounds) via HTTP instead of slow Steam downloads.

sv_downloadurl "http://yourdomain.com/fastdl/" fastdl/ ├── maps/ ├── models/ ├── sound/ └── materials/ fastdl/maps/your_map.bsp fastdl/models/custom/model.mdl

Workshop Collection Mounting

Automatically download Workshop addons by collection ID:

bash
# In startup parameters
+host_workshop_collection 1234567890

Players automatically download all addons in collection on connect.

  • Host files on web server: http://yourdomain.com/fastdl/
  • Edit server.cfg:
  • Create folder structure:
  • Add files matching game paths:
21

Next Steps

  • Configure FastDL for faster addon/map downloads (advanced)
  • Set up automated daily/weekly restarts via cron
  • Install additional gamemodes for variety
  • Configure Discord bot for admin notifications
  • Monitor player stats and server load trends
  • Plan regular addon updates and maintenance windows

DeluxHost, opgericht in 2023, biedt hoogwaardige hostingoplossingen voor diverse digitale behoeften. Wij bieden gedeelde hosting, VPS en dedicated servers met geavanceerde beveiliging en wereldwijde datacenters.

© DeluxHost, Alle rechten voorbehouden. | BTW-nummer: IT17734661006
Alle systemen operationeel