|
1 | 1 | # SteamCMD Docker Image |
2 | 2 |
|
3 | | -[](https://developer.valvesoftware.com/wiki/SteamCMD) |
| 3 | +<p align="center"> |
| 4 | + <a href="https://developer.valvesoftware.com/wiki/SteamCMD"><img src="https://user-images.githubusercontent.com/4478206/197542699-ae13797a-78bb-4f37-81c2-d4880fd7709f.jpg" alt="SteamCMD"></a> |
| 5 | +<br> |
| 6 | +<a href="https://hub.docker.com/r/gameservermanagers/steamcmd"><img src="https://img.shields.io/docker/pulls/gameservermanagers/steamcmd.svg?style=flat-square&logo=docker&logoColor=white" alt="Docker Pulls"></a> |
| 7 | +<a href="https://github.com/GameServerManagers/docker-steamcmd/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/GameServerManagers/docker-steamcmd/docker-publish.yml?style=flat-square"></a> |
| 8 | +<a href="https://www.codacy.com/gh/GameServerManagers/docker-steamcmd/dashboard"><img src="https://img.shields.io/codacy/grade/42d400dcdd714ae080d77fcb40d00f1c?style=flat-square&logo=codacy&logoColor=white" alt="Codacy grade"></a> |
| 9 | +<a href="https://developer.valvesoftware.com/wiki/SteamCMD"><img src="https://img.shields.io/badge/SteamCMD-000000?style=flat-square&logo=Steam&logoColor=white" alt="SteamCMD"></a> |
| 10 | +<a href="https://github.com/GameServerManagers/docker-steamcmd/blob/main/LICENSE"><img src="https://img.shields.io/github/license/gameservermanagers/docker-steamcmd?style=flat-square" alt="MIT License"></a></p> |
4 | 11 |
|
5 | | -[](https://hub.docker.com/r/gameservermanagers/steamcmd) |
6 | | -[](https://github.com/GameServerManagers/docker-steamcmd/actions) |
7 | | -[](https://www.codacy.com/gh/GameServerManagers/docker-steamcmd/dashboard) |
8 | | -[](https://developer.valvesoftware.com/wiki/SteamCMD) |
9 | | -[](https://github.com/GameServerManagers/docker-steamcmd/blob/main/LICENSE) |
| 12 | +## About |
10 | 13 |
|
11 | | -> Lightweight, daily-built SteamCMD base image for game server automation. |
| 14 | +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). |
12 | 15 |
|
13 | | -## Quick Start |
| 16 | +## Tags |
14 | 17 |
|
15 | | -Pull the latest image and open SteamCMD interactive prompt: |
| 18 | +- `latest`, `ubuntu` - Latest Ubuntu LTS release |
| 19 | +- `ubuntu-24.04` - Ubuntu 24.04 LTS 'Noble Numbat' |
| 20 | +- `ubuntu-22.04` - Ubuntu 22.04 LTS 'Jammy Jackalope' |
| 21 | +- `ubuntu-20.04` - Ubuntu 20.04 LTS 'Focal Fossa' |
| 22 | +- `ubuntu-18.04` - Ubuntu 18.04 LTS 'Bionic Beaver' |
16 | 23 |
|
17 | | -```bash |
18 | | -docker pull gameservermanagers/steamcmd:latest |
19 | | -docker run -it --rm gameservermanagers/steamcmd:latest |
20 | | -``` |
| 24 | +## Usage |
21 | 25 |
|
22 | | -Download (update) a dedicated server into the current host directory (example: CS2 / app 730): |
| 26 | +docker cli |
23 | 27 |
|
24 | 28 | ```bash |
25 | | -docker run -it --rm \ |
26 | | - -v "$PWD:/data" \ |
27 | | - gameservermanagers/steamcmd:latest \ |
28 | | - +force_install_dir /data +login anonymous +app_update 730 validate +quit |
| 29 | +docker run -it gameservermanagers/steamcmd:latest |
29 | 30 | ``` |
30 | 31 |
|
31 | | -Persist Steam content in a named volume: |
32 | | - |
33 | | -```bash |
34 | | -docker volume create steamcmd-data |
35 | | -docker run -it --rm -v steamcmd-data:/home/steam/Steam gameservermanagers/steamcmd:latest +login anonymous +quit |
36 | | -``` |
37 | | - |
38 | | -## Tags & Platforms |
39 | | - |
40 | | -| Tag(s) | Ubuntu Release | Notes | |
41 | | -| ------ | -------------- | ----- | |
42 | | -| `latest`, `ubuntu` | 24.04 LTS (Noble) | Alias to most recent LTS | |
43 | | -| `ubuntu-24.04` | 24.04 LTS | Current LTS | |
44 | | -| `ubuntu-22.04` | 22.04 LTS | Previous LTS | |
45 | | -| `ubuntu-20.04` | 20.04 LTS | Legacy (receives security updates) | |
46 | | -| `ubuntu-18.04` | 18.04 LTS | Legacy / nearing EOL upstream | |
47 | | - |
48 | | -Currently built for: `linux/amd64`. |
49 | | - |
50 | | -## Features |
51 | | - |
52 | | -- Daily scheduled build + build on Dockerfile changes |
53 | | -- Non-root `steam` user (security best practice) |
54 | | -- Minimal packages; apt caches cleaned |
55 | | -- HEALTHCHECK (lightweight SteamCMD invocation) |
56 | | -- Multi-version tag set for pinning |
57 | | - |
58 | | -## Usage Examples |
59 | | - |
60 | | -Anonymous login and quit (cache initialization): |
61 | | - |
62 | | -```bash |
63 | | -docker run --rm gameservermanagers/steamcmd:latest +login anonymous +quit |
64 | | -``` |
65 | | - |
66 | | -Install/Update Valheim dedicated server (app 896660) into a local folder: |
67 | | - |
68 | | -```bash |
69 | | -mkdir -p valheim && \ |
70 | | -docker run --rm -v "$PWD/valheim:/data" gameservermanagers/steamcmd:latest \ |
71 | | - +force_install_dir /data +login anonymous +app_update 896660 validate +quit |
72 | | -``` |
73 | | - |
74 | | -Run with a different timezone: |
75 | | - |
76 | | -```bash |
77 | | -docker run --rm -e TZ=UTC gameservermanagers/steamcmd:latest +login anonymous +quit |
78 | | -``` |
79 | | - |
80 | | -## Data Persistence |
81 | | - |
82 | | -Steam content is stored under `/home/steam/Steam` (owned by the non-root `steam` user). Mount a volume there to persist downloads across runs. |
| 32 | +Download Counter Strike: Global Offensive Dedicated Server to current host directory. |
83 | 33 |
|
84 | 34 | ```bash |
85 | | -docker run -v steamcmd-data:/home/steam/Steam gameservermanagers/steamcmd:latest +login anonymous +quit |
| 35 | +docker run -it -v $PWD:/data gameservermanagers/steamcmd:latest +force_install_dir /data +login anonymous +app_update 740 +quit |
86 | 36 | ``` |
87 | 37 |
|
88 | | -## Configuration |
89 | | - |
90 | | -Common tunables (all optional): |
91 | | - |
92 | | -| Option | How | Purpose | |
93 | | -| ------ | --- | ------- | |
94 | | -| Timezone | `-e TZ=Europe/London` | Control tzdata (if installed) | |
95 | | -| Working dir | `-w /home/steam` | Override working directory | |
96 | | -| User mapping | `--user $(id -u):$(id -g)` | Run with host UID/GID (if perms needed) | |
97 | | - |
98 | | -Steam credentials (if you need a non-anonymous app): |
99 | | - |
100 | | -```bash |
101 | | -docker run -it --rm gameservermanagers/steamcmd:latest +login <username> <password> +app_update <appid> +quit |
102 | | -``` |
103 | | - |
104 | | -Consider using Steam Guard / login tokens; avoid embedding secrets in shell history. Use `--env-file` for larger sets of env variables if needed. |
105 | | - |
106 | | -## Healthcheck |
107 | | - |
108 | | -The image defines a `HEALTHCHECK` that periodically performs a minimal anonymous login and metadata refresh. To disable at runtime, you can override with `--no-healthcheck` (Docker 25+) or build your own image `FROM` this one and use `HEALTHCHECK NONE`. |
109 | | - |
110 | | -## Security Notes |
111 | | - |
112 | | -- Runs as non-root `steam` |
113 | | -- Network access only to Steam endpoints during operations |
114 | | -- Keep host Docker updated; image alone does not mitigate kernel CVEs |
115 | | - |
116 | | -## Contributing |
117 | | - |
118 | | -Issues & PRs welcome. Before submitting: |
119 | | - |
120 | | -1. Run formatters: `prettier --write .` |
121 | | -2. Run linters: super-linter workflow (or locally with the provided dev container) |
122 | | -3. Keep layers minimal; squash RUN chains where reasonable |
123 | | - |
124 | | -## Related Projects |
125 | | - |
126 | | -- [LinuxGSM](https://linuxgsm.com) – Game server management |
127 | | -- [steamcmd/docker](https://github.com/steamcmd/docker) – Upstream reference |
128 | | - |
129 | | -## License |
130 | | - |
131 | | -MIT – see [LICENSE](./LICENSE.md). |
132 | | - |
133 | | ---- |
134 | | - |
135 | | -> Looking for additional architectures or features? Open an issue to discuss multi-arch builds or tag deprecation timelines. |
136 | | -
|
137 | | -## Troubleshooting |
138 | | - |
139 | | -Empty output directory: |
140 | | - |
141 | | -- Ensure the order: `+force_install_dir` comes BEFORE `+login` (SteamCMD requirement – it warns otherwise). If reversed, files may go to the default Steam library inside the container instead of your mounted directory. |
142 | | -- Verify permissions: the container runs as user `steam` (UID 1000). If your host user ID differs and you see permission errors, try adding `--user $(id -u):$(id -g)` or pre-chown the host directory. |
143 | | -- Add `validate` only when necessary; it forces extra file checks and can slow installs. |
144 | | - |
| 38 | +## Notes |
145 | 39 |
|
146 | | -Confirm installation path by adding `+app_status <appid>` before `+quit` to inspect state. |
| 40 | +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. |
0 commit comments