Skip to content
docker-compose.yml → IssuesDeveloper tools

Docker Compose YAML Validator

Check a docker-compose.yml file for YAML syntax errors and common Compose mistakes, with the exact line of each syntax error.

Did this tool work for you?

Used Docker Compose YAML Validator? Share how it went to help others.

About this tool

About Docker Compose YAML Validator

Docker Compose YAML Validator parses your docker-compose.yml as real YAML and then checks the structure Docker Compose expects. Syntax errors are reported with the exact line and column. After parsing, it checks that there is a services section with at least one service, that each service has an image or build key, that service keys are known Compose options so typos like imagee are caught, that ports are a list in a valid format such as "8080:80", that unquoted port numbers are flagged, and that every service named in depends_on actually exists. It also reminds you that the top-level version key is obsolete in Compose v2. Tabs used for indentation are reported because YAML only allows spaces. Validation runs in your browser as you type. It is a fast first check, not a full replacement for docker compose config, which also resolves variables and extends. It recognises the service options people use every day, including image, build, command, entrypoint, environment, env_file, ports, expose, volumes, depends_on, networks, restart, container_name, healthcheck, labels, logging, deploy, secrets, configs, profiles and extends, and it allows custom x- extension fields. Each problem is listed with the service it belongs to, so fixing a long file is quick.

Docker Compose YAML Validator tool

When to validate a Compose file

Catch mistakes before docker compose up

Before deploying

A typo in a key is silently ignored by some tools and only noticed when a service misbehaves.

ExampleFind that a service has enviroment: instead of environment:, so its variables were never set.

Copied examples

Files copied from blogs often contain tabs or broken indentation.

ExamplePaste a copied example and fix the tab on line 12 that stops Compose from loading it.

Code review

Quickly check a colleague’s Compose changes without running them.

ExampleSpot that a new worker service depends_on “redis-cache” but the service is named “redis”.

Learning Docker

Understand why a Compose file fails before you touch the command line.

ExampleA beginner’s file uses tabs for indentation; the validator flags the exact line, and switching to spaces fixes it.

Self-hosting apps

Check Compose files for tools like Nextcloud, Jellyfin or n8n before starting the stack.

ExampleAn app’s database service is named postgres but depends_on lists db, and the validator reports the missing service.

Debugging a failing stack

Rule out structural mistakes quickly when docker compose up refuses to start.

ExampleA service has neither image nor build, the reason Compose cannot create its container.

Compose tips

Avoid the most common problems

Quote port mappings

Write "8080:80", not 8080:80. Unquoted values like 22:22 can be read by YAML as base-60 numbers.

Drop the version key

Compose v2 ignores version:, so you can remove it.

Final check

Run docker compose config on your machine to see the fully resolved file, including variables.

Convert YAML to JSON

See exactly how YAML is interpreted by converting it to JSON.

Open YAML to JSON

Keep secrets out of the file

Put passwords in an .env file or Docker secrets instead of writing them in environment. Never commit real credentials.

Indent with two spaces

YAML forbids tabs, and mixing indentation levels changes the meaning of the file. Two spaces per level is the convention.

Built & tested by

HemantInsights

Senior Software Engineer · Developer of Toolyconvert

Hemant developed Docker Compose YAML Validator and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.

Last updated 30 September 2026

Answers and guidanceFrequently Asked Questions
What does the validator check?
YAML syntax, a non-empty services section, an image or build key for each service, known service keys, port format, depends_on references, and tabs in indentation.
Is it the same as docker compose config?
No. It is a quick check for syntax and common mistakes. docker compose config also resolves variables, extends and profiles.
Is the version key required?
No. It is obsolete in Compose v2 and ignored. The validator shows a note but doesn’t treat it as an error.
Why is an unquoted port flagged?
YAML can interpret some unquoted values like 22:22 as numbers in base 60. Quoting ports avoids that.
Is my file uploaded?
No. It is parsed in your browser.
What is a docker-compose.yml file?
A YAML file that describes the containers, networks and volumes of an application, so the whole stack can be started with docker compose up.
Why are tabs not allowed?
The YAML standard only allows spaces for indentation. A tab makes the file invalid, and the validator reports the line where it appears.
Does it check environment variables like ${DB_PASSWORD}?
It accepts them as text but does not replace them with values, because it cannot see your .env file. docker compose config resolves them on your machine.
Does it catch misspelled keys?
Yes. Service keys are checked against the known Compose options, so a typo such as imagee or depends_no is reported instead of silently ignored.
Can I validate a compose.yaml file?
Yes. compose.yaml is the newer default file name. The contents use the same format, so paste it in the same way.
What does depends_on do?
It controls start order: a service starts after the services it depends on. The validator checks that every name listed exists in the file.
Does it support x- extension fields?
Yes. Keys that start with x- are allowed, since Compose uses them for reusable blocks and custom settings.
More tools for your workflowRelated Tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.