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
Method 1: Download from Official Website (Recommended)
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.app4. Verify Installation
bash
docker --version
docker run hello-worldMethod 2: Using Homebrew
bash
brew install --cask docker
open /Applications/Docker.appDocker Desktop Settings
Resource Configuration
In "Settings" → "Resources":
| Setting | Recommended | Description |
|---|---|---|
| CPUs | 2-4 | CPU cores allocated to Docker |
| Memory | 4-8 GB | Memory allocated to Docker |
| Swap | 1-2 GB | Swap space size |
| Disk image size | 60+ GB | Virtual 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-imageEnable "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" in Docker Desktop settings.
Disk Space
bash
docker system prune -a
docker system dfDocker 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 ~/.dockerUsing Homebrew
bash
brew uninstall --cask docker