no configuration file provided: not found
Fixes the docker-compose error `no configuration file provided: not found`. It explains the verified fix from a real resolved case, when it applies, and what to check first. Not for unrelated docker-compose failures or different error text.
Fix no configuration file provided: not found (docker-compose)
TL;DR
You ran compose from a directory that has no compose file. cd into the directory containing docker-compose.yml, or point compose at it explicitly with docker compose -f /path/to/docker-compose.yml ps. That is the whole fix.
The error, verbatim:
no configuration file provided: not foundSteps
- Confirm you are in the wrong directory:
pwd && ls docker-compose.yml compose.yaml 2>/dev/nullSuccess check: pwd prints the directory; ls shows whether a compose file is there.
- Change into the directory that holds the compose file:
cd /path/to/projectSuccess check: ls lists the compose file in the new directory.
- Re-run your compose command and verify:
docker compose psSuccess check: Services are listed with their state; no error.
When to use
You hit this exact error while using docker-compose. The trigger list below matches your situation.
When NOT to use
If the error text differs, or the failure is in a different tool (e.g. a Docker daemon error when you only need the compose fix), find the skill for that exact error instead.
Tool compatibility
Compose v2 (docker compose) and docker-compose v1. Any OS.
Variant phrasings
no configuration file provided: not found
docker compose ps returns no configuration file provided
Root cause
Compose looks for docker-compose.yml / compose.yaml in the current working directory (or the paths given by -f / COMPOSE_FILE). When you run it from anywhere else, it finds nothing and reports this instead of guessing.
Edge cases
- Check the file is not saved with a hidden extension like docker-compose.yml.txt on Windows.
- If you use multiple files, every -f flag must point at a real file; one bad path gives the same error.
- COMPOSEFILE env var overrides the default search; an empty or wrong COMPOSEFILE causes this too.
Where this came from
Resolved from the public discussion at https://stackoverflow.com/questions/70256928 (so:70256928).
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.