* feat(docker): add configurable user and group IDs for non-root user
* Introduced `ARG PUID` and `ARG PGID` to allow customization of user and group IDs.
* Updated user creation command to use these arguments for better flexibility.
* feat(dockerfiles): add bootstrap step for SteamCMD
* Added a `RUN steamcmd +login anonymous +quit || true` command to bootstrap SteamCMD in the Dockerfiles for Ubuntu 20.04, 22.04, and 24.04.
* This ensures that SteamCMD is properly initialized during the image build process.
* feat(readme): update tags section with support details
* Enhanced the `Tags` section to include detailed support information for each Ubuntu release.
* Added notes on standard support end dates and legacy support for older versions.
* Improved clarity on the usage of the Docker image and data persistence instructions.
* feat(docker): enhance Dockerfiles and add entrypoint script
* Added `gosu` to Dockerfiles for better user switching.
* Updated user creation and command execution to run as the `steam` user.
* Introduced `docker-entrypoint.sh` to handle UID/GID adjustments at runtime.
* Modified README to clarify app installation instructions and data persistence.
* fix(readme): correct volume mount syntax in usage examples
* Updated volume mount paths in the README to use consistent quoting.
* Ensures clarity and correctness for users running Docker commands.
* docs: update README to move Notes section
* Moved the Notes section to the end of the document for better organization.
* Clarified the container's basis on the `steamcmd` container and its primary use for `LinuxGSM` game servers.
* fix(readme): correct GitHub Actions workflow link
* Updated the GitHub Actions workflow link in the README to reflect the correct path.
SteamCMD is a command-line version of the Steam client. It allows you to download and install games on a headless server. This container image builds daily and is available on [Docker Hub](https://hub.docker.com/r/gameservermanagers/steamcmd) as well as [GitHub Container Registry](https://github.com/GameServerManagers/docker-steamcmd/pkgs/container/steamcmd).
SteamCMD is a command-line version of the Steam client. It allows you to download and install games/server apps on a headless server. This container image builds daily and is available on [Docker Hub](https://hub.docker.com/r/gameservermanagers/steamcmd) as well as [GitHub Container Registry](https://github.com/GameServerManagers/docker-steamcmd/pkgs/container/steamcmd).
\*Dates are end of standard (free) security updates per Canonical's published LTS schedule. Extended Security Maintenance (ESM) may continue beyond these dates, but images may be deprecated earlier if upstream packages (e.g. SteamCMD dependencies) become unavailable.
## Usage
Docker cli
Pull the latest image and open SteamCMD interactive prompt:
```bash
docker run -it --rm gameservermanagers/steamcmd:latest
```
Download and update an app into the current host directory (example: Garry's Mod Dedicated Server - appid 4020):
SteamCMD stores its own library data (manifests, depots, workshop cache) in `/home/steam/.local/share/Steam`. We use `+force_install_dir` to place the app files in its own directory. If you omit `+force_install_dir` (or put it after the first `+app_update`) the app installs under:
Download Counter Strike: Global Offensive Dedicated Server to current host directory.
## User, UID & GID (PUID / PGID)
The image uses a non-root user `steam` (default UID:GID 1000:1000). You can override these IDs at runtime with environment variables `PUID` and `PGID`; the entrypoint will map the user/group before executing SteamCMD so created files match your host user.
- Always mount persistent Steam data for authenticated workflows (see Data Persistence section) to avoid repeated Steam Guard prompts.
- Pass credentials via environment variables or a one‑shot secret, not hard‑coded in compose files committed to source control.
- After any Steam Guard (2FA / email) prompt, you can supply the code inline: `+login user pass CODE` (third argument) or run once interactively to cache the sentry file in the mounted Steam directory.
- Use a dedicated throwaway account with only the required entitlements; never your main account.
- Treat the mounted Steam data directory as sensitive (contains auth tokens / sentry files). Do not publish it.
### Handling Steam Guard / 2FA
1. Run interactively once with a persistent Steam data mount.
2. Enter the code when prompted (do NOT add it to scripts).
3. Subsequent scripted runs succeed without further prompts because the sentry file is stored.
## SteamCMD Commands
Common commands / flags you can chain after the image name (order matters; see notes below):
- Always place `+force_install_dir` before the first `+app_update` or files go to the default library (`/home/steam/Steam/steamapps`).
- Append `validate` sparingly; use it for initial install or when corruption is suspected.
- Use a script file (`+runscript`) for complex multi-app workflows; each line should mirror the inline form (without shell quoting issues).
- For workshop items, ensure the base app (server) is installed first; workshop content lands under the app's workshop directory.
- `+download_depot` may require authenticated login and correct branch access; manifests are version-specific.
## FAQ
**Q: How do I find an appid?**
Search [SteamDB](https://steamdb.info) and use the numeric App ID shown.
**Q: Why do I get "Failed to connect" or SSL errors?**
Usually transient network or firewall DPI interference. Retry, or ensure outbound TCP 27015/27036 & HTTPS ports are open.
**Q: Can I run multiple updates in one container invocation?**
Yes, either chain multiple `+app_update` commands or use a runscript file with one per line.
**Q: Do I need to expose any ports?**
No for downloading content. Game server ports are handled by the separate server container you build/run using the downloaded files.
## Notes
This container is based off of the [steamcmd](https://github.com/steamcmd/docker) container and is primarily used for [LinuxGSM](https://linuxgsm.com) game servers.