Advertisement

Free Online Docker Compose Validator

Validate Docker Compose YAML structure and common mistakes.

Waiting for input
Services
0
Top-level service keys
Errors
0
Likely to block startup
Warnings
0
Worth reviewing
Advertisement

About the Docker Compose Validator

Docker Compose files look simple until a typo stops an entire stack from starting. A misplaced port mapping, a dependency on a service that no longer exists, or a named volume that was never declared can produce error messages far away from the real cause. This validator parses a compose file with js-yaml, checks the document structure, and reports suspicious service definitions before you run docker compose up.

The YAML is parsed locally. Syntax errors include a line and column where available. Once the document loads, the tool checks that a services mapping exists and that each service has an image or a build definition. It flags services that define both, because Compose builds the image and tags it with the image name, which can confuse caching if you expected a registry pull. Images without a tag and images pinned to latest receive a warning, since a rebuild can silently pull a different release. Digest pins are recognized as intentional and are not flagged.

Port mappings are parsed in short syntax, including host IP prefixes and protocol suffixes. Invalid container ports and duplicate host ports across services are reported. Volume mounts are separated into bind mounts and named volumes; a named volume must appear in the top-level volumes block unless it is created externally. The tool also verifies that every entry in depends_on points at a defined service, catches self-references and duplicate container_name values, validates the restart policy, checks service-level network references against declared networks, and warns when an environment entry looks like a plaintext secret rather than an interpolation.

Compose evolves quickly, and valid files can use features this static checker does not model, including profiles, anchors, merge keys, extends, and advanced deployment constraints. Treat the output as a review aid rather than a substitute for docker compose config, which uses the real Compose parser and applies environment substitution. The deprecated top-level version key is reported as a warning because modern Compose ignores it. Everything runs in the browser and no file is uploaded.

How to use this tool

  1. Paste a docker-compose.yml or compose.yaml file into the editor.
  2. Click Validate compose file.
  3. Read errors first, then work through the warnings that apply to your environment.
  4. Copy or download the report and attach it to a pull request or ticket.

Frequently asked questions

Does this run Docker or pull images?

No. It only reads YAML text. It cannot verify that an image exists, that a port is free, or that a host path is present.

Why is the version key flagged?

The Compose specification no longer requires a top-level version. Recent Compose releases warn that the field is obsolete, so the tool reports it for cleanup.

Can it resolve environment variables?

No. Values such as ${TAG} are left as written. Run docker compose config to see the fully interpolated file.

Sponsored
Find a bug? Report now