Garry's Mod
| Platform | Support | Notes |
|---|---|---|
| Linux | ✅ Native | Full support |
| Windows | ✅ Native | Full 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.
Prerequisites
- Linux server (Ubuntu 20.04+ recommended)
- SSH access
- Steam account (free)
- Basic Linux knowledge
Step 1: Install Dependencies
sudo apt update
sudo apt upgrade -y
sudo apt install -y lib32gcc-s1 lib32stdc++6 curl wget unzip tmux
Step 2: Create Game User
sudo useradd -m -s /bin/bash gmod
sudo passwd gmod
Switch to the user:
su - gmod
Step 3: Install SteamCMD
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
Step 4: Install Garry's Mod Server
Download using SteamCMD (AppID 4020):
cd ~/steamcmd
./steamcmd.sh +force_install_dir ~/gmod-server +login anonymous \
+app_update 4020 validate +quit
This takes 5-10 minutes. Verify:
ls -la ~/gmod-server/
You should see srcds_linux and other files.
Step 5: Basic Server Configuration
Create the server startup script:
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
Step 6: Server Configuration Files
Create the main server.cfg:
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
Step 7: Add RCON User (Optional, Advanced)
For enhanced admin control, edit server.cfg and ensure:
rcon_password "YourStrongPassword123"
Connect via RCON console (see admin section below).
Step 8: Create Systemd Service
Exit to root and create service:
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:
sudo systemctl daemon-reload
sudo systemctl enable gmod
sudo systemctl start gmod
Check status:
sudo systemctl status gmod
sudo journalctl -u gmod -f # Live logs
Step 9: Install and Configure Addons
Addon Structure
GMod addons are stored in garrysmod/addons/:
mkdir -p ~/gmod-server/garrysmod/addons
Install Addon Method 1: Steam Workshop (Automated)
Use mount.cfg to load Workshop addons:
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:
+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:
cd ~/gmod-server/garrysmod/addons
unzip /path/to/addon.zip
Verify structure (should have addon.json or similar):
ls -la addons/YourAddonName/
Popular Addons and Dependencies
Admin/Moderation:
Gamemodes:
Quality of Life:
Install ULX Admin Mod (Recommended)
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
Step 10: Install Gamemode (Example: DarkRP)
DarkRP is a popular roleplay gamemode:
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:
# Edit ~/gmod-startup.sh
+gamemode darkrp
+map rp_downtown_v2c
Popular DarkRP maps: rp_downtown_v2c, rp_evocity_v2d, rp_bangcok
Step 11: Firewall Configuration
GMod uses port 27015 (TCP/UDP):
sudo ufw allow 27015/tcp comment "GMod"
sudo ufw allow 27015/udp comment "GMod"
Or with iptables:
sudo iptables -A INPUT -p tcp --dport 27015 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 27015 -j ACCEPT
Step 12: Server Administration
Connect via In-Game Console
RCON Console Access (Remote)
Install an RCON client (HLDSUpdateTool, Sourcemod, or CLI):
# 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:
cat ~/gmod-server/garrysmod/data/ulx/users.txt
Add admin manually by Steam ID:
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
Step 13: Monitoring and Maintenance
Check Server Status
sudo systemctl status gmod
sudo ps aux | grep srcds_linux
Monitor Logs
sudo journalctl -u gmod -f
tail -f ~/gmod-server/garrysmod/console.log
Update Server
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.
Step 14: Optimize Performance
Reduce Server Load
Network Optimization
# 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
Troubleshooting
Server won't start
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:
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:
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
Backup and Server Data
Backup Configuration and Addons
tar -czf ~/gmod-backup-$(date +%Y%m%d).tar.gz ~/gmod-server/garrysmod/cfg ~/gmod-server/garrysmod/addons
Windows Server Setup
Step 1: Download Server on Windows
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:
@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:
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:
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
Tips & Tweaks
Server.cfg Rate Settings
| CVar | Value | Impact |
|---|---|---|
sv_maxrate | 30000 | Maximum bandwidth per client |
sv_minrate | 5000 | Minimum bandwidth (prevents throttling) |
sv_maxupdaterate | 100 | Server updates per second (higher = more CPU) |
sv_minupdaterate | 10 | Client minimum update rate |
tick_interp_ratio | 2 | Interpolation ratio (stability over precision) |
sv_timeout | 300 | Client timeout seconds |
Essential ULX Commands Reference
| Command | Syntax | Purpose |
|---|---|---|
!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:
# 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:
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
Gerelateerde artikelen
CS2
How to install and configure a Counter-Strike 2 dedicated server on Linux VPS with SteamCMD
Palworld
Create a dedicated Palworld server on Linux with SteamCMD. Configuration, ports and automatic startup.
Rust
Install and manage a Rust server (Facepunch) on Linux with SteamCMD. Includes automatic updates, Oxide plugins and optimizations.
