Free Online Docker Compose Validator
Validate and inspect docker-compose.yml files instantly. Checks syntax, service dependencies, port formats, and common mistakes — 100% client-side.
100% Client-Side · Your data never leaves your browserHow to Use Docker Compose Validator
Paste your docker-compose.yml (or compose.yml) content into the text area, then click Validate or press Ctrl/Cmd+Enter:
- Errors — fatal issues that will prevent
docker compose upfrom working, such as YAML syntax errors, a missingservices:key, ordepends_onreferencing an undefined service. - Warnings — non-fatal issues to review: obsolete
versionfield, services missing animageorbuild, and services without arestartpolicy. - Services panel — a summary card for each service showing its image, build context, ports, volumes, environment variable count, and dependencies.
- Networks & Volumes — lists all named top-level networks and volumes defined in the file.
Click Sample to load a typical three-service stack (nginx + API + PostgreSQL). Use Ctrl/Cmd+K to clear the editor.
Frequently Asked Questions
What is a docker-compose.yml file?
A docker-compose.yml file (or compose.yml) defines a multi-container Docker application. It describes each service (container), its image or build context, exposed ports, mounted volumes, environment variables, and inter-service dependencies. Docker Compose reads this file to create and start all services with a single docker compose up command.
Why is the "version" field now obsolete?
Docker Compose V2 (integrated into the Docker CLI as docker compose) adopts the Compose Specification, which no longer requires a top-level version field. The field was previously used to select a Compose feature set version (e.g., "3.8"). Modern Compose files can omit it entirely. This tool warns you if it is present so you can clean it up.
What does the "depends_on" validation check?
This tool verifies that every service name listed under depends_on is actually defined in the services block of the same file. A typo in a service name would cause docker compose up to fail with a confusing error. The validator catches this at paste-time before you try to run the stack.
What port format does Docker Compose expect?
Ports can be specified as "HOST:CONTAINER" (e.g., "8080:80"), a bare container port ("80"), or with a protocol suffix ("80/tcp"). Always quote port mappings in YAML to prevent the parser from misinterpreting numbers like 8080:80 as a sexagesimal (base-60) literal.
Why should every service have a restart policy?
Without a restart policy, containers that crash or exit will not automatically restart. The most common value for production services is restart: unless-stopped, which restarts the container automatically unless you explicitly stop it. This tool warns when no restart policy is defined so you can decide intentionally.
What is the difference between "image" and "build"?
image specifies a pre-built Docker image to pull from a registry (e.g., nginx:alpine). build specifies a local directory containing a Dockerfile — Compose will build the image from source before starting the container. A service can technically have both, in which case build takes precedence and the resulting image is tagged with the name from image.
Is my docker-compose.yml sent to a server?
No. Validation runs entirely in your browser using the js-yaml library for YAML parsing. Your configuration files — which may contain internal hostnames, credentials, or volume paths — never leave your machine.