Skip to main content
Back to Category

Garry's Mod Server Setup: Dedicated Server Guide

GMod dedicated server setup, gamemode configuration, addon/workshop collection, FastDL, ULX admin mod, and server optimization.

Read time: 15 min Game Server Setup
garrys-modgmodgame serversteamcmddedicated server

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

ResourceMinimumRecommended
CPU2 Cores4+ Cores
RAM4 GB8+ GB
Disk20 GB SSD40+ GB NVMe
OSUbuntu 22.04+Ubuntu 22.04 LTS
Bandwidth5 Mbps10+ 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:

hljs bash
sudo apt update && sudo apt upgrade -y
sudo apt install -y lib32gcc-s1 lib32stdc++6 wget tar screen

Create a dedicated user:

hljs bash
sudo adduser gmod --disabled-login --gecos ""
sudo su - gmod

SteamCMD Installation

hljs bash
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

hljs bash
~/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:

hljs bash
~/steamcmd/steamcmd.sh +force_install_dir ~/css-content \
  +login anonymous \
  +app_update 232330 validate \
  +quit

Mount CSS content to the GMod server:

hljs bash
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:

  1. Visit steamcommunity.com/dev/managegameservers
  2. App ID: 4000 (Garry's Mod)
  3. Copy the token

Create a separate GSLT token for each server. Never share your token.

Server Configuration

server.cfg

hljs bash
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

GamemodeDescriptionsv_defaultgamemode
sandboxFree build modesandbox
darkrpRoleplay gamedarkrp
terrortownTTT - Detective gameterrortown
prophuntHide and seekprop_hunt
murderMurder mysterymurder
deathrunTrap parkourdeathrun

Startup Script

hljs bash
nano ~/gmod-server/start.sh
hljs bash
#!/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
hljs bash
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

  1. Create a new collection on Steam Workshop
  2. Add your desired addons to the collection
  3. Note the collection ID from the URL

3. Add to Server

In the startup script:

hljs bash
+host_workshop_collection COLLECTION_ID \
-authkey STEAM_API_KEY

For client-side auto-download, create lua/autorun/server/workshop.lua:

hljs 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

hljs bash
sudo apt install nginx -y
sudo nano /etc/nginx/sites-available/fastdl
hljs nginx
server {
    listen 8080;
    server_name SERVER_IP;

    location /garrysmod/ {
        alias /home/gmod/gmod-server/garrysmod/;
        autoindex on;
    }
}
hljs bash
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:

hljs bash
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

PortProtocolUsage
27015TCP + UDPGMod game server
27005UDPClient port
27020UDPSourceTV
8080TCPFastDL (optional)

Path Panel Firewall

From the REXE Path Panel:

  1. GMod UDP: Protocol: UDP, Port: 27015, Filter: Source Engine
  2. GMod TCP: Protocol: TCP, Port: 27015
  3. Client: Protocol: UDP, Port: 27005

Auto-Start with systemd

hljs bash
sudo nano /etc/systemd/system/gmod.service
hljs ini
[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
hljs bash
sudo systemctl daemon-reload
sudo systemctl enable gmod
sudo systemctl start gmod

DarkRP Setup

DarkRP is the most popular GMod gamemode:

hljs bash
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

hljs bash
nano ~/update_gmod.sh
hljs bash
#!/bin/bash
~/steamcmd/steamcmd.sh +force_install_dir ~/gmod-server +login anonymous +app_update 4020 +quit
hljs bash
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.