Why not just host from your own PC?
Because the game ends the moment your PC shuts down. A dedicated server keeps your sandbox world, your roleplay town or your gamemode open around the clock, whoever is online. It also keeps your home connection out of it: Valve points out that a household line may not have the upload speed for big games, and that some providers put customers behind shared addresses that make hosting impossible.
Facepunch, the studio behind the game, does offer a lighter option. Starting the server with -p2p runs it in peer-to-peer mode and prints how friends can join by hand. That suits a handful of friends for an evening. For a server that appears in the browser and is there every day, read on.
What to have ready before you begin
- Garry's Mod in your Steam library. The server download is free, but the login token needs a verified purchase on that account.
- An x86 Linux server you can reach over SSH. Facepunch wrote its guide for Debian and its relatives, Ubuntu included.
- Your addons in one Steam Workshop collection, set to public or unlisted. A private collection cannot be read by the server.
- Enough disk for the game plus everything your addons and maps bring with them.
Will a small machine cope?
For the bare game, very likely: Facepunch gives no hardware figure for Garry's Mod, and the general Source server page on Valve's wiki asks for only a 1.0 GHz processor and half a gigabyte (512 MB) of RAM at minimum for a simple server with 20 slots. The same page highly recommends 4 GB of RAM or more on newer operating systems, for example recent Windows versions and certain Linux distributions. It covers every Source game, so take it as a starting line, not a promise.
What really decides it is what you add. Heavy gamemodes, dozens of Lua addons and players spawning hundreds of props are what push the processor and memory. Start with the addon list you actually plan to use, watch the server with a full room, and size up from there.
Getting the server running, step by step
These steps combine Valve's Ubuntu notes for SteamCMD with the Linux guide from Facepunch. Connect over SSH as root and go through it in order. Note that the firewall is switched on first, so nothing is reachable before you mean it to be, and that the game itself never runs as root; Valve calls that a security risk.
- Turn on the firewall, letting in only SSH and the game port.
- Enable the 32-bit packages and install SteamCMD; you will be asked to agree to the Steam licence during installation.
- Create a normal user called
steamfor the server to live under. - Download app 4020 as that user. Run the same line again later whenever there is an update.
- Write your settings file, keep your token in a private file, and start the server with a small script.
ufw allow OpenSSH
ufw allow 27015/udp
ufw enable
add-apt-repository multiverse
dpkg --add-architecture i386
apt update
apt install steamcmd
useradd -m steam
sudo -u steam bash -c 'cd /home/steam && /usr/games/steamcmd +force_install_dir /home/steam/gmodds +login anonymous +app_update 4020 validate +quit'
install -m 600 -o steam -g steam /dev/null /home/steam/gslt
nano /home/steam/gslt
cat > /home/steam/run.sh <<'EOF'
cd /home/steam/gmodds || exit 1
exec ./srcds_run -game garrysmod +maxplayers 20 +gamemode sandbox \
+map gm_construct +host_workshop_collection 123456789 \
+sv_setsteamaccount "$(cat /home/steam/gslt)"
EOF
chown steam:steam /home/steam/run.sh
chmod 700 /home/steam/run.sh
Paste your token into the nano window and save. Swap 123456789 for your own collection number, and sandbox for your gamemode's folder name; Facepunch says Workshop gamemodes usually give that name in their description. The server never runs as root: Facepunch's guide starts it from the steam user's crontab, so run crontab -u steam -e, add the line @reboot /bin/bash /home/steam/run.sh, save, and reboot the machine. From then on it comes back by itself after every restart.
Your login token and admin password
Two secrets come with every server, and anyone who has them can misuse your server or your Steam listing. Treat both like passwords.
The login token (GSLT). Make one on Steam's page for managing game server tokens. In the App ID box enter 4000, which is the number for Garry's Mod itself, and add a note so you know which server it belongs to. Facepunch says every server should have one since the May 2020 update; servers without one drop sharply in the server list. Give every server its own token, because two servers on one token keep throwing each other off Steam. Save it as /home/steam/gslt with chmod 600. It still goes to the server on its start line, so other people with a login on the machine could see it in the process list; on a server only you log in to, that risk is yours alone. Changing your Steam password cancels all your tokens, and a server given a dead token will not start.
The remote admin password. Put rcon_password in garrysmod/cfg/server.cfg along with hostname, the name shown in the browser. Then run chmod 600 on that file so only the steam user can read it. While you are there, set sv_location to your country's two-letter code (for example us or gb) so players see the right flag next to your server.
Your addons, downloaded for you
The +host_workshop_collection setting on the start line does the work. At every start the server fetches the whole collection, sub-collections too, and mounts it. When the map you run is part of the collection, the server tells joining players to download it automatically.
Updates to those addons arrive on each restart. If you would rather approve changes yourself, Facepunch describes host_workshop_autoupdate 0, with a fair warning: a map that has moved on to a newer version may then stop players getting in. Since the 2026.09.22 release you can also list addon numbers in a text file, cfg/srcds_workshop_ids.txt, instead of or alongside a collection.
Letting players in
Valve's port list gives 27015 for both UDP and TCP. Players and the server browser only need UDP, which the firewall step already opened. The TCP side carries remote administration (RCON), so we suggest you keep it closed. If you want a console you can type into, start the server inside tmux: make the crontab line @reboot tmux new-session -d -s gmod /bin/bash /home/steam/run.sh, and attach later as the steam user with tmux attach -t gmod. Port 27020 matters only if you record or broadcast matches with SourceTV.
Running a second server on the same machine? Give it its own folder, its own token and a different port with the -port option, then open that port too.
The server that fits
Our game server machines are whole physical servers on HPE enterprise hardware, so every core and every gigabyte belongs to your community. Each sits on a port that is not shared with any other customer at the access switch.
- Traffic: the port is unmetered, 500 Mbps or 1 Gbps depending on the line, so a packed weekend never becomes a bandwidth bill.
- Speed: a machine already in the rack is yours about 30 minutes after your order is approved; payment checks can add time. The instant servers page shows those machines.
- Cities: Bucharest, Amsterdam, New York, Miami or San Francisco. Choose the one nearest most of your players.
- Rescue: rack servers and blades have a browser console, which appears in your dashboard after you set up a console login; shut yourself out with a bad firewall rule and you can still undo it.
- Freedom: Ubuntu installs in one click, and you pay month to month with no contract.
One to skip: our ARM machines. The Steam server tools need an Intel or AMD processor. The Linux server page shows which systems each line installs, and our walkthrough on hosting Counter-Strike 2 uses the same token routine if your community plays both.
Keeping it healthy
When Garry's Mod updates, stop the server first, because Facepunch warns the update fails while it runs. As root, run pkill -u steam -f srcds (it matches both srcds_run and srcds_linux), or type quit in the tmux console if you used tmux. Then repeat the SteamCMD download line and bring it back with a reboot, or without one with sudo -u steam tmux new-session -d -s gmod /bin/bash /home/steam/run.sh, which keeps it running after you log out. Want to try test builds? Facepunch publishes branches such as dev and prerelease; to come back, update with -beta public, because just leaving the option out keeps you on the test build.
Copy your garrysmod/cfg and garrysmod/data folders somewhere else on a regular schedule, so a bad addon update never costs you your settings. And read Facepunch's Server Operator Rules before you open the doors: servers that break them are blacklisted from the list.
Questions people ask
- Does the server cost anything to download?
- No. SteamCMD fetches app 4020 with an anonymous login, no purchase needed. Owning the game on Steam matters only when you create the login token.
- What number do I type as the App ID for the token?
- Type 4000. That is Garry's Mod itself; 4020 is only the server download. Make a fresh token for each server you run.
- My server will not start after I added the token. Why?
- Facepunch says a server handed a wrong or expired token refuses to start. If you changed your Steam password recently, every token you had was cancelled; regenerate it on Steam's game server page and update the file.
- Can I hide my server until it is ready?
- Set
hide_server 1. The server keeps running for anyone who connects directly, but it stays out of the public browser until you set it back to 0. - Can players get my maps and models automatically?
- Yes, through the Workshop. When the running map is in your server's collection, joining players are told to download it, and Facepunch's Serving Content page describes adding other Workshop items for players with
resource.AddWorkshop.