error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH
Fixes 'docker-credential-desktop: executable file not found in PATH' on Linux. Use when docker login or pulls fail because ~/.docker/config.json points at the Desktop credential helper that is not installed. Not for wrong-password errors.
TL;DR: Your docker config references a credential helper that does not exist on this machine. Either install Docker Desktop (which provides it) or remove the "credsStore": "desktop" line from ~/.docker/config.json so docker stores credentials in the file again. This config usually arrives by copying a Mac's ~/.docker to a Linux box.
The error
error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATHFix it
- Inspect the config:
cat ~/.docker/config.json Expected: contains "credsStore": "desktop" (or "credStore").
- Option A (no Desktop here): delete that line, keeping valid JSON.
- Option B (Desktop wanted): install Docker Desktop for Linux, which ships the helper.
- Re-run
docker loginand verify pulls work.
When this applies
- Linux hosts with a copied-over docker config
- CI images inheriting a developer's config.json
When this does NOT apply
- "incorrect username or password" (credentials present but wrong)
- macOS with Desktop installed (helper should exist; reinstall Desktop)
Versions
All Docker versions; the credsStore mechanism is long-standing.
Why it happens
credsStore delegates credential storage to an external binary. If the binary is absent, EVERY credential read fails, including anonymous pulls that check for stored creds first.
Edge cases
- Validate JSON after editing:
python3 -m json.tool ~/.docker/config.json. - Alternatives:
"credsStore": "secretservice"(Linux keyring) orpassbased helpers, if you want secure storage without Desktop. - Some distros package
docker-credential-helpersseparately; installing it providesdocker-credential-secretserviceandpassvariants.
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.