Docker Compose Validator screenshot

Docker Compose Validator

Validate a Compose file locally: services present, each with an image or a build, and every depends_on naming a service in the same file.

Privacy First
0 Runs
Updated 2026-11-17
Runs in your browser
No sign-up, no upload

What the Docker Compose Validator does

The YAML is parsed by the shipped parser, then the document is walked: services must exist and be mappings, each needs an image or a build, and a dependency must resolve within the file. A version key is reported as obsolete rather than as an error, because the Compose Specification no longer uses it.

Valid files report the service count and names, so the output proves what was checked instead of saying ok.

This validates structure, not your Compose implementation: volume syntax, port ranges, healthcheck commands and profile names are not checked. It is not a substitute for docker compose config, which validates against the installed version.

How to use it

Paste the file into the Compose file box, or press Run with the example already there.

Read the Validation report below: the service count, their names, and any issue that is not fatal.

Check a deliberate mistake in the Validation report — a service with neither image nor build is refused with its path.

Worked example

Input:

version: "3.8"
services:
  api:
    image: nginx
  db:
    image: postgres

Output:

Valid: yes
Services: 2 (api, db)
Issues: version is obsolete in the Compose Specification

Why it runs in your browser

The result is produced on this page with JavaScript, so it works offline after the page loads and nothing you enter is sent anywhere.

A structural check of a Compose file you paste: every service is a mapping with an image or a build, and every depends_on names a service that exists in the same file.

The first problem is refused by its own path — `services.api.depends_on: cache is not a service in this file` — rather than as a generic invalid file.

What it does, and what it does not

The YAML is parsed by the shipped parser, then the document is walked: services must exist and be mappings, each needs an image or a build, and a dependency must resolve within the file. A `version` key is reported as obsolete rather than as an error, because the Compose Specification no longer uses it.

Valid files report the service count and names, so the output proves what was checked instead of saying `ok`.

This validates structure, not your Compose implementation: volume syntax, port ranges, healthcheck commands and profile names are not checked. It is not a substitute for `docker compose config`, which validates against the installed version.

How to use Docker Compose Validator

Paste the file into the Compose file box, or press Run with the example already there.

Read the Validation report below: the service count, their names, and any issue that is not fatal.

Check a deliberate mistake in the Validation report — a service with neither image nor build is refused with its path.

What to Expect

Best for

  • Catching a missing image before a deploy
  • Checking that depends_on names a real service

Not ideal for

  • Validating against your Compose implementation, which needs the CLI
  • Checking port or volume syntax

What this tool keeps

  • The service list, in file order
  • A version key reported as obsolete, not fatal

What may need cleanup

  • Run `docker compose config` for a full check
  • A profile or extension field is not inspected

Common errors

  • The page refuses it: services.api: image or build is required

Example use cases

  • Checking a Compose file in a pull request
  • Finding the service a stack fails to start

Sample input

Compose file: version: "3.8" …

Sample output

Validation report: Valid: yes …

Who this is for

  • Developers writing Compose files
  • Anyone reviewing a container change

Frequently asked questions

Is `version` an error?

No. The Compose Specification made it obsolete, so the page reports it as an issue and still validates the rest of the file.

Does it check port syntax?

No. It checks structure — services, images, builds and dependencies. Port and volume syntax is left to docker compose config.

What does depends_on check?

That the named service exists in the same file. A dependency on a container outside the file cannot be resolved locally, so it is reported by path.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.