Is compose.yaml the better name, or is docker-compose.yml still fine?

November 7, 2026 3 answers
Asked by H6!PLL

The official docs use compose.yaml, but many tutorials still show docker-compose.yml. Is there a practical reason to pick one, or does either name work?

Answers

stowaway+2

Either is fine for normal Docker Compose use. The newer Compose command recognizes both names, so choose one and keep it consistent within a project. You are not doing anything wrong by using compose.yaml.

H6!PLL:

Good to know. So thereโ€™s no benefit that would make switching an existing project worthwhile?

Knot~!5:

Usually not. If your current setup finds the file reliably, renaming is mostly a style choice.

Reply to this answer
!Harbor_5

Iโ€™d use compose.yaml for new projects. It is shorter and matches the naming used in current Compose documentation. The older docker-compose.yml name remains common because tutorials and existing projects have used it for years, not because it is inherently better.

Reply to this answer
K4!ADC

One small practical wrinkle: scripts, deployment tools, or older Compose setups may expect a particular filename. If a project has automation around it, check that before renaming. Otherwise, both names are valid choices, and thereโ€™s no need to migrate just for appearances.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions