Privacy notice This website only uses technically necessary cookies. Statistics, marketing and external services are not loaded without JavaScript. Learn more in our Privacy Policy.
Privacy notice This website uses only technically necessary cookies. Statistics, marketing and external services are not loaded without JavaScript. Read more in our Privacy Policy.
Informacja o prywatności Ta strona używa wyłącznie technicznie niezbędnych plików cookie. Statystyka, marketing i usługi zewnętrzne nie są ładowane bez JavaScript. Więcej w naszej Polityce prywatności.
Information sur la confidentialité Ce site n’utilise que des cookies techniquement nécessaires. Les services de statistiques, de marketing et les services externes ne sont pas chargés sans JavaScript. Plus d’informations dans notre Politique de confidentialité.
Avviso sulla privacy Questo sito usa solo cookie tecnicamente necessari. I servizi statistici, di marketing ed esterni non vengono caricati senza JavaScript. Maggiori informazioni nella nostra Informativa sulla privacy.
Aviso de privacidad Este sitio web solo usa cookies técnicamente necesarias. Los servicios de estadística, marketing y externos no se cargan sin JavaScript. Más información en nuestra Política de privacidad.
Privacymelding Deze website gebruikt alleen technisch noodzakelijke cookies. Statistiek-, marketing- en externe diensten worden zonder JavaScript niet geladen. Meer hierover in onze Privacyverklaring.
Privatlivsinformation Denne hjemmeside bruger kun teknisk nødvendige cookies. Statistik-, marketing- og eksterne tjenester indlæses ikke uden JavaScript. Læs mere i vores Privatlivspolitik.

Halloween at Nexthosting: 10% off game servers with the code – until November 1

Back to the blog
Nexthosting Guide

Community Admins: Set Up a GMod Server with AppID 4020 and systemd

Practical guide for community admins: configure SteamCMD, AppID 4020, GSLT, systemd autostart, and UDP port 27015.

Sep 5, 2026 131 views
Community Admins: Set Up a GMod Server with AppID 4020 and systemd

Install SteamCMD, download AppID 4020 with it, start SRCDS with a valid GSLT token, and open UDP port 27015 in your firewall. For a quick test round, that is easily enough on a VPS; for a permanent community server, you should also set up autostart with systemd. With some Linux experience, a Garry’s Mod server is up and running comparatively quickly. If you want to save yourself the administration work, choose managed hosting instead.


In short:

  • For a permanent server, you should set up systemd automation to make sure it restarts after crashes.
  • To be visible, the server needs a correctly installed GSLT, which is not entered in server.cfg but used in the start command.
  • Each server instance needs its own GSLT, because using one token multiple times causes conflicts in the server browser.
  • For public servers, DDoS protection is essential, and the server location should be chosen close to the player community.
  • Opening UDP 27015, 27020, and 27005 is essential to be visible in the browser and to avoid connection problems.

Table of contents

System requirements and hosting options for your GMod server

Before you can set up your Garry’s Mod server, you need to make a decision: your own VPS or a managed game server. A VPS gives you full control over the operating system, but requires basic Linux knowledge for firewall, updates, and backups. Managed hosting handles provisioning, DDoS protection, and backups automatically and above all saves time compared to a plain rental without management.

For hardware, rough guideline values apply, depending on player count and installed addons:

The hardware options depend on the number of players, from smaller servers with a few cores and a few gigabytes of RAM to larger setups with multiple cores, plenty of RAM, and enough SSD storage.

Choose the server location close to your player base, which noticeably lowers ping. DDoS protection is not a luxury on public servers but a basic requirement, since GMod servers are regularly targeted by attacks.

Pro tip: Plan for significantly more RAM on roleplay or DarkRP servers than on a plain sandbox instance. Many Lua scripts and database queries quickly drive up memory usage.

Install SteamCMD and download AppID 4020

SteamCMD is Valve’s official command-line tool that you use to download and keep the Garry’s Mod Dedicated Server (AppID 4020) up to date. On Linux, it is best to set up a separate non-root user, for example named “steam”, before you unpack SteamCMD.

  1. Create a working directory, for example /home/steam/gmodserver, and change into it.
  2. Download and unpack SteamCMD, on Debian or Ubuntu often via the steamcmd package or the official archive from the Valve Developer Wiki.
  3. Start the installation with steamcmd +login anonymous +force_install_dir /home/steam/gmodserver +app_update 4020 validate +quit.
  4. Wait until validation has finished. With several gigabytes of download volume, this can take a few minutes depending on your connection.

For later updates, a small script such as update_gmod.sh is worthwhile, which calls the same command automatically. Make it executable with chmod +x update_gmod.sh. The Facepunch Wiki for Linux setups recommends exactly this non-root approach, because running as root creates unnecessary risks in case of security vulnerabilities.

Pro tip: Do not confuse force_install_dir with the current working directory. The path must be set before +app_update, otherwise SteamCMD installs into a folder you will not be able to find later.

Create a GSLT and start the server correctly

Without a Game Server Login Token, your server is downgraded in the browser or does not show up at all. You create the GSLT for free on Valve’s Steamworks page, linked to your Steam account and AppID 4020.

Put the token directly into the start line, not into server.cfg, because configuration files more often end up in public backups or repositories by accident. A typical start line on Linux looks like this:

  • ./srcds_run -game garrysmod +gamemode sandbox +map gm_construct +maxplayers 24 +sv_setsteamaccount DEIN_GSLT_TOKEN +host_workshop_collection 123456789
  • On Windows, the file is called srcds.exe accordingly, with the same parameters.
  • Use a separate token for each server instance; sharing one token across several servers causes conflicts in the server browser.

The setup guide for dedicated Garry’s Mod servers names exactly this problem as one of the most common causes when a server is running but not visible.

Set up Workshop collections and addon management

You find the collection ID in the URL of your Steam Workshop collection. It goes directly into the +host_workshop_collection <ID> parameter of your start line, so the server automatically loads all included addons and distributes them to connected clients.

  • Create the collection in the Steam Workshop and keep it as lean as possible.
  • Use resource.AddWorkshop in your Lua scripts if individual addons should be forced independently of the collection.
  • For large map packs or sound files, use FastDL or sv_downloadurl so clients do not download via the slow default transfer.

An overloaded collection is one of the most common performance killers: too many addons cause long load times and Lua errors, especially when new players connect for the first time.

Pro tip: Test new addons on a separate test instance first, before adding them to the production collection. A single faulty script can crash the entire server.

Set up autostart with systemd after every restart

For your Garry’s Mod server to start up again automatically after a reboot or crash, you need a systemd service file instead of a manual start via SSH.

  1. Create the file /etc/systemd/system/gmod.service with the fields User=steam, WorkingDirectory=/home/steam/gmodserver, ExecStart=/home/steam/gmodserver/srcds_run …, and Restart=on-failure.
  2. Set LimitNOFILE=100000 to avoid problems with too few open file descriptors in continuous operation, as described in the detailed ITPiran tutorial.
  3. Enable the service with systemctl enable gmod.service and start it with systemctl start gmod.service.
  4. Check the logs at any time with journalctl -u gmod.service -f.

An alternative is a cron job with @reboot, which is simpler but offers no automatic restart logic for crashes during operation.

Which ports do I need to open for GMod?

The default game and query port is UDP 27015. In addition, SourceTV often uses UDP 27020, and clients connect locally via UDP 27005. If a firewall rule is missing, the server does not show up in the browser, even if the process is running correctly.

On Ubuntu or Debian, you open the ports with ufw allow 27015/udp, then check the status with ufw status. With a Fritzbox or a router behind CGNAT (carrier-grade NAT), port forwarding is often not enough; you can tell because external port checks fail despite correct firewall rules. In that case, the only option is a host with a real public IP or a VPN tunnel.

Pro tip: Always test reachability from outside your own network, for example over a mobile network. A test from the same LAN often wrongly reports the port as open.

Why clock speed matters more than core count for GMod

Garry’s Mod mainly uses one core intensively for physics calculations and Lua execution. A processor with a high clock speed per core therefore delivers noticeably better results than many but slower cores, as practical setup guides also confirm.

  • Prefer CPUs with a high single-core clock speed over a high core count alone.
  • Use NVMe or SSD storage; HDDs noticeably lengthen map load times and slow down I/O-intensive addons such as database frameworks.
  • Keep the tick rate and maxplayers realistic for the available hardware; more players mean disproportionately more load.
  • Test under real load with several testers instead of just alone; single-player performance says little about behavior with 20 simultaneous players.

If you push the limits of single-core performance, you will find similar considerations with Rust servers with high clock speed demands; the principle applies to many Source engine spin-offs.

Automate updates and backups reliably

Back up the folders garrysmod/maps, garrysmod/addons, and the configuration files in garrysmod/cfg regularly. A simple rsync cron job to a second storage location or object storage is completely sufficient for most communities.

  1. Stop the server in a controlled way, for example with systemctl stop gmod.service.
  2. Run the update command steamcmd +login anonymous +force_install_dir <pfad> +app_update 4020 validate +quit.
  3. Restart the service and check the logs for errors.
  4. Test your backup regularly with an actual restore, not just by confirming that the backup file exists.

If problems occur after an update, a rollback to the last working backup of the configuration files often helps, while the game content itself is re-synchronized via validate.

Server not visible in the browser: What to do

The most common cause of an invisible server is a missing or incorrect GSLT in the start line. Also check whether sv_lan is set to 1 by mistake, which hides your server from the public list.

  • Check open ports with ss -uln or the older netstat -uln and compare them with ufw status.
  • Check the logs with journalctl -u gmod.service -n 100 for error messages at startup.
  • For Workshop problems: check the collection ID again and verify file integrity with +app_update 4020 validate.
  • Dropped connections often point to addon conflicts; disable new extensions one at a time to troubleshoot.

According to the RedSwitches setup guide, a missing GSLT is by far the most common reason for a server that is technically running but invisible.

Practical tips from running servers

Most problems with a Garry’s Mod server are not caused by faulty hardware but by poor operational organization. Separate test and production servers consistently, plan fixed maintenance windows for updates, and deliberately limit the number of active addons instead of putting every interesting extension live right away.

Managed hosting is especially worthwhile if you lack basic Linux knowledge or do not want to manage DDoS protection and provisioning yourself. A good support channel often saves more time than any additional automation.

— Erik

Garry’s Mod hosting: manage it yourself or hand it off?

Once you have worked through the previous steps, you know: SteamCMD, GSLT, systemd, and firewall rules are doable, but they cost time that you could also put into the actual server experience. This is exactly where Garry’s Mod hosting at Nexthosting comes in. Provisioning and DDoS protection run automatically, and you start backups at the click of a button or on a schedule in the panel, without you having to write a firewall rule or debug a systemd service yourself.

This is particularly useful for communities that want to run a reliable server in Germany without deep Linux knowledge, but still keep access to Workshop collections, RCON, and custom start parameters. If you would rather have full root control over the operating system, a VPS is the right foundation for your own implementation. Take a look at the product page and compare which option better fits the effort you want to invest.

Where can I find more technical details?

For deeper technical questions, it is worth going straight to the primary sources. The Facepunch Wiki page on server installation remains the most reliable reference for SteamCMD commands and AppID details. If you are looking for an automated alternative to manual management, LinuxGSM is an established tool that combines update and autostart logic in a single script. For general SteamCMD questions beyond GMod, the Valve Developer Wiki can help.

Sources

FAQ

How do I set up a Garry’s Mod server?

Install SteamCMD, download AppID 4020 with it, create a GSLT, and start the server via srcds_run with the right parameters for map, game mode, and player count.

How can I host my own game server?

You can choose between your own VPS with full control and a managed offering like Nexthosting, depending on how much of the administration you want to handle yourself.

How do I create a dedicated server for Garry’s Mod?

Use SteamCMD with the command +app_update 4020 validate to download the server files, then start srcds_run with a valid GSLT and the start parameters you want.

What do I need for a TTT server?

Besides the base files of AppID 4020, you need the TTT game mode, matching maps from the Workshop, and enough RAM for the additional role-logic scripts. On roleplay servers, RAM requirements can be significantly higher than on a plain sandbox instance.

Which ports do I need to open for a GMod server?

At least UDP 27015 for the main game, plus UDP 27020 for SourceTV and UDP 27005 for local client connections.