236

My question is

How to easily install docker to have it available in terminal and how to uninstall docker on osx?

5 Answers 5

348

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

6
  • 23
    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!
    – kip2
    Commented Oct 26, 2020 at 19:08
  • 4
    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/…
    – BrDaHa
    Commented Aug 23, 2022 at 18:44
  • agree with @kip2, this will remove all docker installations and containers
    – GvSharma
    Commented Aug 25, 2022 at 10:39
  • 1
    @BrDaHa That page contains no information on uninstalling.
    – Andrew
    Commented Oct 9, 2022 at 21:15
  • 2
    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.
    – Andrew
    Commented Oct 14, 2022 at 13:16
242

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 as of 27-Dec-2020, type the following into the terminal:

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

sudo rm -Rf /Applications/Docker.app
sudo rm -f /usr/local/bin/docker
sudo rm -f /usr/local/bin/docker-machine
sudo rm -f /usr/local/bin/com.docker.cli
sudo rm -f /usr/local/bin/docker-compose
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/docker-credential-osxkeychain
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 ~/.docker
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
  • 22
    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).
    – punsoca
    Commented Mar 6, 2021 at 2:09
  • 5
    Thanks so much. Running sudo rm -Rf ~/Library/Group\ Containers/group.com.docker freed up 30GB of space on my machine! Commented Apr 21, 2021 at 20:11
  • 11
    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. Commented Jun 23, 2021 at 19:35
  • 3
    @Cerniuk works flawlessly!
    – Gaurav
    Commented Oct 20, 2021 at 11:19
  • 6
    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! Commented Oct 29, 2021 at 11:54
124

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
  • 2
    Try also: brew cask zap docker Commented Feb 7, 2019 at 11:17
  • 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
    Commented Apr 25, 2019 at 20:18
  • @Marcus may be this will help: github.com/Homebrew/homebrew-cask/issues/6179 Commented Apr 25, 2019 at 20:31
  • 13
    As of Homebrew 2.7, brew cask install was deleted. Instead use brew install --cask docker Commented Jan 6, 2021 at 18:49
  • 3
    As of April 2021, /Applications/Docker has become /Applications/Docker.app for uninstalltion. Thank you for sharing this solutiuon!
    – Hiroki
    Commented Apr 14, 2021 at 16:09
22

To install: brew install --cask docker

To uninstall: brew uninstall --cask docker

2
10

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.