Docker Compose Validator
Validate docker-compose.yml for syntax errors, unknown keys, and misconfigurations — entirely in your browser
Paste your docker-compose.yml content above to validate its structure, check for common issues, and view a service summary. All processing happens locally in your browser.
A single indentation mistake in your docker-compose.yml can prevent all your services from starting. Typos in directive names like depend_on instead of depends_on silently pass YAML parsing but fail at runtime. This tool validates your compose file structure and flags errors with line numbers before you run docker compose up.
What Gets Validated
The validator checks your compose file at multiple levels:
- YAML syntax — Indentation errors, missing colons, invalid characters, duplicate keys
- Compose structure — Required fields (
services,imageorbuild), valid top-level keys (version,services,volumes,networks,configs,secrets) - Service configuration — Port format validation, volume syntax, restart policy values, dependency references
- Cross-references — Services in
depends_onexist, named volumes and networks are defined - Common mistakes —
portvsports,environmentformat (list vs map), invalid restart values
Common Mistakes This Tool Catches
These are the most frequent docker-compose.yml errors that waste developer time:
| Mistake | What Happens |
|---|---|
depend_on instead of depends_on | Silently ignored — services start in random order |
port: "8080:80" instead of ports: | Invalid key error at runtime |
environment: KEY=VALUE (string) | Should be a list (- KEY=VALUE) or map |
restart: on_failure | Invalid — must be on-failure (with hyphen) |
| Indenting with tabs | YAML requires spaces, tabs cause parse errors |
| Missing image or build | Service has no source to create a container |
Why Validate Before Deploying
Docker Compose gives cryptic error messages for many configuration issues. A missing colon on line 47 might produce an error pointing to line 2. Validating your file in this tool gives you precise, human-readable error messages with line numbers, so you fix problems before they waste deployment time.
How to Use
- Paste your
docker-compose.ymlcontent into the editor - The validator parses and checks it in real time
- Errors and warnings appear with line numbers and descriptions
- Fix the issues and re-validate until the file passes
Frequently Asked Questions
Which docker-compose versions are supported? The validator supports version “2.x” and “3.x” compose file formats, including the latest Compose Specification (no version field required).
Does it validate Dockerfile references?
No. It checks that build directives have valid syntax, but it doesn’t fetch or parse the referenced Dockerfiles.
Can it validate Docker Compose override files?
Yes. Paste the content of your docker-compose.override.yml and it will be validated with the same rules. Note that override files are typically merged with the base file — standalone validation won’t catch merge conflicts.
What about Docker Compose V2 vs V1 syntax?
Both are supported. Docker Compose V2 (the docker compose plugin) uses the same YAML format as V1 (docker-compose). The validator handles both the legacy versioned format (version: "3.8") and the newer Compose Specification format where the version field is optional.
Can it check for security issues like running containers as root? The validator focuses on syntax and structure correctness. For security auditing (privileged mode, root users, host networking), use dedicated container security scanning tools.
Is my compose file sent to a server? No. All validation runs in your browser. Your configuration never leaves your device.