DEV Community

chatgptnexus
chatgptnexus

Posted on

How to Completely Uninstall Docker from Mac

Uninstalling Docker from a Mac involves removing the application itself and all associated files. Here are three effective methods to ensure a thorough cleanup:

Method 1: Use Docker's Built-in Uninstaller

Recommended for simplicity:

  1. Open Docker Desktop: Click the 🐳 icon in the menu bar, navigate to Troubleshoot → Uninstall.
    • Confirm the Uninstall by clicking Uninstall.

Alternatively, you can use the terminal:

   /Applications/Docker.app/Contents/MacOS/uninstall
Enter fullscreen mode Exit fullscreen mode
  • If you get a Permission denied error, prepend sudo and enter your password.

Method 2: Manual Removal

For those who prefer a hands-on approach:

Step 1: Stop Docker Processes

  • Quit Docker Desktop.
  • Open Activity Monitor and force-quit any Docker-related processes (Docker, com.docker, com.electron.docker-frontend).

Step 2: Delete Docker Application

  • Drag Docker.app from /Applications to Trash.

Step 3: Remove Residual Files

  • Use the following Terminal commands to clean up Docker's residual files:
sudo rm -rf /usr/local/bin/docker* \
  ~/.docker \
  ~/Library/Containers/com.docker.docker \
  ~/Library/Group\ Containers/group.com.docker \
  ~/Library/Application\ Support/Docker\ Desktop \
  /usr/local/lib/docker \
  ~/Library/Caches/Docker\ Desktop \
  ~/Library/Preferences/com.docker.docker.plist \
  ~/Library/Saved\ Application\ State/com.electron.docker-frontend.savedState
Enter fullscreen mode Exit fullscreen mode

Step 4: Clear Docker Data (Optional)

  • Permanently remove containers, images, and volumes:
docker rm -f $(docker ps -aq)  # Containers
docker rmi -f $(docker images -q)  # Images
docker volume rm $(docker volume ls -q)  # Volumes
Enter fullscreen mode Exit fullscreen mode

Note: This will delete all your Docker data irreversibly.

Method 3: Third-Party Uninstallers

For users who want an automated solution:

  • Use tools like AppCleaner or BuhoCleaner:
    1. Download and launch the uninstaller.
    2. Select Docker for removal.
    3. Empty Trash to complete the uninstallation.

Post-Uninstallation Steps

  • Restart your Mac to ensure all changes are applied.
  • If some files remain, consider granting Full Disk Access to Terminal in System Settings → Privacy & Security.

Troubleshooting

  • Permission Issues: Use sudo with commands or adjust permissions.
  • Unresponsive Docker: Use Activity Monitor to force-quit Docker processes.

By following these steps, you'll remove Docker completely from your Mac, leaving no trace behind. If you decide to reinstall, head over to Docker’s official site for the latest version.

References:


Top comments (0)