CS2, the legacy CS:GO server, Team Fortress 2, and Garry's Mod are all run the
same way: a free dedicated server downloaded anonymously through SteamCMD, a
server.cfg in the game's cfg directory, ports around 27015, and a Steam game
server login token without which nobody can find the server. Learn the pattern
once and it carries across all four.
The games and their Steam apps
Each dedicated server is a separate Steam application from the game itself, and all of them install without an account.
| Game | Server app | Notes |
|---|---|---|
| Counter-Strike 2 | 730 | 64-bit only. No srcds_run, the binary is started directly. |
| Counter-Strike: Global Offensive | 740 | Legacy. Valve replaced CS:GO with CS2, so this build is no longer maintained or patched. |
| Team Fortress 2 | 232250 | Classic srcds_run server. |
| Garry's Mod | 4020 | Classic srcds_run server. |
| Counter-Strike: Source | 232330 | Usually installed alongside Garry's Mod, as content to mount rather than to run. |
Two of those need a note. CS:GO still runs if you have an install, but treat it as a legacy system: it does not receive fixes, so anything reachable from the internet is unpatched software you are choosing to expose. Garry's Mod servers install the Counter-Strike: Source dedicated server too, not to run it, but so its textures and models can be mounted. Without that, a lot of community maps render as missing-texture checkerboard.
Installing a Source engine server on Linux is the build for all of them.
The game server login token
A game server login token, usually called a GSLT, is a string you generate from your own Steam account that identifies the server to Valve. You create one per server, for a specific game, from the Steam game server account management page in your Steam account.
This is the part people miss, so it is worth being blunt about what it does. Without a token, the server does not register with Valve's master server list. It is not in the in-game server browser, it is not in the community server list, and it is not in any third-party list that reads from Valve. Players who already have the address and use the console can still connect directly, so from the outside it looks like a working server that nobody can find. If your problem is "the server runs and my friends can join, but it is not in the list", the token is the first thing to check, before any port or firewall.
Some things about tokens that cause trouble later:
- A token is tied to one game. A token generated for TF2 does not work for CS2.
- Tokens are yours, and they carry your account's standing. A ban on the account, or abuse from a server using the token, gets the token blocked, and a blocked token stops that server appearing at all.
- Keep it out of anything you share. Pass it on the command line, not in the
server.cfgyou paste into a forum thread when asking for help. It is a credential. - Run one token per server instance. Sharing one across several servers causes them to fight over the registration.
- Watch the console on first boot. The server states plainly whether it logged in with the token or fell back to running without one, and that line is the fastest confirmation you will get.
Ports
All four games use the same shape, and the defaults are the same because they are the same engine lineage.
| Purpose | Protocol | Default |
|---|---|---|
| Game traffic and Steam queries | UDP | 27015 |
| RCON | TCP | 27015 |
| SourceTV | UDP | 27020 |
Three things follow from that table:
- The game port and the query port are the same port. Source answers Steam's A2S queries on the port players connect to, so a single UDP rule covers both. That is why Source servers rarely show the "connects but is invisible" problem that Rust and ARK do.
- RCON is TCP on the same number. It is a separate rule, because a rule is one protocol. RCON is a full administrative channel, so give it a long password and restrict the sources that can reach it.
- Extra servers take the next numbers. Running two servers on one machine means the second listens on 27016, the third on 27017, and each needs its own rules.
SourceTV is only listening if you enable it. Leave that port closed until you do.
To open these on a Clouduxe server, see Port rules. The Source / CS2 entry under Game presets opens the game port for you; RCON and SourceTV need rules of their own.
server.cfg basics
Every one of these games reads a server.cfg from its own cfg directory:
| Game | Path, relative to the install directory |
|---|---|
| CS2 | game/csgo/cfg/server.cfg |
| CS:GO | csgo/cfg/server.cfg |
| Team Fortress 2 | tf/cfg/server.cfg |
| Garry's Mod | garrysmod/cfg/server.cfg |
The file is a list of console commands, one per line, with // for comments.
It is executed when a map loads, which is the detail that catches people out: a
change you save while the server is running does nothing until the next map
change, or until you run exec server.cfg from RCON or the console.
A minimal file that applies to all of them:
hostname "My server"
rcon_password "a-long-random-password"
sv_password ""
sv_lan 0hostnameis the name in the browser.rcon_passwordenables the remote console. Leave it empty and RCON is off, which is the right setting if you are not using it. Never leave it short.sv_passwordis a join password. Empty means the server is public.sv_lan 0keeps the server on the public internet rather than in LAN mode.
Everything else is game-specific: mp_ variables for round rules in CS2 and
CS:GO, tf_ for TF2, and a gamemode plus workshop settings for Garry's Mod.