Skip to content

Widgets

Garry's Mod widget guide

Port 27015 as UDP, add the server, and embed a live status card.

Garry's Mod servers answer a Steam query on the same port players connect on, so this is one of the simplest Steam games to get right.

What you need#

  • Your server's public IP or hostname and port (27015 unless you changed it).
  • Access to server.cfg or your launch command, for the port and a one time ownership code.
  • Manage Server in a Discord that has Dispresso, or a Dispresso login.

1. Get the server ready#

Check the -port in your launch command. If you did not set one the server uses 27015. The query and the game share it, so the number players use is the number to give Dispresso.

Ports and settings at a glance#

SettingWhere it livesWhat to use
Server port-port in the launch command27015 by default, UDP (and TCP if you use RCON)
Query portSame as the server portUse the same number
Server namehostname in server.cfgWhere the ownership code goes

Firewall and host: Allow UDP on the server port: sudo ufw allow 27015/udp. Behind a host panel, confirm the port is public. Running several servers on one machine needs a different port for each.

2. Add it to Dispresso#

Easiest is Discord. In a server where Dispresso is, with Manage Server:

  1. 1
    Run /gameserver setup.
  2. 2
    Pick Garry's Mod from the list.
  3. 3
    Type the IP and port, usually 203.0.113.10:27015.
  4. 4
    Copy the code Dispresso gives you (step 3 below) and press Check when it is in place.
What you type
203.0.113.10
Port: 27015

Prefer the site? Sign in, open /dashboard/servers/games, pick the Garry's Mod chip, search for your server and press Claim. If it is genuinely missing, use the collapsed option "Server not on the list? Add it" underneath.

3. Prove it is yours#

Put the code in hostname in server.cfg (or hostname "..." in the console), save, press Check within ten minutes, then remove it.

4. Put the widget on your website#

The widget needs your listing id. Open your server's page on /servers/games and look at the address bar:

Address of a listing page
https://dispresso.co/servers/games/GAME/12345

The number on the end (12345 here) is the id. That is the value for data-server. You can also pin a live card in Discord, which finds the server by name or address for you (last step below).

Garry's Mod widget
<!-- One server: replace YOUR_LISTING_ID with the number from your listing's address -->
<div data-dispresso-game-server data-server="YOUR_LISTING_ID"></div>

<!-- Or the busiest garrys-mod servers, top 5 -->
<div data-dispresso-game-server data-game="garrys-mod" data-limit="5"></div>

<script src="https://dispresso.co/widgets/game-server.js?v=3" async></script>

Paste it where the card should appear. It shows the name, the map when the server has one, players out of the maximum, an Online or Offline pill and when it was last checked. It follows the visitor's light or dark theme; add data-theme="dark" or "light" to force one. How to paste it into WordPress, Wix, Squarespace, Carrd and plain HTML is in Put a widget on any website.

5. Show it in Discord too#

Want the same live numbers in a channel? In the Discord where Dispresso is, with Manage Server, run:

In Discord
/gameserver pin server:Your Server channel:#server-status

Search by the Garry's Mod server's name, its IP, IP:port or the listing id. Dispresso posts one card with players, map, status, address and a Join button, and keeps it up to date on its own, even after the bot restarts. /gameserver create does the same thing, /gameserver list shows the cards this server has and /gameserver remove takes one down. The message version works too: !gameserver pin. The card is only for a server that is already listed, so finish the steps above first.

Troubleshooting#

What you seeUsually becauseFix
Unknown foreverWrong port, or UDP is blockedUse the port in your launch command and allow it as UDP, not only TCP.
Two servers show the same dataTwo listings point at one address and portGive every server on the machine its own port and its own listing.
The widget says the server is not listed right nowThe id is wrong, the listing is still Pending review, it was removed, or it is marked 18+Open the listing page and copy the number from its address. Approved and not 18+ is the rule for every public widget.
Players never change and it says Checked hours agoThe status query cannot get through, so the last numbers are kept instead of blankedFix the query port or the firewall below. The card catches up on the next refresh.

Still stuck? Open your listing on the site and look at the card there. The widget shows exactly what that page shows, so if the page says Offline or Unknown the problem is the listing, not the embed.

Questions people ask#

Is there a plugin?#

Optional, yes. Turn on live tracking on the listing for real time counts. The scheduled refresh works without it.

Does the gamemode show?#

The map shows on the card. The gamemode is not a separate field.

Can the widget show a top list of Garry's Mod servers?#

Yes: data-game="garrys-mod" with a data-limit, as in the snippet above.