Set Up a SteamCMD Server: systemd, Automation, and Security
Set up a SteamCMD server on Windows or Linux step by step: systemd units, automatic updates, firewall hardening, and a managed hosting option.
Halloween at Nexthosting: 10% off game servers with the code – until November 1
Set up a SteamCMD server on Windows or Linux step by step: systemd units, automatic updates, firewall hardening, and a managed hosting option.
SteamCMD is Valve's official command-line tool for downloading and updating files for dedicated servers. The core command is +force_install_dir <directory> +login anonymous +app_update <APPID> [+validate] +quit. Whether you use Windows or Linux, the logic stays the same; only the installation and a few system requirements differ. The details follow below, step by step.
In short:
- If you self-host a dedicated game server, you need an unprivileged user and a clear directory structure to avoid errors.
- When installing SteamCMD on Linux, you must install the 32-bit libraries, otherwise the client won't start.
- The correct order when downloading the server files is
+force_install_dirbefore+login, to prevent installation errors.- For stable operation, servers should run as
systemdservices so that they restart automatically after failures.- When opening network ports, only the port range the game needs should be opened, and RCON access should only be allowed from the internal network.
A few things should be in place before SteamCMD even starts. If you cut corners here, you'll spend hours chasing error messages that were easily avoidable.
/home/steam/serverfiles for the game files and a separate directory for SteamCMD itself.lib32gcc-s1), since otherwise SteamCMD won't start at all on 64-bit systems.Pro tip: Before the first installation, write down the exact AppID of your server. Many guides confuse the client AppID with the dedicated server AppID, and that later leads to rather confusing error messages.
The installation itself takes only a few minutes on both systems. SteamCMD downloads its own components on first launch anyway, so a lean base package is enough.
On Windows:
C:\steamcmd.steamcmd.exe. On first launch, the tool downloads all of its own components.Steam> prompt appears. SteamCMD is then ready to use.On Linux:
steamcmd package in its repositories, and install it through the package manager if so.wget and extract it with tar -xvzf steamcmd_linux.tar.gz../steamcmd.sh from your own user account, never as root.As the standard tool for modern Steam-based servers, SteamCMD has practically completely replaced the older HLDSUpdateTool, because it is built on the SteamPipe infrastructure and delivers updates far more reliably.
The order of the commands determines whether the installation runs smoothly or ends in cryptic error messages. Valve explicitly recommends setting +force_install_dir before +login, because the older order is still tolerated but increasingly considered error-prone.
A typical command for a Counter-Strike 2 server looks like this:
./steamcmd.sh +force_install_dir /home/steam/cs2 +login anonymous +app_update 730 +quitFor most dedicated servers, the anonymous login is completely sufficient. A personal Steam account is not needed, which makes automation considerably easier. The most common stumbling block is the error message “No subscription”, which almost always traces back to a wrong AppID or an incorrect login mode. If you want to load Workshop content, for example for Garry’s Mod, also use the +host_workshop_collection parameter with the respective collection ID.
The +validate flag checks all files against checksums and is useful for the initial installation or for troubleshooting. However, it doesn't belong in the standard command for the daily update run, because it can overwrite local customizations and costs unnecessary time.
Pro tip: Always run the first installation with +validate, but after that only when you have a specific problem. For larger servers such as Rust or Arma 3, this noticeably saves time on every update.
After installation comes the actual configuration. It determines how stable and how secure the server will be later on.
At a minimum, the following entries belong in server.cfg:
hostname for the public server namercon_password with a strong, unique passwordsv_maxplayers to limit the number of playersThe launch parameters control the behavior at server startup itself, for example +map de_dust2, -port 27015, or +maxplayers 20. They are passed directly when calling the server executable, not through SteamCMD.
RCON deserves special attention. Restrict access to trusted IP addresses or an internal network, and never use the same password as for other services. Also important: if +validate runs again, it does not overwrite a locally customized server.cfg as long as the file is not part of the official file set. For some games, though, it's still worth backing up the configuration before every major update.
A server that has to be restarted manually after every crash is not a long-term solution. This is exactly where a systemd unit pays off.
User=steam, WorkingDirectory pointing to the server directory, and ExecStart pointing to the start executable.Restart=on-failure and After=network-online.target so that the service only starts once a network connection is available.LimitNOFILE if many simultaneous connections are expected.+validate in regular operation.This combination of Restart and Limit options significantly improves the reliability of game servers, especially for games with many small network packets.
Pro tip: Test every update on a staging instance first and roll it out during low-traffic hours before it's the production server's turn.
A dedicated server needs open ports, but not all of them indiscriminately. Each game typically uses a game port for the actual connection, a separate query port for server queries, and an RCON port for remote control, usually over UDP for game traffic and TCP for RCON.
The network location also measurably affects latency for your players, which is one reason why DDoS protection and server location matter at least as much as the raw hardware when choosing a hosting provider. A weak connection makes even the best-configured server unusable for European players.
Most problems can be solved with a few targeted checks instead of setting up the whole installation again.
+force_install_dir must come before +login.+validate run.Running your own SteamCMD server is worthwhile if you want control over every detail and have the time for maintenance, updates, and security hardening. If, on the other hand, you don't want to handle support effort, DDoS mitigation, and backups yourself, managed hosting is often the more sensible choice. The technology behind it stays the same; only the responsibility shifts.
— Erik
Everything described in this article can be done yourself, but it costs time: configuring ports, securing systemd services, testing updates, maintaining backups. Nexthosting takes most of these tasks off your hands, so you can focus on configuring your server instead of its infrastructure. Instead of maintaining your own systemd unit and adjusting firewall rules by hand, you get a ready-to-use environment in which SteamCMD updates and server management run much faster. That pays off especially if you run several instances in parallel or simply don't feel like dealing with nightly update windows. Take a look at the server plans for CS2 or check out Nexthosting's VPS solutions if you need more flexibility for your own SteamCMD installations.
Further reading: the Valve Developer Documentation on SteamCMD and a practical tutorial on game server setup.
You install SteamCMD, set a target directory with +force_install_dir, log in with +login anonymous, and download the server files with +app_update <APPID>. After that comes the configuration via server.cfg and the appropriate launch parameters.
After installation, you start the server through its server executable with the appropriate launch parameters, such as the map name and port number. For permanent operation, also set up a systemd unit that restarts the service automatically.
No, for most dedicated servers the anonymous login via +login anonymous is completely sufficient. A personal Steam account is not required.
Use +validate for the initial installation or when you want to fix a specific error. Leave it out for regular updates, since it can overwrite local configuration changes.
In most cases, the 32-bit libraries such as lib32gcc-s1 are missing. SteamCMD requires them even on 64-bit systems. Installing them afterwards through the package manager usually fixes the problem right away.