---
title: "How to host a Garry's Mod server on a Linux VPS | StreetHosting"
description: "Garry's Mod dedicated server on a Linux VPS: SteamCMD, server.cfg, Workshop collection, ULX, port 27015, systemd and backups of the database and addons."
url: "https://streethosting.com.br/en/guides/vps/host-garrys-mod-server"
type: "page"
language: "en-US"
---

VPS · 10 min · Intermediate

Published on Sep 28, 2026 · Updated on Sep 28, 2026

# Garry's Mod dedicated server on Linux, with Workshop and ULX

The Garry's Mod server runs natively on Linux and is a free download through SteamCMD. See how much VPS each game mode needs, how to configure it, distribute Workshop addons, administer with ULX and keep the database backed up.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Linux administration](https://streethosting.com.br/en/guides/topics/linux) [Hardware and datacenter](https://streethosting.com.br/en/guides/topics/hardware) [Mods and modpacks](https://streethosting.com.br/en/guides/topics/mods) [Other games](https://streethosting.com.br/en/guides/topics/other-games)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20host%20a%20Garry%27s%20Mod%20server%20on%20a%20Linux%20VPS&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server "Share on LinkedIn") [](https://wa.me/?text=How%20to%20host%20a%20Garry%27s%20Mod%20server%20on%20a%20Linux%20VPS%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-garrys-mod-server "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server.md)

In this guide 8 sections

* [How much VPS GMod needs](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#requisitos)
* [Prepare the VPS and install](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#instalar)
* [server.cfg, GSLT and the start script](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#configurar)
* [Addons, Workshop and ULX](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#addons)
* [Ports and firewall](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#portas)
* [systemd service and updates](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#systemd)
* [Backing up the database and addons](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#backup)
* [Which VPS to choose](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#qual-vps)

Quick answer

To **host a Garry's Mod server**, install SteamCMD on a Linux VPS, download app 4020, configure server.cfg and start srcds\_run with the game mode, the map and the Workshop collection, inside a systemd service. Open port 27015 over UDP. A sandbox for friends runs on 2 GB of RAM; DarkRP with 64 players needs 6 to 8 GB and a high clock CPU.

## How much VPS GMod needs[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#requisitos)

The Garry's Mod server uses the Source engine, and almost all of the simulation, including the Lua code of the addons, runs on one main core. That is why CPU clock speed and the number of addons weigh the most, not the vCPU count. The game mode changes the math a lot: a sandbox among friends is light, and a full DarkRP server, with dozens of addons and entities spread across the map, is one of the most demanding servers on Source.

| Scenario                                         | RAM       | vCPU   | Disk        | Suggested plan                  |
| ------------------------------------------------ | --------- | ------ | ----------- | ------------------------------- |
| Up to 12 players, sandbox or TTT, few addons     | 2 GB      | 2      | 20 GB       | Xeon VPS R$ 26.00               |
| 16 to 32 players, TTT or Prop Hunt with Workshop | 4 GB      | 2      | 40 GB       | Ryzen VPS R$ 66.00              |
| DarkRP or roleplay up to 64 players              | 6 to 8 GB | 3 to 4 | 60 to 80 GB | Ryzen VPS R$ 92.00 or R$ 118.00 |
| Two or three servers on the same VPS             | 12 GB     | 5      | 120 GB      | Ryzen VPS R$ 170.00             |

Each server basically uses one core; the extra vCPUs serve the system, the database, the backup and other instances. Disk usage grows with the Workshop collection and with the Counter Strike: Source content, which many game modes require and takes up a few GB. The game accepts up to 128 slots, but above 64 players the real limit becomes the CPU and how well the addons are optimized.

## Prepare the VPS and install[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#instalar)

The commands apply to Ubuntu 24.04 and 22.04. Administer the VPS with a user that has sudo, as shown in the guide on [creating a sudo user on a Linux VPS](https://streethosting.com.br/en/guides/vps/create-sudo-user-linux-vps), and run the game under its own user, with no administrator privileges. If a malicious addon or a server flaw gets exploited, the damage stays contained inside that user.

`sudo useradd -m -s /bin/bash gmod sudo add-apt-repository multiverse sudo dpkg --add-architecture i386 sudo apt update sudo apt install steamcmd lib32gcc-s1 lib32stdc++6 tmux git sqlite3`

The `steamcmd` package asks you to accept the Steam license during installation; accept it with the arrow keys and Enter. tmux keeps the server console reachable, git downloads ULX and sqlite3 handles the database backup. Now switch to the game user and download the server, with the directory set before the login, otherwise SteamCMD ignores the destination:

`sudo -iu gmod /usr/games/steamcmd +force_install_dir /home/gmod/server +login anonymous +app_update 4020 validate +quit`

The download is a few GB. The default branch installs the 32-bit server, started by `srcds_run`. There is also the `x86-64` branch, with the 64-bit executable, but the binary modules of some addons have separate versions for it. Start with the default and only switch if all of your addons are compatible.

## server.cfg, GSLT and the start script[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#configurar)

The server's permanent options live in `~/server/garrysmod/cfg/server.cfg`, which you create with nano:

`hostname "GMod Brasil | Sandbox" sv_password "" rcon_password "TroqueEstaSenha" sv_region 2 sv_allowcslua 0 net_maxfilesize 64`

* **hostname:** the name shown in the server list.
* **sv\_password:** empty leaves the server open; with a value, only those who know the password get in.
* **rcon\_password:** the remote administration password. Use a long, unique password.
* **sv\_region 2:** marks the region as South America in the list filter.
* **sv\_allowcslua 0:** prevents players from running their own Lua on the client, a classic door for cheating.

For a public server, generate a GSLT token on [Steam's game servers page](https://steamcommunity.com/dev/managegameservers) entering app 4000, which is the Garry's Mod app for players. The token is not required for the server to work, but it ties the server to your account and gives it a fixed identity in the list. Each server must have its own token.

Game mode, map, slots and collection are passed on the command line. To keep that out of the service file, create the script `/home/gmod/iniciar.sh` and make it executable with `chmod +x ~/iniciar.sh`:

`#!/bin/bash cd /home/gmod/server MODO=sandbox MAPA=gm_construct VAGAS=16 COLECAO=0 TOKEN=SEU_TOKEN_GSLT exec ./srcds_run -game garrysmod -console -norestart -port 27015 +maxplayers $VAGAS +gamemode $MODO +map $MAPA +host_workshop_collection $COLECAO +sv_setsteamaccount $TOKEN`

The `-norestart` parameter turns off the restart built into srcds\_run, because systemd is going to handle that. For TTT, change the game mode to `terrortown`, which ships with the game, and use a ttt map from your collection. Run the script once by hand, check in the console that the map loaded without errors and close it with the quit command.

## Addons, Workshop and ULX[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#addons)

The cleanest way to distribute addons is a public Workshop collection. Create the collection on your Steam account, add the maps, models and scripts, and put its number, which appears at the end of the page address, in the script's COLECAO variable. The server downloads everything at startup, and players receive the items when they join.

* **Item that does not reach the player:** create a Lua file in `garrysmod/lua/autorun/server/` with one `resource.AddWorkshop("ID_DO_ITEM")` line for each item that needs to be downloaded.
* **Collection that does not download:**older server versions required a Steam Web API key in the authkey parameter. If the collection does not download and the log complains about authentication, check the official Garry's Mod wiki to see whether your version still needs it.
* **Addons outside the Workshop:** go as folders in `garrysmod/addons`, and whole game modes, like DarkRP, in `garrysmod/gamemodes`, following each project's instructions.

Many TTT and DarkRP maps use models and textures from Counter Strike: Source. Without that content, you get the infamous red ERRORs and purple textures. That game's dedicated server is also free, and mount.cfg tells GMod where it is:

`/usr/games/steamcmd +force_install_dir /home/gmod/css +login anonymous +app_update 232330 validate +quit nano ~/server/garrysmod/cfg/mount.cfg "mountcfg" { "cstrike" "/home/gmod/css/cstrike" }`

For administration, the community standard is the ULib and ULX pair. Install both straight from the official repositories into the addons folder and restart the server:

`cd ~/server/garrysmod/addons git clone https://github.com/TeamUlysses/ulib.git git clone https://github.com/TeamUlysses/ulx.git`

Join the server with your account and, in the server console, give yourself the top rank with `ulx adduser SeuNome superadmin`. From there, the `!menu` command in chat opens the ULX graphical panel, with kicks, bans, groups and permissions, and commands like `!kick` and `!ban` work right in chat. To update ULX later, run `git pull` inside each folder.

## Ports and firewall[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#portas)

| Port  | Protocol | Role                         | Open it?                    |
| ----- | -------- | ---------------------------- | --------------------------- |
| 27015 | UDP      | Game and server list queries | Yes                         |
| 27015 | TCP      | RCON, remote administration  | Only for your IP, or closed |
| 27005 | UDP      | Client port, used outbound   | Not needed                  |
| 22    | TCP      | SSH to administer the VPS    | Yes, before enabling UFW    |

`sudo ufw allow OpenSSH sudo ufw allow 27015/udp sudo ufw allow from SEU_IP to any port 27015 proto tcp sudo ufw enable`

Replace SEU\_IP with the IP you administer from, or skip that line if you do not use RCON: with ULX, almost everything is handled from inside the game. The guide on the [UFW firewall on an Ubuntu VPS](https://streethosting.com.br/en/guides/vps/ufw-firewall-ubuntu-vps) explains the rules in detail. For a second server on the same VPS, use 27016 in its script and open that port too.

Source servers are among the most common targets of denial of service attacks, especially in roleplay communities with rivalries between groups. The [Anti-DDoS guide for game servers](https://streethosting.com.br/en/guides/infrastructure/anti-ddos-game-server-brazil) shows what network protection solves and what remains your job. If the server does not show up in the list, check:

* **Missing UDP rule:** `sudo ufw status` must show 27015/udp. Opening only TCP is the most common mistake.
* **List filters:** the Steam list takes a few minutes to show a new server. Test first from the game console with `connect IP:27015`.
* **Missing library:** if the log complains about a missing .so file, install the 32-bit version of the package, with :i386 in the name. Messages about steamclient.so are usually fixed with a link to it in the \~/.steam/sdk32 folder; locate the file with `find ~ -name steamclient.so`.

## systemd service and updates[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#systemd)

The server takes commands through its console, so it runs inside a tmux session controlled by systemd. That way it comes up on its own with the VPS, comes back after a crash and you can still type commands. Log out of the game user and create `/etc/systemd/system/gmod.service`:

`[Unit] Description=Servidor Garry's Mod After=network-online.target Wants=network-online.target [Service] Type=forking User=gmod WorkingDirectory=/home/gmod/server ExecStart=/usr/bin/tmux new-session -d -s gmod /home/gmod/iniciar.sh ExecStop=/bin/sh -c '/usr/bin/tmux send-keys -t gmod "quit" Enter; while /usr/bin/tmux has-session -t gmod 2>/dev/null; do sleep 1; done' TimeoutStopSec=60 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target`

`sudo systemctl daemon-reload sudo systemctl enable --now gmod sudo -iu gmod tmux attach -t gmod`

The last command opens the console. To leave without shutting the server down, press Ctrl+B and then D. To update the game, stop the service, run SteamCMD again and bring it back up:

`sudo systemctl stop gmod sudo -iu gmod /usr/games/steamcmd +force_install_dir /home/gmod/server +login anonymous +app_update 4020 validate +quit sudo systemctl start gmod`

validate restores any original game files that were changed. Your addons and data folders and server.cfg stay in place, but run the backup from the next section before every update: it is your guarantee of rolling back if an addon breaks on the new version.

## Backing up the database and addons[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#backup)

What cannot be lost in GMod is the SQLite database `garrysmod/sv.db`, where game modes like DarkRP store the players' money, properties and progress, and the data folder, where many addons, including ULX, save groups, permissions and settings. sqlite3 copies the database consistently even while the server is running. As the gmod user, create the script `/home/gmod/backup.sh`:

`#!/bin/bash DESTINO=/home/gmod/backups BASE=/home/gmod/server/garrysmod DATA=$(date +%F-%H%M) mkdir -p "$DESTINO" [ -f "$BASE/sv.db" ] && sqlite3 "$BASE/sv.db" ".backup '$DESTINO/sv-$DATA.db'" tar -czf "$DESTINO/gmod-$DATA.tar.gz" -C "$BASE" data cfg addons -C /home/gmod iniciar.sh find "$DESTINO" -name 'sv-*.db' -mtime +14 -delete find "$DESTINO" -name 'gmod-*.tar.gz' -mtime +14 -delete`

1. Permission: `chmod +x ~/backup.sh`
2. Scheduler: `crontab -e`
3. Every three hours: `0 */3 * * * /home/gmod/backup.sh`

Workshop collection items are not included in the backup because the server downloads everything again on its own; just keep the collection number, which is already in iniciar.sh. If your DarkRP uses MySQL instead of SQLite, add a dump of that database to the script. To send the copies off the VPS, follow the guide on [automated backups with restic and cron](https://streethosting.com.br/en/guides/vps/vps-backup-restic-cron).

To restore, stop the service before replacing sv.db or the data folder. With the server running, it can overwrite the restored copy the next time it saves a player.

## Which VPS to choose for Garry's Mod[](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#qual-vps)

For a sandbox or TTT among friends, with few addons, the [Xeon VPS](https://streethosting.com.br/en/vps/xeon) at R$ 26.00 per month, with 2 vCPUs, 2 GB and 20 GB NVMe, gets the job done and is the cheapest way to keep the server always online.

For an open community, the math changes. Since GMod runs almost everything on one core, a server full of Lua addons depends on clock speed to avoid stuttering, and that is where the [Ryzen 9 9950X VPS](https://streethosting.com.br/en/vps/ryzen), with up to 5.7 GHz and DDR5, is the right choice. TTT or Prop Hunt with up to 32 players fit in the R$ 66.00 plan, with 2 vCPUs, 4 GB and 40 GB. DarkRP with 64 players lands between R$ 92.00, with 3 vCPUs, 6 GB and 60 GB, and R$ 118.00, with 4 vCPUs, 8 GB and 80 GB. A network with two or three servers fits in the R$ 170.00 plan, with 5 vCPUs and 12 GB.

All of them are in São Paulo, with Anti-DDoS included and activation within 60 seconds, and upgrading through the control panel charges only the prorated difference for the cycle, with one VPS reboot. Compare the lines in the [VPS hub](https://streethosting.com.br/en/vps). If your group also plays Unturned, the [Unturned server guide](https://streethosting.com.br/en/guides/vps/host-unturned-server) follows the same path with SteamCMD and fits on the same VPS if there is headroom.

In this guide

* [How much VPS GMod needs](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#requisitos)
* [Prepare the VPS and install](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#instalar)
* [server.cfg, GSLT and the start script](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#configurar)
* [Addons, Workshop and ULX](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#addons)
* [Ports and firewall](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#portas)
* [systemd service and updates](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#systemd)
* [Backing up the database and addons](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#backup)
* [Which VPS to choose](https://streethosting.com.br/en/guides/vps/host-garrys-mod-server#qual-vps)

## Frequently asked questions

How much RAM does a Garry's Mod server need?

A sandbox or TTT server with up to 16 players and few addons runs on 2 GB. Servers with 24 to 32 players and a large Workshop collection do well with 4 GB, and DarkRP with 64 players and many addons needs 6 to 8 GB. CPU clock speed matters as much as RAM.

Which port does the Garry's Mod server use?

The default port is 27015. Over UDP it carries the game and the server list queries, and it must be open. Over TCP it serves RCON, which should be restricted to your IP or closed.

How do I make players download the addons automatically?

Build a public Workshop collection and pass its number in the host\_workshop\_collection parameter. The server downloads the items at startup. If an item does not reach the players, register its download with resource.AddWorkshop in a server-side Lua file.

Why do ERRORs and purple textures show up on the server?

Many maps and game modes, like TTT and DarkRP, use content from Counter Strike: Source. Mount that content on the server through mount.cfg and let players know they also need it to see the models correctly.

Is the GSLT token mandatory in Garry's Mod?

The server works without it, but using one is recommended for a public server. The token is generated on Steam's game servers page with app 4000 and ties the server to your account, with a fixed identity in the list.

Next step

See Ryzen VPS

Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.

[See Ryzen VPS](https://streethosting.com.br/en/vps/ryzen)

[See VPS plans Root VPS in Brazil with NVMe and Anti-DDoS.](https://streethosting.com.br/en/vps) [See Xeon VPS Xeon VPS for steady workloads, automation and long-running projects.](https://streethosting.com.br/en/vps/xeon)

## Related guides

[VPS Intermediate How to host an Unturned server on a Linux VPS Unturned ships a native Linux dedicated server and runs well on a small VPS. This guide covers installation, configuration, maps, plugins and ports, including the details that most often take down a new server. 9 min Read guide](https://streethosting.com.br/en/guides/vps/host-unturned-server) [VPS Intermediate How to host a CS2 server in Brazil on a VPS Counter-Strike 2 demands a fast CPU and a stable network. This guide turns the technical requirements into plain terms for community owners, amateur leagues and hubs that want fair matches in Brazil. 2 min Read guide](https://streethosting.com.br/en/guides/vps/host-cs2-server-brazil) [VPS Beginner UFW on Ubuntu VPS: firewall rules without losing SSH UFW makes the Ubuntu firewall simpler, but one rule in the wrong order locks you out of your VPS. Learn how to enable it without losing SSH, open only what you need, deal with Docker, and get back in through the console if something goes wrong. 10 min Read guide](https://streethosting.com.br/en/guides/vps/ufw-firewall-ubuntu-vps)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
