How to easily install and uninstall Docker on macOS
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Docker is a popular platform that allows developers to automate the deployment of applications inside lightweight, portable containers. Operating on macOS differs slightly from other Unix-like or Windows systems due to its unique architecture. This guide will provide step-by-step instructions on how to easily install and uninstall Docker on macOS, as well as some technical insights into its functioning.
Prerequisites
Before getting started, ensure the following:
- macOS 10.14 or newer.
- Administrative access to your Mac.
- Basic familiarity with the command line might be helpful but is not necessary.
Installing Docker on macOS
Step 1: Download Docker Desktop
- Visit the Docker Website: Navigate to the Docker Desktop for Mac page.
- Download Docker Desktop: Click on "Download for Mac" to get the installer package.
Step 2: Install Docker Desktop
- Open the Installer: Double-click the downloaded DMG file (
Docker.dmg). - Move to Applications: Drag the Docker.app icon to your Applications folder.
- Launch Docker: Open Docker from the Applications folder.
- Grant Permissions: You may be prompted to provide your admin password for Docker to complete the installation and configuration process.
Step 3: Complete the Setup
- Docker Initialization: When you first run Docker, it may take a moment to initialize.
- Sign In: You may be prompted to log in with a Docker Hub account or create a new one if you don't have it yet.
- Verify Installation: Open a Terminal and run the command:
This command should return the installed version of Docker if the installation was successful.
Technical Insight
Docker for Mac runs a lightweight virtual machine (VM) using Apple's Hypervisor.framework. This VM encapsulates and runs the Docker containers in an isolated environment.
Uninstalling Docker on macOS
Uninstalling Docker from macOS requires the removal of different Docker-related files and directories.
Step 1: Quit Docker Desktop
- Ensure Docker is Closed: Right-click on the Docker icon in the menu bar and select "Quit Docker Desktop".
Step 2: Remove Docker Application
- Delete Docker App: Drag the Docker.app from the Applications folder to the Trash.
Step 3: Remove Docker Components
For a complete uninstallation, you need to remove associated files:
- Open Terminal: Use the Terminal app and run the following commands:
Optional Step: Remove Docker CLI tools
If you also installed Docker CLI tools via a different method, you might want to remove them as well:
- Remove CLI Tools:
Technical Insight
Uninstalling Docker removes all local Docker data, including containers, images, volumes, and cached data.
Troubleshooting
- Docker Not Starting: Ensure no other VM solutions are interfering.
- Permissions Issues: Try installing with elevated privileges using
sudo.
Conclusion
Installing and uninstalling Docker on macOS is a straightforward process when following these guidelines. Docker provides robust containerization solutions, and understanding how to manage its installation and removal is essential for any developer using macOS.
Summary Table
| Action | Commands/Steps |
| Install Docker | Download from Docker site Drag Docker.app to Applications Open and initialize |
| Verify Installation | Run docker --version in Terminal |
| Uninstall Docker | Quit Docker Desktop Remove Docker.app from Applications Remove associated files |
| Remove CLI Tools | brew remove docker docker-compose |
By following these steps, you can manage Docker's presence on your macOS with confidence. Whether starting from scratch or cleaning up your system, the process is designed to be user-friendly and efficient.
Related reading
- How to edit Docker container files from the host?
- How to edit files in stopped/not starting docker container
- How to enable Network Policies in Docker for Mac with Kubernetes
- How to enable pdo_mysql in the php docker image
- How to enable/disable buildkit in docker?
- How to enter in a Docker container already running with a new TTY
- How to evaluate a dynamic variable in a docker-compose.yml file?
- How to exec into a container and view file if container is in CrashLoopBackOff state

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.