Garry's Mod Server Setup: Dedicated Server Guide
GMod dedicated server setup, gamemode configuration, addon/workshop collection, FastDL, ULX admin mod, and server optimization.
Table of Contents
Introduction
Garry's Mod (GMod) is a sandbox game built on the Source Engine that offers unlimited creative possibilities. With gamemodes like DarkRP, TTT (Trouble in Terrorist Town), Sandbox, and many more, you can build your own community server. This guide covers the complete GMod dedicated server setup on your REXE VDS.
System Requirements
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 Cores | 4+ Cores |
| RAM | 4 GB | 8+ GB |
| Disk | 20 GB SSD | 40+ GB NVMe |
| OS | Ubuntu 22.04+ | Ubuntu 22.04 LTS |
| Bandwidth | 5 Mbps | 10+ Mbps |
RAM requirements vary based on the number of addons installed and player capacity. DarkRP servers typically require more RAM.
Prerequisites
Connect to your server via SSH and install required packages:
sudo apt update && sudo apt upgrade -y
sudo apt install -y lib32gcc-s1 lib32stdc++6 wget tar screen
Create a dedicated user:
sudo adduser gmod --disabled-login --gecos ""
sudo su - gmod
SteamCMD Installation
mkdir -p ~/steamcmd && cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz
./steamcmd.sh +quit
Download GMod Server Files
~/steamcmd/steamcmd.sh +force_install_dir ~/gmod-server \
+login anonymous \
+app_update 4020 validate \
+quit
App ID 4020 is the Steam ID for Garry's Mod Dedicated Server. The download is approximately 4-5 GB.
Install CSS (Counter-Strike: Source) Content
Many GMod gamemodes require CSS content:
~/steamcmd/steamcmd.sh +force_install_dir ~/css-content \
+login anonymous \
+app_update 232330 validate \
+quit
Mount CSS content to the GMod server:
nano ~/gmod-server/garrysmod/cfg/mount.cfg
"mountcfg"
{
"cstrike" "/home/gmod/css-content/cstrike"
}
Get a GSLT Token
A GSLT token is required for your server to appear in the server browser:
- Visit steamcommunity.com/dev/managegameservers
- App ID: 4000 (Garry's Mod)
- Copy the token
Create a separate GSLT token for each server. Never share your token.
Server Configuration
server.cfg
nano ~/gmod-server/garrysmod/cfg/server.cfg
hostname "My REXE GMod Server"
rcon_password "STRONG_RCON_PASSWORD"
sv_password ""
sv_defaultgamemode "sandbox"
sv_maxrate 0
sv_minrate 100000
sv_maxupdaterate 66
sv_minupdaterate 33
sv_timeout 120
sv_region 3
sv_lan 0
sv_allowdownload 1
sv_allowupload 0
net_maxfilesize 64
log on
Gamemode Options
| Gamemode | Description | sv_defaultgamemode |
|---|---|---|
| sandbox | Free build mode | sandbox |
| darkrp | Roleplay game | darkrp |
| terrortown | TTT - Detective game | terrortown |
| prophunt | Hide and seek | prop_hunt |
| murder | Murder mystery | murder |
| deathrun | Trap parkour | deathrun |
Startup Script
nano ~/gmod-server/start.sh
#!/bin/bash
cd ~/gmod-server
./srcds_run \
-game garrysmod \
-port 27015 \
-maxplayers 32 \
+gamemode sandbox \
+map gm_construct \
+sv_setsteamaccount GSLT_TOKEN \
-tickrate 33 \
+host_workshop_collection COLLECTION_ID \
-authkey STEAM_API_KEY
chmod +x ~/gmod-server/start.sh
Workshop Collection Setup
Manage addons via Steam Workshop collections:
1. Get a Steam API Key
Get your API key from steamcommunity.com/dev/apikey.
2. Create a Workshop Collection
- Create a new collection on Steam Workshop
- Add your desired addons to the collection
- Note the collection ID from the URL
3. Add to Server
In the startup script:
+host_workshop_collection COLLECTION_ID \
-authkey STEAM_API_KEY
For client-side auto-download, create lua/autorun/server/workshop.lua:
-- Force clients to download workshop addons
resource.AddWorkshop("ADDON_ID_1")
resource.AddWorkshop("ADDON_ID_2")
resource.AddWorkshop("ADDON_ID_3")
FastDL Setup
FastDL enables faster downloads of custom content:
Nginx FastDL
sudo apt install nginx -y
sudo nano /etc/nginx/sites-available/fastdl
server {
listen 8080;
server_name SERVER_IP;
location /garrysmod/ {
alias /home/gmod/gmod-server/garrysmod/;
autoindex on;
}
}
sudo ln -s /etc/nginx/sites-available/fastdl /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Add to server.cfg:
sv_downloadurl "http://SERVER_IP:8080/garrysmod/"
sv_allowdownload 1
FastDL allows players to download custom content much faster when connecting to your server.
ULX Admin Mod Installation
ULX is the most popular admin mod for GMod servers:
cd ~/gmod-server/garrysmod/addons
git clone https://github.com/TeamUlysses/ulib.git
git clone https://github.com/TeamUlysses/ulx.git
After restarting the server, in-game:
ulx adduserid STEAM_ID superadmin
ulx ban PLAYER_NAME 0 "Reason"
ulx kick PLAYER_NAME "Reason"
ulx noclip PLAYER_NAME
Port Configuration
| Port | Protocol | Usage |
|---|---|---|
| 27015 | TCP + UDP | GMod game server |
| 27005 | UDP | Client port |
| 27020 | UDP | SourceTV |
| 8080 | TCP | FastDL (optional) |
Path Panel Firewall
From the REXE Path Panel:
- GMod UDP: Protocol: UDP, Port: 27015, Filter: Source Engine
- GMod TCP: Protocol: TCP, Port: 27015
- Client: Protocol: UDP, Port: 27005
Auto-Start with systemd
sudo nano /etc/systemd/system/gmod.service
[Unit]
Description=Garry's Mod Dedicated Server
After=network.target
[Service]
Type=simple
User=gmod
Group=gmod
WorkingDirectory=/home/gmod/gmod-server
ExecStart=/home/gmod/gmod-server/start.sh
Restart=on-failure
RestartSec=15
LimitNOFILE=100000
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable gmod
sudo systemctl start gmod
DarkRP Setup
DarkRP is the most popular GMod gamemode:
cd ~/gmod-server/garrysmod/gamemodes
git clone https://github.com/FPtje/DarkRP.git darkrp
cd ~/gmod-server/garrysmod/addons
git clone https://github.com/FPtje/darkrpmodification.git
Update server.cfg:
sv_defaultgamemode "darkrp"
Server Optimization
Tickrate Settings
-tickrate 33 # Standard (recommended)
-tickrate 66 # High performance (requires more CPU)
Lua Optimization
lua_log_sv 0
sv_hibernate_think 1
gmod_physiterations 2
Auto-Update
nano ~/update_gmod.sh
#!/bin/bash
~/steamcmd/steamcmd.sh +force_install_dir ~/gmod-server +login anonymous +app_update 4020 +quit
chmod +x ~/update_gmod.sh
crontab -e
0 5 * * * /home/gmod/update_gmod.sh >> /home/gmod/update.log 2>&1
Conclusion
With a Garry's Mod dedicated server, you can create a community server with unlimited creative possibilities. Workshop collections, ULX admin mod, FastDL, and DarkRP bring your server to a professional level. REXE VDS powerful infrastructure provides ideal performance for your GMod server.
Related Articles
How to Set Up a FiveM Server: Step-by-Step Guide
Complete FiveM server setup guide on REXE VDS: installation, txAdmin configuration, port settings, and performance optimization tips for GTA V roleplay servers.
How to Set Up a Minecraft Server: Paper Installation Guide
Complete Minecraft server setup guide on REXE VDS: Paper/Spigot installation, Java configuration, plugin management, and performance optimization for stable gameplay.
How to Set Up a CS2 Dedicated Server: Complete Guide
Complete CS2 dedicated server setup guide on REXE VDS: SteamCMD installation, GSLT token, server configuration, game modes, and DDoS protection with Path Panel.