Docker Compose Validator
Validate Docker Compose YAML for syntax errors, unknown keys, port and volume syntax, missing or circular depends_on, and undeclared networks.
Docker Compose Validator
Uses a build context
Uses image: postgres:16-alpine
Uses image: redis:7-alpine
Validation checks performed
Validates top-level keys, version format, services presence, and ensures each service is a valid mapping.
Checks image/build presence, valid service keys, port mappings, volume mounts, environment variables, and restart policies.
Verifies depends_on targets exist, network references match defined networks, and named volumes are declared.
Detects typos (port vs ports, volume vs volumes), circular dependencies, and unusual configuration values.
Updated . Provided as is. Check the output before you rely on it in production.
How to use Docker Compose Validator
- 1
Paste your docker-compose.yml
Copy your entire docker-compose file and paste it into the validator. It checks YAML syntax and Docker Compose structure immediately.
- 2
Review validation results
See a list of errors, warnings, and info messages with line numbers. Common issues: undefined services, missing dependencies, invalid syntax.
- 3
Fix common errors
Errors like 'depends_on references unknown service' point at a service name that is not defined. 'Unusual version format' means the version string is not one Compose recognises.
- 4
Check service dependencies and networks
The validator flags depends_on entries pointing at services that do not exist, self-references and dependency cycles, and any network a service joins that is missing from the top-level networks block.
- 5
Verify volume mounts
It checks volume mount syntax and that every named volume is declared under the top-level volumes key. It runs in the browser and cannot see your filesystem, so it never checks whether a host path exists.
Questions and answers
What is Docker Compose Validator?
What kinds of errors does it detect?
Use it as an API
Docker Compose Validator is also callable as a free HTTP JSON API at
https://aidevhub.io/api/docker-compose-validator/ — GET with query
parameters or POST with a JSON body, no authentication, CORS enabled, fair use
(abusive traffic is throttled at the edge; there is no per-request quota header). Responses return
{ ok, tool, result, meta }.
curl -s -X POST https://aidevhub.io/api/docker-compose-validator/ \
-H "Content-Type: application/json" \
-d '{"content":"services:\n web:\n image: nginx:1.27\n ports:\n - 8080:80"}' Machine-readable contract: /api/tool/docker-compose-validator.json All API endpoints: /agents/ LLM site index: /llms.txt
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Dedicated API endpoint
Deterministic outputs, machine-safe contracts, and production-ready examples.
Dedicated API
https://aidevhub.io/api/docker-compose-validator/ OpenAPI: https://aidevhub.io/api/openapi.yaml