docker-credential-desktop
Not Installed or Not Available in PATH
This error occurs when Docker cannot find the required credential helper for authentication, typically affecting users with mixed Docker installations or specific environment configurations.
Problem Overview
The docker-credential-desktop
error appears when:
- Docker Desktop and command-line installations conflict
- The credential helper configuration in
~/.docker/config.json
is incorrect - The credential helper executable is missing or inaccessible in PATH
- Environment-specific issues exist (WSL, proxy configurations, etc.)
Common error message:
docker.credentials.errors.InitializationError: docker-credential-desktop not installed or not available in PATH
Primary Solutions
Solution 1: Modify Docker Configuration (Quick Fix)
The most common solution involves editing Docker's configuration file:
# Edit the config.json file in your preferred text editor
nano ~/.docker/config.json
Change the credsStore
value from "desktop"
to either:
"osxkeychain"
(macOS)- Remove the line entirely (disables credential storage)
- Use a supported credential helper for your system
Example configuration:
{
"stackOrchestrator": "swarm",
"experimental": "disabled",
"credsStore": "osxkeychain"
}
WARNING
Disabling credential storage (credsStore
) will require you to manually authenticate with Docker registries each time.
Solution 2: Install Proper Credential Helper (macOS)
For macOS users, install the official credential helper via Homebrew:
brew install docker-credential-helper
docker-credential-osxkeychain version
# Should output version number, e.g., 0.6.4
docker login -u YOUR_USERNAME
Update your Docker configuration to use the credential helper:
{
"credsStore": "osxkeychain",
"experimental": "enabled",
"stackOrchestrator": "swarm"
}
Solution 3: WSL2 Windows Fix
For Windows Subsystem for Linux users, the credential helper may have incorrect symlinks:
# Remove existing symlink
sudo rm /usr/bin/docker-credential-desktop.exe
# Create new symlink without .exe extension
sudo ln -s /wsl/docker-desktop/cli-tools/usr/bin/docker-credential-desktop.exe /usr/bin/docker-credential-desktop
# Verify the new symlink
ls -l /usr/bin/docker-credential-desktop
Additional Troubleshooting Steps
Check Current Docker Configuration
# View your current Docker configuration
cat ~/.docker/config.json
# Check if credential helpers are in PATH
which docker-credential-desktop
which docker-credential-osxkeychain
Clean Up Mixed Installations
If you have both Docker Desktop and command-line installations:
# Uninstall Docker Desktop first
# Then clean up Homebrew installations
brew uninstall docker docker-compose docker-machine
# Reinstall cleanly using Homebrew
brew install docker docker-compose
Build Credential Helper from Source
For advanced users who need a specific credential helper:
# Clone the credential helpers repository
git clone https://github.com/docker/docker-credential-helpers.git
# Build for your platform (example for secretservice)
cd docker-credential-helpers/
make secretservice
# Copy to a directory in your PATH
cp bin/build/docker-credential-secretservice ~/bin/
Understanding the Issue
Docker uses credential helpers to securely store and retrieve credentials for container registries. The error occurs when:
- Docker Desktop installs a credential helper that isn't compatible with command-line installations
- The configuration points to a non-existent credential helper
- PATH environment variable doesn't include the location of credential helpers
- Mixed installations create conflicts between different Docker components
INFO
The credsStore
setting in ~/.docker/config.json
tells Docker which credential helper to use for managing registry authentication credentials.
Prevention Best Practices
- Choose one installation method: Either Docker Desktop or command-line tools, not both
- Verify PATH configuration: Ensure Docker binaries and credential helpers are accessible
- Keep installations updated: Regularly update Docker and credential helpers
- Backup configuration: Backup
~/.docker/config.json
before making changes
When to Use Different Solutions
Scenario | Recommended Solution |
---|---|
Quick fix needed | Modify config.json |
macOS with Homebrew | Install docker-credential-helper |
WSL2 on Windows | Fix symlink issue |
Advanced/Linux users | Build from source |
AWS SAM CLI issues | Remove credsStore entirely |
Most users will find that modifying the config.json
file or installing the proper credential helper resolves the issue immediately. For persistent problems, consider a clean Docker reinstallation and verify your PATH environment variable includes all necessary Docker components.