Unsupported config option for services
Fixes the docker-compose error `Unsupported config option for services`. It explains the verified fix from a real resolved case, when it applies, and what to check first. Not for unrelated docker-compose failures or different error text.
Fix Unsupported config option for services (docker-compose)
TL;DR
Your compose file contains a key that your compose version does not understand, often a version mismatch or a typo. Run docker compose config to see the exact service and key named in the error, fix that key (or upgrade compose), and re-run. One bad key blocks every compose command.
The error, verbatim:
Unsupported config option for servicesSteps
Reproduce the validation error to see the exact key value ``` docker compose config
Success check: The output names the exact service and key, e.g. Unsupported config option for services.web: 'foo'.Find the offending key in your compose file and check it against the compose spec:
grep -n "web:" docker-compose.yml | headSuccess check: The key is spelled right and exists in the compose spec for your file version.
Fix the key (correct the typo, move it under the right parent, or upgrade compose) and re-validate:
docker compose configSuccess check: docker compose config prints the parsed file with no errors.
When to use
You hit this exact error while using docker-compose. The trigger list below matches your situation.
When NOT to use
If the error text differs, or the failure is in a different tool (e.g. a Docker daemon error when you only need the compose fix), find the skill for that exact error instead.
Tool compatibility
docker-compose v1 (python) and Compose v2. Any compose file version.
Variant phrasings
Unsupported config option for services
ERROR: Unsupported config option for services.web
Root cause
The compose file uses a key your compose binary does not recognize. Classic causes: a v2-only key with version: '3' declared (or the reverse), a typo, or an old docker-compose that predates the option. Compose validates the whole file before doing anything, so one bad key blocks every command.
Edge cases
- Compose v2 ignores the top-level version key; unknown keys under services are still rejected.
- A typo like protss: instead of ports: triggers the same message naming your typo.
- If you copied the file from a newer compose example, upgrade compose instead of downgrading the file.
Where this came from
Resolved from the public discussion at https://stackoverflow.com/questions/36724948 (so:36724948).