Docker Compose Validator.

Paste a docker-compose.yml or compose.yaml and press Validate. It is checked against the Docker Compose v2.29 schema, without Docker installed.

What it checks

The Compose file schema

The file is checked against the Docker Compose v2.29 schema, the format behind both docker-compose.yml and compose.yaml. Errors point to the field path and the line.

  • Unknown keys, so a misspelled enviroment: or volume: is caught instead of being ignored.
  • List or map: fields like ports, depends_on and networks need a list or a map, not a single value.
  • Types: durations such as a healthcheck interval are strings like 30s, not numbers.

YAML syntax is checked first, so indentation errors and tabs are reported with their line before the schema check runs. Everything runs in your browser; the file is never uploaded.

Common mistakes

What the validator catches, with the message you get

A misspelled key

services:
  web:
    image: nginx
    enviroment:
      NGINX_HOST: example.com

Message: /services/web unknown property 'enviroment'. The fix is environment:.

A single value where a list is needed

services:
  web:
    image: nginx
    depends_on: db
    networks: frontend

Message: /services/web/depends_on must be array. Write each entry as a list item: depends_on: [db] or - db on the next line.

Ports written on one line

services:
  web:
    image: nginx
    ports: 8080:80

Message: /services/web/ports must be array. Use a list, and quote each mapping: - "8080:80".

A duration without a unit

healthcheck:
  test: curl -f http://localhost
  interval: 30

Message: /services/web/healthcheck/interval must be string. Durations need a unit: interval: 30s.

Mixing list and map syntax in environment

environment:
  - DEBUG: "true"

Message: /services/web/environment/0 must be string. In list form each entry is one string, - DEBUG=true. For a map, drop the dash: DEBUG: "true".

Values YAML reads differently

environment:
  COUNTRY: NO
  VERSION: 3.10

This file is valid, but you get warnings: YAML 1.1 parsers read NO as false, and 3.10 is the number 3.1. Quote them to keep the text. See YAML gotchas.

Limits

What a schema check cannot tell you

  • Variables like ${TAG} are checked as written, not after substitution from .env.
  • Your machine: whether an image exists, a port is free, or a bind-mount path is there.
  • Cross-references: a depends_on service or a named volume that is not defined in the file.

For those, run docker compose config: it substitutes variables and resolves the whole project.

Validate other YAML files