256

How to easily install Docker to have it available in terminal and how to uninstall Docker on macOS?

6 Answers 6

365

To Install:

  1. Go Here
  2. Click the "Get Docker" or "Get Docker Desktop for Mac (Stable)" button.
  3. Double-click the DMG
  4. Drag Docker into Applications
  5. Open Docker
  6. Open Terminal after install and docker will be available. Docker should auto-launch on subsequent startups and be available on command line.

To Uninstall:

  1. Click On Docker Icon
  2. Select Preferences
  3. Select Bug Icon (Question Mark or Bomb Icon icon in some versions of Docker UI) for the Troubleshoot menu
  4. Select Uninstall

An image of Troubleshoot menu that includes Uninstall button

Sign up to request clarification or add additional context in comments.

6 Comments

Beware: this approach uninstalls all images & containers. I had installed Docker using Homebrew and also the desktop app, thinking that removing the latter would preserve my images. Alas!
There is now an option to uninstall from the command line, this might work if the UI is not in a state where you can uninstall from the GUI: docs.docker.com/desktop/install/mac-install/…
agree with @kip2, this will remove all docker installations and containers
@BrDaHa That page contains no information on uninstalling.
Thanks. Updating the link would be fine, but its nice to have the commit hash that did the work, for posterity. I had to manually delete everything since the UI didn't work, but /Applications/Docker.app/Contents/MacOS/Docker --uninstall is much nice if it functions.
|
260

Install

To install Docker is easy. Download the .dmg, open it, drag and drop the Docker app to Applications, then run Docker Desktop for Mac. Unfortunately, it sprawls gunk all over your Mac (see uninstall).

Uninstall

If Docker starts, you can use the Docker Desktop app to uninstall. If that doesn't work, you will have to dive into the command line. For a complete uninstall (updated 08-Jul-2025) type the following into the terminal:

(Be aware, this removes any Docker virtual machines and images too!)


# credit & please upvote answer by -> We'll See
sudo rm -Rfv /usr/local/bin/docker-index
sudo rm -Rfv /private/var/run/docker.sock
sudo rm -Rfv /private/var/root/Library/Containers/com.docker.docker
sudo rm -Rfv /Library/PrivilegedHelperTools/com.docker.socket
sudo rm -Rfv /Library/Logs/DiagnosticReports/com.docker.backend_*
sudo rm -Rfv /Library/LaunchDaemons/com.docker.socket.plist
sudo rm -Rfv ~/Library/Application Support/com.bugsnag.Bugsnag/com.docker.docker
sudo rm -Rfv ~/Library/Saved Application State/com.electron.dockerdesktop.savedState
sudo rm -Rfv ~/Library/Preferences/com.electron.dockerdesktop.plist
sudo rm -Rfv ~/Library/HTTPStorages/com.docker.docker
sudo rm -Rfv ~/Library/Application Scripts/group.com.docker
sudo rm -Rfv ~/Library/Caches/Docker\ Desktop
sudo rm -Rfv ~/Library/Caches/docker-compose
sudo rm -Rfv ~/Library/Caches/com.docker.docker
# credit & please upvote answer by -> Kamil Kiełczewski
sudo rm -Rf /Applications/Docker
sudo rm -f /usr/local/bin/docker
sudo rm -f /usr/local/bin/docker-machine
sudo rm -f /usr/local/bin/docker-compose
sudo rm -f /usr/local/bin/docker-credential-osxkeychain
sudo rm -Rf ~/.docker
#credit -> Cerniuk
sudo rm -Rf /Applications/Docker.app
sudo rm -f /usr/local/bin/com.docker.cli
sudo rm -f /usr/local/bin/docker-compose-v1
sudo rm -f /usr/local/bin/docker-credential-desktop
sudo rm -f /usr/local/bin/docker-credential-ecr-login
sudo rm -f /usr/local/bin/hub-tool
sudo rm -f /usr/local/bin/hyperkit
sudo rm -f /usr/local/bin/kubectl.docker
sudo rm -f /usr/local/bin/vpnkit
sudo rm -Rf ~/Library/Containers/com.docker.docker
sudo rm -Rf ~/Library/Application\ Support/Docker\ Desktop
sudo rm -Rf ~/Library/Group\ Containers/group.com.docker
sudo rm -f ~/Library/HTTPStorages/com.docker.docker.binarycookies
sudo rm -f /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo rm -f /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo rm -Rf ~/Library/Logs/Docker\ Desktop
sudo rm -Rf /usr/local/lib/docker
sudo rm -f ~/Library/Preferences/com.docker.docker.plist
sudo rm -Rf ~/Library/Saved\ Application\ State/com.electron.docker-frontend.savedState
sudo rm -f ~/Library/Preferences/com.electron.docker-frontend.plist

14 Comments

the command line steps work and they're pretty helpful if for some reason your docker app WON'T start up (normally your docker app should automatic start at Mac boot up and you can invoke the docker desktop and select UNINSTALL).
Thanks so much. Running sudo rm -Rf ~/Library/Group\ Containers/group.com.docker freed up 30GB of space on my machine!
Thanks for the uninstall commands. Like many people probably, I only ended up here because my docker app become completely unresponsive, so I can't have it remove itself.
@Cerniuk works flawlessly!
When I update to MacOS 12 (Monterey) Docker Desktop crashed every time. I tried to uninstall and downgrade with any success. With this uninstall now I have Docker again, thanks!
|
130

By command line

INSTALL

Install with

brew install --cask docker

And run docker by

open /Applications/Docker.app

(or by macOs bottom menu> launchpad > docker - on first run docker will ask you about password)

Thats all :)

UNINSTALL

Type brew uninstall --cask docker

  • thats all :)

To clean everything (including images/containers) execute below commands:

sudo rm -Rf /Applications/Docker
sudo rm -f /usr/local/bin/docker
sudo rm -f /usr/local/bin/docker-machine
sudo rm -f /usr/local/bin/docker-compose
sudo rm -f /usr/local/bin/docker-credential-osxkeychain
sudo rm -Rf ~/.docker
sudo rm -Rf $HOME/Library/Containers/com.docker.docker  # here we delete stored images

7 Comments

Try also: brew cask zap docker
I like this answer for the most part, but having trouble: brew install brew-cask Error: No available formula with the name "brew-cask"
@Marcus may be this will help: github.com/Homebrew/homebrew-cask/issues/6179
As of Homebrew 2.7, brew cask install was deleted. Instead use brew install --cask docker
As of April 2021, /Applications/Docker has become /Applications/Docker.app for uninstalltion. Thank you for sharing this solutiuon!
|
22

To install: brew install --cask docker

To uninstall: brew uninstall --cask docker

2 Comments

You still have to start the Docker Desktop application to get docker running, but this is the easiest way to install/uninstall
15

Uninstall

After following the uninstall step in Cerniuk's excellent answer, I found that I still had some files remaining on my MacOS Sonoma 14.1.1 that could be deleted:

sudo rm -Rfv /usr/local/bin/docker-index
sudo rm -Rfv /private/var/run/docker.sock
sudo rm -Rfv /private/var/root/Library/Containers/com.docker.docker
sudo rm -Rfv /Library/PrivilegedHelperTools/com.docker.socket
sudo rm -Rfv /Library/Logs/DiagnosticReports/com.docker.backend_*
sudo rm -Rfv /Library/LaunchDaemons/com.docker.socket.plist
sudo rm -Rfv ~/Library/Application Support/com.bugsnag.Bugsnag/com.docker.docker
sudo rm -Rfv ~/Library/Saved Application State/com.electron.dockerdesktop.savedState
sudo rm -Rfv ~/Library/Preferences/com.electron.dockerdesktop.plist
sudo rm -Rfv ~/Library/HTTPStorages/com.docker.docker
sudo rm -Rfv ~/Library/Application Scripts/group.com.docker
sudo rm -Rfv ~/Library/Caches/Docker\ Desktop
sudo rm -Rfv ~/Library/Caches/docker-compose
sudo rm -Rfv ~/Library/Caches/com.docker.docker

1 Comment

It is a never ending hunt. Well done.
0

In my case when I tried to delete Docker Desktop I had to delete the items below as well

sudo rm -f /usr/local/bin/docker-credential-desktop
sudo rm -f /usr/local/bin/docker-credential-ecr-login
sudo rm -f /usr/local/bin/docker-index
sudo rm -f /usr/local/bin/com.docker.cli
sudo rm -f /usr/local/bin/hub-tool

After deleting those items brew install --cask docker worked well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.