How to Install Docker Desktop on an Existing Docker CLI Environment (macOS Homebrew)
This guide explains how to install Docker Desktop on a macOS environment where only Docker CLI was installed via Homebrew.
brew install docker)As introduced in Colima + Docker CLI Setup Guide (macOS), many developers use Docker CLI + Colima without Docker Desktop.
However, there are cases where you may want to switch to Docker Desktop later, such as when team policies change or when you need Docker Desktop’s GUI features.
When installing Docker Desktop on an environment with only Docker CLI installed, you might have the following question:
Docker CLI を先に削除したほうが良いですか?
(Should I uninstall Docker CLI first?)
The short answer is no, you don’t need to uninstall it first. However, you’ll need a small workaround during installation.
If you prefer to uninstall Docker CLI related packages first, you can use the following commands:
brew uninstall docker
brew uninstall docker-compose # if installed
brew uninstall docker-buildx # if installedThen install Docker Desktop:
brew install --cask docker-desktopThis method avoids any conflicts.
If you try to install Docker Desktop without uninstalling Docker CLI, you may encounter the following error.
brew install --cask docker-desktop==> Downloading https://desktop.docker.com/mac/main/arm64/214940/Docker.dmg
Already downloaded: /Users/your_name/Library/Caches/Homebrew/downloads/081a17783363af6e0cf6d48d362aae02095f9fc
5d6dfd90e746912cfefd2d579--Docker.dmg
==> Installing Cask docker-desktop
==> Moving App 'Docker.app' to '/Applications/Docker.app'
==> Backing App 'Docker.app' up to '/opt/homebrew/Caskroom/docker-desktop/4.56.0,214940/Docker.app'
==> Removing App '/Applications/Docker.app'
==> Purging files for version 4.56.0,214940 of Cask docker-desktop
Error: It seems there is already a Bash Completion at '/opt/homebrew/etc/bash_completion.d/docker-compose'.This error occurs because the docker (Docker CLI) and docker-compose packages installed via Homebrew have installed shell completion files.
Docker Desktop also tries to install completion files to the same location, causing a conflict.
Use the --force option to install:
brew install --cask docker-desktop --forceWith the --force option, you can overwrite existing completion files and install Docker Desktop.
The --force option performs the following actions:
The completion files will be replaced with those from Docker Desktop, but they are functionally equivalent, so there’s no issue.
After installing Docker Desktop, verify that it works correctly.
open /Applications/Docker.appAlternatively, launch Docker.app from the Applications folder, or search for “Docker” in Spotlight.
docker --versiondocker run hello-worldIf you see the “Hello from Docker!” message, everything is working correctly.
When installing Docker Desktop on an environment where only Docker CLI was installed via Homebrew, you can resolve completion file conflicts by using the --force option.
brew install --cask docker-desktop --force--force option to overwriteThat’s all from the Gemba.