如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://hub.docker.com/r/gameservermanagers/steamcmd
https://github.com/GameServerManagers/docker-steamcmd/actions
https://app.codacy.com/gh/GameServerManagers/docker-steamcmd
https://github.com/GameServerManagers/docker-steamcmd/blob/main/LICENSE
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 https://hub.docker.com/r/gameservermanagers/steamcmd as well as https://github.com/GameServerManagers/docker-steamcmd/pkgs/container/steamcmd.
| Tag(s) | Ubuntu Release | Standard Support Ends* | Notes |
|---|---|---|---|
latest, ubuntu | 24.04 LTS (Noble Numbat) | April 2029 | Current LTS |
ubuntu-26.04 | 26.04 LTS (Resolute Raccoon) | April 2031 | Upcoming LTS |
ubuntu-24.04 | 24.04 LTS (Noble Numbat) | April 2029 | Current LTS |
ubuntu-22.04 | 22.04 LTS (Jammy Jellyfish) | April 2027 | Previous LTS |
ubuntu-20.04 | 20.04 LTS (Focal Fossa) | April 2025 | Legacy (ESM only; may be removed) |
*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.
Pull the latest image and open SteamCMD interactive prompt:
bashdocker run -it --rm gameservermanagers/steamcmd:latest
Download and update an app into the current host directory (example: Garry's Mod Dedicated Server - appid 4020):
bashdocker run -it --rm \ -e PUID=$(id -u) -e PGID=$(id -g) \ -v "$PWD:/data" \ gameservermanagers/steamcmd:latest \ +force_install_dir /data +login anonymous +app_update 4020 +quit
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:
text/home/steam/.local/share/Steam/steamapps/common/<AppName>
Using a distinct mount (e.g. /data) along with +force_install_dir /data keeps app files separate from the Steam library cache.
bashdocker run -it --rm \ -e PUID=$(id -u) -e PGID=$(id -g) \ -v "$PWD:/data" \ -v "/path/on/host/steamcmd-app:/home/steam/.local/share/Steam" \ gameservermanagers/steamcmd:latest \ +force_install_dir /data +login anonymous +app_update 4020 +quit
bashdocker volume create steamcmd-data docker volume create steamcmd-app docker run -it --rm \ -v "steamcmd-data:/data" \ -v "steamcmd-app:/home/steam/.local/share/Steam" \ gameservermanagers/steamcmd:latest \ +force_install_dir /data +login anonymous +app_update 4020 +quit
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.
bashdocker run --rm \ -e PUID=1001 -e PGID=1001 \ -v "$PWD/steam-app:/home/steam/.local/share/Steam" \ -v "$PWD/server-data:/data" \ gameservermanagers/steamcmd:latest \ +force_install_dir /data +login anonymous +app_update 4020 +quit
You can still bake alternate defaults (not required for most users):
bashdocker build --build-arg PUID=1001 --build-arg PGID=1001 -t steamcmd:uid1001 -f Dockerfile.ubuntu-2404 .
| Symptom | Cause | Fix |
|---|---|---|
| Files not showing in directory | Host dir owned by different UID | Run with matching PUID/PGID or chown host dir |
| Steam Guard code every run | Sentry file not persisted (no volume or unwritable) | Mount and ensure ownership of Steam data dir |
| Root-owned files in host mount | Ran container with --user root | Remove --user; use PUID/PGID env vars |
SteamCMD supports anonymous and authenticated logins. Use anonymous wherever possible.
bashdocker run --rm \ -e PUID=$(id -u) -e PGID=$(id -g) \ -v "$PWD/steam-app:/home/steam/.local/share/Steam" \ -v "$PWD/server-data:/data" \ gameservermanagers/steamcmd:latest \ +force_install_dir /data +login anonymous +app_update 4020 +quit
Some apps (e.g. certain private branches, tools, or beta depots) require a Steam account.
Stateless (no persistent Steam data)
This will almost always trigger Steam Guard on first use and again later because nothing is persisted:
bashdocker run --rm \ -e PUID=$(id -u) -e PGID=$(id -g) \ -v "$PWD/server-data:/data" \ gameservermanagers/steamcmd:latest \ +@ShutdownOnFailedCommand 1 +force_install_dir /data \ +login "${STEAM_USER}" "${STEAM_PASS}" +app_update 223350 +quit
Persistent (recommended)
Persist /home/steam/.local/share/Steam so the sentry (guard) file is cached and subsequent runs skip the code prompt.
bashdocker run --rm \ -e PUID=$(id -u) -e PGID=$(id -g) \ -v "$PWD/steam-app:/home/steam/.local/share/Steam" \ -v "$PWD/server-data:/data" \ gameservermanagers/steamcmd:latest \ +@ShutdownOnFailedCommand 1 \ +force_install_dir /data \ +login "${STEAM_USER}" "${STEAM_PASS}" +app_update 223350 +quit
Recommendations:
+login user pass CODE (third argument) or run once interactively to cache the sentry file in the mounted Steam directory.Common commands / flags you can chain after the image name (order matters; see notes below):
| Command / Flag | Purpose | Example Snippet |
|---|---|---|
+login anonymous | Anonymous login (most dedicated servers allow) | +login anonymous |
+login <user> <pass> | Authenticated login (needed for some apps / private betas) | +login myuser mypass |
+@NoPromptForPassword 1 | Suppress interactive password/guard prompts (fail fast) | +@NoPromptForPassword 1 +login myuser mypass |
+@ShutdownOnFailedCommand 1 | Abort remaining commands if one fails | +@ShutdownOnFailedCommand 1 |
+force_install_dir <path> | Set target directory for app files (must come before +app_update) | +force_install_dir /data |
+app_update <appid> | Install or update an app (server / game) | +app_update 896660 |
+app_update <appid> validate | Integrity check & re-download missing/corrupt files (slower) | +app_update 740 validate |
+app_status <appid> | Print install status / progress (debug) | +app_status 896660 |
+app_info_update 1 | Refresh app info cache (used before querying details) | +app_info_update 1 |
+workshop_download_item <appid> <itemid> | Download a specific workshop item | +workshop_download_item 4020 3418671232 |
+download_depot <appid> <depotid> <manifest> | Fetch a specific depot/manifest (version pinning) | +download_depot 90 90 402078904020789 |
+sSteamCmdForcePlatformType <os> | Force platform (Linux / Windows / macOS) for content | +sSteamCmdForcePlatformType windows |
+runscript <file> | Execute batch of commands from script file | +runscript /scripts/install.txt |
+quit | Exit steamcmd when previous commands complete | +quit |
+@ShutdownOnFailedCommand 1 +@NoPromptForPassword 1 +force_install_dir /data +login ... +app_update <appid> validate +quit+force_install_dir before the first +app_update or files go to the default library (/home/steam/Steam/steamapps).validate sparingly; use it for initial install or when corruption is suspected.+runscript) for complex multi-app workflows; each line should mirror the inline form (without shell quoting issues).+download_depot may require authenticated login and correct branch access; manifests are version-specific.Q: How do I find an appid? Search SteamDB 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.
This container is based off of the https://github.com/steamcmd/docker container and is primarily used for LinuxGSM game servers.
以下是 gameservermanagers/steamcmd 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务