Dedicated GMod server for sandbox gameplay with custom gamemodes and Workshop addons
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/gaming/garrys-mod/garrys-mod-ubuntu.sh
chmod +x garrys-mod-ubuntu.sh
sudo bash garrys-mod-ubuntu.sh
The script installs Docker, pulls the GMod dedicated server image via SteamCMD, and starts the container. The server downloads ~1.5 GB of game files and runs on port 27015 UDP.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/gaming/garrys-mod/garrys-mod-ubuntu.sh
chmod +x garrys-mod-ubuntu.sh
sudo bash garrys-mod-ubuntu.sh
Edit server.cfg to set hostname, gamemode, max players, and server password. Choose from sandbox, darkrp, terrortown, prophunt, and more.
# Edit server configuration
nano /opt/garrysmod/data/garrysmod/cfg/server.cfg
# Key settings:
# hostname "My GMod Server"
# gamemode "sandbox" // or darkrp, terrortown, etc.
# maxplayers 32
# sv_password "" // leave empty for public
# sv_allowupload 1
# sv_allowdownload 1
Open GMod, click Find Multiplayer Game, search by server name in the Community tab, or use the developer console to connect directly.
# In-game console (press ~):
connect <your-server-ip>:27015
Install ULX admin mod for comprehensive server management. Use RCON commands for remote administration and monitor server logs for issues.
# Connect via RCON
docker exec -it garrysmod-server rcon-cli --port 27015 --password yourrconpass
# ULX in-game commands:
# ulx adduser <name> superadmin
# ulx kick <name> <reason>
# ulx ban <name> <minutes> <reason>
# ulx noclip <name>
# View live logs
docker logs -f garrysmod-server
| Port | Purpose |
|---|---|
| 27015 UDP | Game traffic and Steam query |
Garry's Mod (GMod) is a sandbox physics game built on the Source engine where players manipulate objects and experiment with physics. A dedicated server hosts custom game modes like DarkRP, TTT (Trouble in Terrorist Town), Prop Hunt, and many more, all powered by Lua addons from the Steam Workshop.
Self-hosting a GMod server gives you full control over addons, game mode, player count, admin tools, and server rules. Popular community servers require custom addon combinations, workshop collections, and ULX admin mod that are only possible with a dedicated server.
GMod uses UDP port 27015 for game connections. Open UDP port 27015. For FastDL, you need a separate web server on port 80 or 443. RCON uses TCP port 27015 — keep this firewalled.
Alternatives include popular community servers (no setup needed), FiveM (GTA V mod, similar concept), and other Source game servers. Self-hosting GMod gives full control over the addon ecosystem and community rules.
Avoid self-hosting GMod if you just want to play with friends casually — use the built-in friend invite system. Self-hosting is best when building a community server with specific addons, game modes, and an established player base.
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
DarkRP is the most popular Garry's Mod game mode — a roleplay framework where players take jobs, earn money, buy properties, and interact in a simulated society. Install DarkRP from GitHub, configure jobs and salaries in DarkRP configuration files, and add addon packages for weapons, vehicles, and custom jobs from the Workshop.
ULX (Ultimate Lua Extensions) is the standard admin mod for Garry's Mod servers. It provides a permission hierarchy (superadmin, admin, user), admin commands for kicking and banning players, access control lists, and a menu for GUI-based moderation. Install ULX and ULIB from the Workshop — almost all community servers use them.
Add Workshop addon IDs or a collection ID to your server configuration. The server downloads addons via Steam and mounts them. Clients connecting to the server are prompted to download and subscribe to the same Workshop items. For faster client downloads, set up FastDL to serve addon content via HTTP.
FastDL (Fast Download) is a web server that serves custom maps, sounds, and other game content to clients faster than the in-game download. Set up a web server (Nginx or Apache) serving the garrysmod content directory. Set sv_downloadurl in server.cfg to the web server URL. Clients then download content at full bandwidth speed.
GMod supports up to 128 players per server, though most servers run 30 to 64. Performance depends heavily on the game mode and addons — DarkRP with many active players and complex jobs can be CPU-intensive. For DarkRP with 50 players, use 4 CPU cores and 4 GB RAM minimum.
No — a GMod server runs one game mode at a time. To host multiple game modes, run separate server instances on different ports. Many communities run separate servers for each game mode (one for DarkRP, one for TTT) and use a website lobby to direct players.
Lua errors appear in the server console when addon scripts contain bugs or conflicts. Check the console log for error lines showing the file and line number. Common causes: outdated addons that reference removed functions, conflicting addons that override the same functions, and DarkRP configuration mistakes. Update or remove problematic addons.
Place sound files in the garrysmod/sound directory and reference them in Lua scripts. For client-side sounds, configure the sound files in Workshop addons and set up FastDL so clients download them. Custom ambient music and notification sounds are a common customization for DarkRP servers.