Quick answer
A Garry's Mod dedicated server (srcds) uses port 27015 for game traffic, pings and RCON (UDP and TCP; change it with -port). If friends can't join, forward 27015 to the server PC and allow srcds through the firewall. If the server doesn't show in the browser, check hide_server and set a GSLT with +sv_setsteamaccount <token>: the Garry's Mod wiki calls the token mandatory and ranks servers without one lower. Behind CGNAT, the server's -p2p mode lets players connect without port forwarding.
Ports
27015UDP + TCP: Game traffic, pings (Steam query) and RCON. Set with-port27005UDP: Client port (-clientport)27020UDP: SourceTV (+tv_port), only if you use it
How to fix it, step by step
- Install and start the server. Install with SteamCMD (
app_update 4020 validate), then runsrcds.exe -console +maxplayers 20 +gamemode sandbox +map gm_construct. On Linux:./srcds_run -game garrysmod +maxplayers 32 +map gm_construct. - Add a GSLT. Create a token at steamcommunity.com/dev/managegameservers and add
+sv_setsteamaccount <token>to the launch line. The wiki says it's mandatory and servers without it are ranked lower in the browser. - Forward 27015. Reserve the server PC's local IP and forward 27015 UDP and TCP to it. If you used
-port, forward that port and shareIP:port. - Allow srcds through the firewall. Allow srcds.exe on Private and Public networks in Windows Firewall, or open 27015 on Linux.
- Make it visible. Check
hide_serverisn't 1. Setsv_location(for examplesv_location us) so the right flag shows. - Test from outside. Have a friend open the console and
connect your-public-ip:27015. Joining your own public IP from inside your network can fail even when the forward works. If outside joins time out, check for CGNAT (see the CGNAT guide).
Hosting without port forwarding
The Garry's Mod wiki notes that a dedicated server can run in peer-to-peer mode with the -p2p launch option. On startup the server prints how players can connect to it manually. Useful behind CGNAT.
Workshop content
Add +host_workshop_collection <collectionID> to the launch line so the server installs a Workshop collection.
Test it from the outside
Your own Wi-Fi can't tell you whether friends can reach the server. The free Server Doctor check contacts your server once from the internet, the way the game does, and tells you the most likely cause. The same check runs in Discord with /fix.
No PC to host 24/7?
A GMod server needs your PC on whenever people play. Behind CGNAT the browser can't reach it. A rented server keeps it online with a public IP.
Related guides
- Friends can't join your CS2 server?
- Friends can't join your Terraria server?
- Friends can't join your Minecraft server? Here's the fix.
- Behind CGNAT? Host a game server without port forwarding.
- All guides
Sources: wiki.facepunch.com/gmod/Downloading_a_Dedicated_Server · developer.valvesoftware.com/wiki/Source_Dedicated_Server
Still stuck? Get free help from real people in our Discord
Post your game, where it runs and what the check said in #help-forum. Other server hosts and the Server Doctor team can take a look. Free.