Docker Compose Validator
Validate your compose.yaml against the official Compose schema and catch key typos, wrong types and YAML errors, with the exact line. All in your browser.
What this tool does
You paste the contents of your compose.yaml and it tells you whether it matches the official Compose schema, flagging every problem with its line, the path inside the file and a plain-English explanation. No Docker installation required, and the file never has to be on your disk.
The practical difference from docker compose config is context. That command resolves environment variables, build paths and .env files, so it fails for reasons that have nothing to do with the document’s structure: it will tell you a directory is missing before it tells you that you misspelled a key. Here the document is validated exactly as written, which is what you actually need when someone hands you a file, when you are halfway through writing one, or when you want to understand what is wrong before spinning anything up.
How to use it
- Paste the file into the text box.
- Read the list of problems. Each one carries a line number, the path (
services › web › ports) and what was expected. - Click a line number to jump to that part of the file.
If the file is correct you will see how many services it defines. There is no validate button — it checks as you type.
The mistakes that show up most in a compose.yaml
A typo in a key name
This is by far the most common one, and the one command-line tools explain worst. You write imagee instead of image, or enviroment instead of environment, and what you get back is a terse additional property is not allowed — technically true, but it does not tell you where to look.
The schema declares additionalProperties: false on almost every block, so any key it does not recognise is an error. This tool takes advantage of that: when it finds an unknown key, it compares it against the valid keys at that exact point in the schema and suggests the closest match. It is not a generic list of Compose words — it is what is genuinely allowed inside that service, network or volume.
A value where a list belongs
ports, volumes, depends_on and networks take list form. Writing ports: "8080:80" instead of
ports:
- "8080:80"
is an easy slip when there is only one entry. The error you will see is that it must be a list, with the line pointed out.
The mirror case exists too: environment accepts both forms, a map (KEY: value) and a list (- KEY=value), but you cannot mix them inside the same block.
Indentation
If the YAML cannot even be parsed, no schema will help: the tool reports it as a syntax error rather than a structural one. The two culprits are almost always an indentation level that does not line up with its siblings, and a colon with no space after it. YAML does not allow tabs for indentation; if your editor inserts them, convert them to spaces.
version: at the top of the file
It still shows up in tutorials and in old answers, but it is deprecated. The schema itself marks it as declared for backward compatibility and ignored. It will not raise an error, but you can delete it: Compose v2 does not use it for anything.
Unquoted ports
ports: - 8080:80 without quotes is valid as far as the schema is concerned, but YAML reads some pairs as sexagesimal numbers and silently changes the value. That is why the documentation recommends always quoting ports. It will not appear as an error here, but it is worth knowing.
What this tool does not validate
It is worth being precise about scope, because a validator that promises too much is worse than none:
- It does not check that images exist or that they can be pulled.
- It does not resolve environment variables or
.envfiles, so a${MY_VARIABLE}is accepted as text. - It does not verify
buildpaths or that referenced files are on your disk. - It does not catch logical problems such as a
depends_onpointing at a service that does not exist, two services fighting over the same port, or a volume that is declared and never used.
What it does guarantee is that the file’s structure is the one Compose expects: recognised keys, correct types and valid nesting. That is the filter that catches most broken files before they ever reach docker compose up.
Why it runs in your browser
The official schema is precompiled into the page itself and the entire validation happens on your machine. No network request fires when you validate, and you can confirm that yourself by opening the network tab of your developer tools.
This matters more than it might seem. A real compose.yaml describes a project’s internal topology: service names, ports, volume paths and — more often than anyone likes to admit — development database passwords. Pasting it into a tool that uploads it to someone else’s server means leaking a map of your infrastructure in exchange for a syntax check.
About the schema
Validation runs against compose-spec, the open specification maintained by Docker and the other implementations, published under the Apache 2.0 licence. It is the same one Docker Compose v2 consumes, so what passes here passes on your machine too.
Frequently asked questions
How is this different from running docker compose config?
That command needs Docker installed and the file on your disk, and it also tries to resolve environment variables and build paths, so it fails for reasons unrelated to the file's structure. This tool validates the document exactly as you paste it, with no Docker and no context, which is what you need when someone hands you a compose.yaml or you are still writing it.
Does it catch typos in key names?
Yes, and that is what it does best. If you write imagee instead of image, or volumeess instead of volumes, the schema flags it as an unknown key and the tool compares it against the valid keys at that exact point to suggest the one you meant. It is the most common mistake and the one command-line tools explain worst, since they only say there is an additional property.
Is my file uploaded to a server?
No. The official schema is precompiled into the page and the whole validation runs in your browser with JavaScript. You can verify it by opening your developer tools: validating fires no network request. That matters because a compose.yaml usually carries internal service names, ports and sometimes development passwords.
Which Compose version does it validate against?
Against the compose-spec schema, the open specification maintained by Docker and the other implementations, which is the same one Docker Compose v2 uses. The version key at the top of the file is deprecated and the schema itself marks it as ignored, so you do not need to declare it.
Why does it flag a line that looks correct?
When the problem is in a block's structure, the schema points at the parent node rather than the specific line. Click the line number to jump there and look at the whole block, not just that line. If the problem is indentation, the message will say it is a YAML error and not a schema one.
Reviews & ratings
No reviews yet. Be the first to leave one!
Related guides
Blog tutorials where this tool comes in handy.
Related tools
Others from the catalogue that pair well with this one.