Skip to content

Install Docker on MacOS

This chapter covers how to install and configure Docker on macOS.

System Requirements

Docker Desktop for Mac

Apple Silicon (M1/M2/M3/M4):

  • macOS 12.0 (Monterey) or newer
  • At least 4GB RAM

Intel chip:

  • macOS 12.0 (Monterey) or newer
  • At least 4GB RAM

1. Download Docker Desktop

Visit Docker Desktop for Mac and download the .dmg file for your chip:

  • Apple Silicon: Select "Mac with Apple chip"
  • Intel: Select "Mac with Intel chip"

2. Install

Open the .dmg file and drag Docker.app to the Applications folder.

3. Launch Docker Desktop

bash
open /Applications/Docker.app

4. Verify Installation

bash
docker --version
docker run hello-world

Method 2: Using Homebrew

bash
brew install --cask docker
open /Applications/Docker.app

Docker Desktop Settings

Resource Configuration

In "Settings" → "Resources":

SettingRecommendedDescription
CPUs2-4CPU cores allocated to Docker
Memory4-8 GBMemory allocated to Docker
Swap1-2 GBSwap space size
Disk image size60+ GBVirtual disk size

Docker Engine Configuration

In "Settings" → "Docker Engine", edit daemon.json:

json
{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

Common Issues

Apple Silicon Compatibility

Some images may not have ARM64 versions:

bash
# Force x86_64 architecture (via Rosetta 2)
docker run --platform linux/amd64 some-image

Enable "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" in Docker Desktop settings.

Disk Space

bash
docker system prune -a
docker system df

Docker Desktop Won't Start

  • Ensure macOS version meets requirements
  • Try resetting: Settings → Troubleshoot → Reset to factory defaults
  • Delete and reinstall

Uninstall

Manual

bash
rm -rf /Applications/Docker.app
rm -rf ~/Library/Group\ Containers/group.com.docker
rm -rf ~/Library/Containers/com.docker.docker
rm -rf ~/.docker

Using Homebrew

bash
brew uninstall --cask docker

Further Reading

Content is for learning and research only.