Skip to content
Garry's Mod

Install a Garry's Mod server

The Garry's Mod dedicated server is installed with SteamCMD (app 4020, anonymous login) and started with srcds_run (Linux) or srcds.exe (Windows). Plan about 30 minutes, a VPS or a PC and a GSLT server token, mandatory according to the Facepunch wiki. Main source: wiki.facepunch.com/gmod.

Last updated: 10/9/2026

The Garry's Mod dedicated server is installed with SteamCMD (app 4020, anonymous login) and started with srcds_run (Linux) or srcds.exe (Windows). Plan about 30 minutes, a VPS or a PC and a GSLT server token, mandatory according to the Facepunch wiki. Main source: wiki.facepunch.com/gmod.

Step-by-step installation

  1. Choose the machine: a Linux VPS (Ubuntu/Debian) or a Windows PC; load depends mostly on addons and gamemode.

  2. Create a non-root user (steam) and install SteamCMD plus the 32-bit libraries.

  3. Download the server: app_update 4020 validate with an anonymous login.

  4. Create a GSLT token (AppID 4000) at steamcommunity.com/dev/managegameservers.

  5. Generate the launch line with the “Garry's Mod launch command” tool and start srcds_run.

  6. Configure garrysmod/cfg/server.cfg with the “Garry's Mod server.cfg generator” tool.

  7. Add your addons with a Workshop collection (+host_workshop_collection).

  8. Open the ports (27015 UDP/TCP at minimum) in ufw, at the provider and on the router.

  9. Test locally (connect 127.0.0.1 in the game console) then from another connection.

  10. Create a systemd service and schedule updates and backups.

Prerequisites

  • OS: Linux (Ubuntu/Debian) or Windows. The Facepunch wiki gives Windows and Linux commands.
  • Resources: the wiki sets no minimum. Start from 2 vCPU, 4 GB RAM and several GB of disk, then adjust to your addons and player count (not officially documented).
  • Accounts: a Steam account for the GSLT token (AppID 4000); the server itself installs with an anonymous login.

Local installation on Windows

After unzipping SteamCMD in C:\steamcmd, install the server then run srcds.exe (Facepunch wiki example). Then test with connect 127.0.0.1 in the game console.

cd C:\steamcmd
steamcmd +force_install_dir C:\gmodds +login anonymous +app_update 4020 validate +quit

cd C:\gmodds
srcds.exe -console -game garrysmod +maxplayers 20 +gamemode sandbox +map gm_construct +sv_setsteamaccount YOUR_GSLT_TOKEN

Linux VPS: user and dependencies

The Source server is a 32-bit program: enable the i386 architecture and install the 32-bit libraries. The packages below come from the Team Fortress wiki (same engine); names may vary by distribution.

sudo adduser steam
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32gcc-s1 lib32stdc++6 lib32z1 steamcmd
su - steam

Linux VPS: install and first start

Linux install command from the Facepunch wiki, then start with srcds_run. The page does not detail ports or the exact server.cfg location; standard Source values apply (see below).

steamcmd +login anonymous +force_install_dir /home/steam/gmodds +app_update 4020 validate +quit

cd /home/steam/gmodds
./srcds_run -game garrysmod -console +maxplayers 32 +gamemode sandbox +map gm_construct +sv_setsteamaccount YOUR_GSLT_TOKEN

Workshop and GSLT token

According to the Facepunch wiki, +sv_setsteamaccount is mandatory (without it the server's ranking is penalized) and +host_workshop_collection adds the addons of a public or unlisted collection, sub-collections included. host_workshop_autoupdate 0 stops automatic updates but can prevent players from joining if the map version is outdated. The wiki also mentions a new cfg/srcds_workshop_ids.txt format (version 2026.09.22 or later): see its “Workshop for Dedicated Servers” page. For player-side downloads, see the “Workshop collection manager” tool.

./srcds_run -game garrysmod -console +maxplayers 32 +gamemode sandbox +map gm_construct \
  +host_workshop_collection 123456789 \
  +sv_setsteamaccount YOUR_GSLT_TOKEN

Ports to open and Linux firewall (ufw)

These ports are the standard Source server values (the Facepunch wiki page consulted does not list them). To change the game port, use -port N on the launch line. Workshop addons download through Steam: no extra player-side port is documented.

Open only what you need, then test from another connection (not from the server itself).

  • 27015/udp: game (default Source port)
  • 27015/tcp: RCON
  • 27005/udp: client communication
  • 27020/udp: SourceTV (optional)
sudo ufw allow OpenSSH
sudo ufw allow 27015/udp
sudo ufw allow 27015/tcp
sudo ufw allow 27005/udp
sudo ufw allow 27020/udp
sudo ufw enable
sudo ufw status

Windows firewall (netsh)

In an administrator command prompt, create one inbound rule per port (or open “Windows Defender Firewall with Advanced Security”).

netsh advfirewall firewall add rule name="Garry's Mod 27015 UDP" dir=in action=allow protocol=UDP localport=27015
netsh advfirewall firewall add rule name="Garry's Mod 27015 TCP" dir=in action=allow protocol=TCP localport=27015
netsh advfirewall firewall add rule name="Garry's Mod 27005 UDP" dir=in action=allow protocol=UDP localport=27005
netsh advfirewall firewall add rule name="Garry's Mod 27020 UDP" dir=in action=allow protocol=UDP localport=27020

Provider firewall and port forwarding (home router)

At a host (OVH, Hetzner, Scaleway…), also open the same ports in the provider's firewall or “security group”: ufw is not enough if an upstream firewall exists. For a home server, create a port forward (NAT) in your router for each port to the machine's local IP address (make it static or reserve it via DHCP).

Test: from another connection, add the server as “IP:port” in Garry's Mod's server browser or in the console. If it fails, check in order: service running, local firewall, provider firewall, NAT forward.

Automatic start: systemd service

Create /etc/systemd/system/gmod.service (as root), then enable it. Adapt the user and paths; read logs with journalctl -u gmod -f.

[Unit]
Description=Garry's Mod dedicated server
After=network-online.target
Wants=network-online.target

[Service]
User=steam
WorkingDirectory=/home/steam/gmodds
ExecStart=/home/steam/gmodds/srcds_run -game garrysmod -console -norestart +maxplayers 32 +gamemode sandbox +map gm_construct +sv_setsteamaccount YOUR_GSLT_TOKEN
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

# then:
# sudo systemctl daemon-reload
# sudo systemctl enable --now gmod

Windows: scheduled task at startup

On Windows, a scheduled task runs your .bat script at system startup (run the command in an administrator prompt).

schtasks /Create /TN "Garry's Mod server" /TR "C:\gmodds\start-gmod.bat" /SC ONSTART /RU SYSTEM /RL HIGHEST

Updates, backups and scheduled restarts

Stop the service before updating (same SteamCMD command as for installation), back up configuration and data files regularly, and schedule a daily restart if the server degrades over time.

sudo systemctl stop gmod
steamcmd +force_install_dir /home/steam/gmodds +login anonymous +app_update 4020 validate +quit
sudo systemctl start gmod

# backup
tar czf ~/gmod-$(date +%F).tar.gz -C /home/steam/gmodds garrysmod/cfg garrysmod/data garrysmod/addons

# daily restart at 05:00 (root crontab: sudo crontab -e)
0 5 * * * systemctl restart gmod

List and find your server

Add your server at https://game-rank.com/jeux/garrys-mod to make it visible to the community. To find it in game, use the server browser or connect directly with its IP:port.

Troubleshooting: common errors

  • Clients stuck loading or “missing content”: addons not provided to players. Fix: add the IDs in workshop.lua (resource.AddWorkshop) or set sv_downloadurl (FastDL), and check the collection is public.
  • Server invisible from outside: the service runs but nobody can connect. Cause: closed port (ufw, provider firewall or missing NAT forward). Fix: open the ports listed above at all three levels and test from another connection.
  • Port already in use at startup: another instance holds the port. Fix: list processes with ss -lunp | grep 27015, stop the old instance, or give each server a different port with -port.
  • SteamCMD “Failed to install app” or stalled download: frequent cause, full disk or insufficient folder permissions. Fix: check df -h and the folder owner, then rerun the command with validate (several times if needed).
  • srcds_run: “No such file or directory” or missing 32-bit library: the Source server is a 32-bit program. Fix: enable the i386 architecture (dpkg --add-architecture i386) and install lib32gcc-s1 and lib32stdc++6.

Frequently asked questions

Is the GSLT token mandatory?
The Facepunch wiki states +sv_setsteamaccount is mandatory and that skipping it penalizes the server's ranking. Use AppID 4000 to create the token.
How do I change gamemode (DarkRP, TTT…)?
With +gamemode <folder> on the launch line, where the folder is in garrysmod/gamemodes/ or an addon's gamemodes/ folder. You can also change the gamemode convar and then change map.
Can I run the server as root?
Not recommended: create a dedicated user (for example steam) without admin rights, and install and run the server with it. A flaw in the server or a plugin then does not compromise the whole machine.
My Garry's Mod server does not appear in the list: what should I check?
First check that the ports are open at every level, that the server is not in LAN mode (sv_lan 0) and, if the game requires it, that a valid server token (GSLT) is provided. The Steam list can take a few minutes to refresh; meanwhile, connect by IP:port.

Tools for your Garry's Mod server

Garry's Mod
Garry's ModOpen access
Build your Garry's Mod server.cfg: name, passwords, region, FastDL downloads, sandbox limits and security settings.
ConfigurationSandboxOpen
Documentation
Garry's Mod
Garry's ModOpen access
Generate the Garry's Mod srcds launch line: map, gamemode, slots, port, Workshop collection and GSLT token.
LaunchConfigurationOpen
Documentation
Garry's Mod
Garry's ModSign-in required
Paste your Workshop links: cleaned, de-duplicated IDs, the +host_workshop_collection parameter and a ready workshop.lua file.
WorkshopAddonsOpen
Documentation
Garry's Mod
Garry's ModSign-in required
Generate DarkRP's settings.lua: economy, salaries, speeds, laws, chat distances and limits, with the official defaults.
DarkRPConfigurationRoleplayOpen
Documentation
Garry's Mod
Garry's ModSign-in required
Paste a Garry's Mod Lua script: detects unclosed end, brackets and strings before you restart the server.
LuaDevelopmentOpen
Documentation