Docker has revolutionized the way developers build, ship, and deploy applications. With containerization, you can create isolated environments that work consistently across different machines. However, learning how to install Docker on Mac can be a bit tricky, especially with the differences between Docker Desktop Mac, Docker CLI, and Apple Silicon compatibility.
In this guide, we’ll walk you through multiple methods to install Docker on Mac, including:
-
Installing Docker using Homebrew
-
Setting up Docker without Docker Desktop
-
Docker Installation via the command line (CLI)
-
Running Docker on Mac M1, M2, and M3
-
Using and Install Docker Compose Mac
By the end of this article, you’ll have a working Docker setup on macOS, whether you’re a beginner or an advanced user.
📌 Want to install Docker on a Windows machine instead? Check out our How to Install Docker on Windows guide.
What Is Docker Hub?
Docker Hub is a cloud-based registry where developers can store, share, and manage Docker container images. It acts as a central repository for pre-built container images, allowing users to pull official images like Ubuntu, Nginx, or MySQL, and push their own custom-built images.
Key Features of Docker Hub:
✅ Public & Private Repositories – Store container images securely.
✅ Automated Builds – Automatically build and update images from GitHub or Bitbucket.
✅ Docker Official Images – Access trusted, verified images from software vendors.
✅ Collaboration & Sharing – Share images with teams or the public.
To use Docker Hub, sign in and pull an image using:
docker login
docker pull ubuntu
This downloads the Ubuntu image to your local system.
Why Use Docker on Mac?
Before diving into the installation steps, let’s explore why Docker is essential:
✅ Consistency Across Environments: Ensures your application runs the same way in development, testing, and production.
✅ Lightweight and Fast: Containers use fewer resources than virtual machines.
✅ Scalability: Easily scale and manage multiple containers with Docker Compose.
✅ Supports DevOps and CI/CD Pipelines: Automates application deployment efficiently.
Docker also integrates well with Kubernetes, making it an ideal choice for modern cloud-based applications.
Prerequisites for Installing Docker on Mac
Before installing Docker, ensure that your Mac meets the following system requirements:
🔹 macOS Version: macOS Monterey (12) or later
🔹 Processor: Intel or Apple Silicon (M1, M2, M3)
🔹 RAM: At least 4GB (8GB recommended)
🔹 Homebrew Installed: Required for Homebrew-based installation
If you don’t have Homebrew, install it using the command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Now, let’s explore different installation methods.
Method 1: How to Install Docker on Mac Using Homebrew
Homebrew is the easiest way to install Docker on macOS.
Step 1: Install Docker on Mac Brew
Open Terminal and run:
brew install --cask docker
This command will download and install Docker Desktop on your Mac.
Step 2: Open Docker
Once installed, launch Docker by running:
open /Applications/Docker.app
Alternatively, search for Docker in the macOS Applications folder and open it.
Step 3: Verify Installation
To check if Docker is installed correctly, run:
docker --version
If the installation is successful, you should see the installed version number.
Step 4: Run a Test Container
Run the following command to check if Docker works:
docker run hello-world
This will download and execute a test container.
Want to learn how to run Docker containers efficiently? Read our How to Run Docker guide.
Method 2: How to Install Docker on Mac Without Docker Desktop
Some developers prefer to install Docker without Docker Desktop due to performance concerns or licensing issues. Here’s how:
Step 1: Install Docker CLI
To install the command-line version of Docker, run:
brew install docker docker-compose
Step 2: Install a Virtual Machine for Docker
Since Docker requires a Linux kernel, you need a lightweight virtual machine like Colima or Lima:
For Intel Macs:
brew install colima
colima start
For Apple Silicon Macs (M1, M2, M3):
brew install lima
limactl start
Step 3: Verify Installation
Run:
docker version
You can now use Docker without the Desktop application.
Curious about Docker Containers? Read our in-depth guide: What Is a Docker Container.
Method 3: How to Install Docker on Mac Using Command Line
If you prefer a manual installation, follow these steps:
Download Docker’s official installation script:
curl -fsSL https://get.docker.com | sh
Verify installation:
docker --version
Start Docker:
dockerd
This method installs Docker CLI without requiring Homebrew.
How to Install Docker Compose on Mac
Docker Compose allows you to run multi-container applications. To install it, run:
brew install docker-compose
To check if it’s installed, use:
docker-compose --version
Learn more about Docker Compose: What Is Docker Compose?
Running Docker on Apple Silicon (M1, M2, M3)
If you're using an Apple Silicon Mac, Docker Desktop provides a native version. Simply follow the Homebrew installation method.
Alternatively, use Colima for CLI-based installations:
brew install colima
colima start
How to Uninstall Docker on Mac
To remove Docker, run:
brew uninstall --cask docker
For a manual uninstall, delete:
rm -rf ~/.docker /usr/local/bin/docker
Need a high-performance server for Docker? Check out our Docker VPS Hosting.
Conclusion
Installing Docker on Mac is simple, whether you use Homebrew, the command line, or prefer a Docker Desktop-free setup. Choose the best method based on your needs and start building containerized applications today!
For more detailed guides, check out:
🔗 How to Install Docker
🔗 How to Install Docker on Windows
🔗 What Is Docker Compose?