203

My question is

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

4 Answers 4

332

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 for the Troubleshoot menu (Bomb Icon in older Docker UI)
  4. Select Uninstall

An image of Troubleshoot menu that includes Uninstall button

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

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
11
  • 15
    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
    Mar 6, 2021 at 2:09
  • 4
    Thanks so much. Running sudo rm -Rf ~/Library/Group\ Containers/group.com.docker freed up 30GB of space on my machine! Apr 21, 2021 at 20:11
  • 8
    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. Jun 23, 2021 at 19:35
  • 2
    @Cerniuk works flawlessly!
    – Gaurav
    Oct 20, 2021 at 11:19
  • 4
    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! Oct 29, 2021 at 11:54
102

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 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
    Apr 25, 2019 at 20:18
  • @Marcus may be this will help: github.com/Homebrew/homebrew-cask/issues/6179 Apr 25, 2019 at 20:31
  • 13
    As of Homebrew 2.7, brew cask install was deleted. Instead use brew install --cask docker 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
    Apr 14, 2021 at 16:09
20

To install: brew install --cask docker

To uninstall: brew uninstall --cask docker

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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