Docker Compose Validator

Validate and lint Docker Compose YAML files. Check service definitions, networks, volumes, and common configuration errors.

About This Tool

The Docker Compose Validator is a free browser-based tool that analyzes your docker-compose.yml files for syntax errors, structural issues, and common misconfigurations. It helps you catch problems before running docker compose up, saving time and preventing frustrating deployment failures.

Docker Compose is the standard tool for defining and running multi-container Docker applications. A single YAML file describes all your services, their images, port mappings, volume mounts, environment variables, network configurations, and inter-service dependencies. Getting this configuration right is critical — a typo in a port mapping, a reference to a non-existent service in depends_on, or a missing network definition can cause your entire stack to fail.

This validator performs comprehensive checks including YAML syntax validation, service structure verification (every service needs either an image or build directive), port mapping validation (ensuring numeric values in the valid 1-65535 range), volume mount syntax checking, environment variable format validation, depends_on reference verification (all referenced services must exist), network reference validation, restart policy validation, and circular dependency detection between services.

All processing happens entirely in your browser using client-side JavaScript and the <a href="https://github.com/nodeca/js-yaml" target="_blank" rel="noopener noreferrer" className="text-primary underline underline-offset-2"

js-yaml library for YAML parsing. Your Docker Compose file content never leaves your machine — there are no server round-trips, no logging, and no third-party analytics on your input. This makes the tool safe for validating Compose files that contain internal registry URLs, private service names, or sensitive environment variable configurations.

Each issue is reported with a severity level (error, warning, or info), the approximate line number, and a clear explanation of what is wrong along with a suggestion for how to fix it. The auto-validate feature provides instant feedback as you type, making it easy to iterate on your Compose file until all issues are resolved.

How to Use

  1. Paste your docker-compose.yml content into the input panel on the left, or click the Sample button to load an example file with intentional issues.
  2. Click the Validate button or press Ctrl+Enter to analyze the file.
  3. Optionally enable Auto-validate to get instant feedback as you type or edit.
  4. Review the summary bar showing the number of services, networks, volumes, and total issues found.
  5. Examine each issue in the results panel. Line numbers in the input are highlighted in red for lines that have issues, making it easy to locate problems.
  6. Click Copy or press Ctrl+Shift+C to copy all results to your clipboard for sharing or documentation.

FAQ

Is my Docker Compose file data safe?

Yes. All parsing and validation is done entirely client-side in your browser using JavaScript and the js-yaml library. No data is ever sent to any server. You can verify this by checking the Network tab in your browser's developer tools.

What does this validator check?

The validator checks YAML syntax, the presence and structure of the required 'services' key, service properties (image/build requirement, ports format, volumes format, environment variables, depends_on references, network references, and restart policies), port mapping validity (numeric values in 1-65535 range), volume mount syntax, circular dependencies between services, and the deprecated version field.

What is the difference between error, warning, and info severities?

Errors indicate issues that will likely prevent Docker Compose from running your file (e.g., missing services key, invalid port numbers, references to undefined services). Warnings highlight potential problems like undefined named volumes or environment variables without values. Info items are suggestions such as noting that the version field is now obsolete.

Why does it warn about the version field?

Docker Compose v2 (the modern Go-based implementation) uses the Compose Specification, which does not require a version field. The version key is ignored by Docker Compose v2+ and is only kept for backward compatibility. Removing it simplifies your file. If you use version 2.x, the tool warns that it is outdated and suggests upgrading.

Does it support Docker Compose v2 and v3 syntax?

Yes. The validator supports both Docker Compose v2 and v3 file formats, as well as the modern Compose Specification (no version field). It validates the common structure shared across all versions including services, networks, volumes, and their properties.

Can it detect circular dependencies?

Yes. The validator builds a dependency graph from all depends_on declarations and uses depth-first search to detect circular references. If service A depends on B and B depends on A (directly or transitively), it will report the full dependency cycle.

How is this different from running docker compose config?

The 'docker compose config' command requires Docker to be installed and runs on your machine. This tool works entirely in the browser with no installation needed. It is ideal for quick validation before committing changes, reviewing Compose files in code review, or learning the correct syntax. For full validation against the Docker engine, use docker compose config locally.

Related Tools