Set up Colima on macOS
This guide sets up Docker-compatible local containers on an Apple Silicon Mac without Docker Desktop. It uses:
- Docker CLI for the
docker,docker compose, anddocker buildxcommands - Colima for the local Docker Engine replacement
- macOS Virtualization.Framework (
vz) instead of QEMU for the VM - Rosetta for faster
linux/amd64containers and builds on Apple Silicon brew servicesso Colima starts through macOSlaunchd
Use this setup for NJIA development unless a project has a specific reason to do something else.
Before you begin
Section titled “Before you begin”Confirm you have:
- An Apple Silicon Mac
- macOS 26 or newer
- Homebrew installed
- Admin access for installing Rosetta
If you already use Colima and want to wipe it clean first, skip to Switch an existing Colima setup.
Install Colima and Docker CLI tools
Section titled “Install Colima and Docker CLI tools”Install Colima, Docker CLI, Docker Compose, and Buildx:
brew install colima docker docker-compose docker-buildxDocker CLI plugins installed by Homebrew live outside Docker’s default plugin directory. Tell Docker where to find them:
mkdir -p ~/.dockercat > ~/.docker/config.json <<EOF{ "cliPluginsExtraDirs": [ "$(brew --prefix)/lib/docker/cli-plugins" ]}EOFIf you already have ~/.docker/config.json, do not overwrite it blindly. Add
the cliPluginsExtraDirs setting to the existing JSON instead.
Verify the CLI tools are available:
docker --versiondocker compose versiondocker buildx versionIf docker buildx version fails, add Buildx to Docker’s user plugin directory:
mkdir -p ~/.docker/cli-pluginsln -sfn "$(brew --prefix)/opt/docker-buildx/bin/docker-buildx" \ ~/.docker/cli-plugins/docker-buildxdocker buildx versionInstall Rosetta
Section titled “Install Rosetta”Rosetta lets Apple Silicon Macs run Intel binaries. Colima can use it inside an
ARM Linux VM for linux/amd64 containers.
Check whether Rosetta is already installed:
pkgutil --pkg-info com.apple.pkg.RosettaUpdateAutoIf that command says no receipt was found, install Rosetta:
/usr/sbin/softwareupdate --install-rosetta --agree-to-licenseStart Colima manually first
Section titled “Start Colima manually first”Do the first start manually. This creates the Colima profile and lets you verify
the VM before brew services manages it.
brew services stop colima
colima start \ --vm-type vz \ --vz-rosetta \ --mount-type virtiofs \ --arch aarch64 \ --cpu 8 \ --memory 16 \ --disk 256 \ --runtime dockerIf Homebrew says the service was not started, that is fine. The goal is to make
sure launchd is not supervising Colima during the first manual start.
This creates a native ARM VM with:
- 8 CPUs
- 16 GiB memory
- 256 GiB disk
- Docker runtime
- VZ virtualization
- VirtioFS file sharing
- Rosetta-enabled
linux/amd64support
Verify the manual start
Section titled “Verify the manual start”Check Colima:
colima statusYou should see:
macOS Virtualization.Frameworkarch: aarch64runtime: dockermountType: virtiofs
Check Docker:
docker context lsdocker system dfThe active Docker context should be colima.
Check linux/amd64 container execution:
docker run --rm --platform linux/amd64 alpine uname -mThe output should be:
x86_64Check linux/amd64 Buildx builds:
printf 'FROM alpine\nRUN uname -m\n' | \ docker buildx build \ --platform linux/amd64 \ --progress=plain \ -t colima-amd64-smoke \ -Look for x86_64 in the build output. Then clean up the smoke-test image and
cache:
docker system prune -a --volumes -fStart Colima with Homebrew services
Section titled “Start Colima with Homebrew services”Once the manual start works, stop Colima and hand it to Homebrew services:
colima stopbrew services start colimaHomebrew creates a per-user launchd agent for Colima. Verify the service:
brew services listcolima statusdocker context lsbrew services list should show colima as started, and colima status
should still show VZ, aarch64, Docker, and virtiofs.
Switch an existing Colima setup
Section titled “Switch an existing Colima setup”Capture your current settings:
colima listsed -n '1,240p' ~/.colima/default/colima.yamlStop the Homebrew service before making changes:
brew services stop colimaStart Colima manually if it is not already running. This gives Docker a chance to delete objects before the VM is removed:
colima startRemove all containers:
docker ps -aq | while read -r container_id; do docker rm -f "$container_id"doneRemove images, unused networks, build cache, and volumes:
docker system prune -a --volumes -fdocker volume prune -a -fdocker builder prune -a -fCheck that Docker is empty:
docker system dfdocker image ls -adocker volume lsdocker ps -aStop and delete the old Colima profile:
colima stopcolima delete --forceIf colima list showed more than one profile and those profiles should also be
removed, delete them explicitly:
colima delete --profile <profile-name> --forceInstall Rosetta if needed, then recreate Colima using the preferred setup:
pkgutil --pkg-info com.apple.pkg.RosettaUpdateAuto || \ /usr/sbin/softwareupdate --install-rosetta --agree-to-license
colima start \ --vm-type vz \ --vz-rosetta \ --mount-type virtiofs \ --arch aarch64 \ --cpu 8 \ --memory 16 \ --disk 256 \ --runtime dockerRun the verification steps above. When they pass, hand Colima back to Homebrew services:
colima stopbrew services start colimaTroubleshooting
Section titled “Troubleshooting”brew services says Colima is started, but Docker cannot connect
Section titled “brew services says Colima is started, but Docker cannot connect”Colima may still be booting. Wait a few seconds, then check:
brew services listtail -n 120 "$(brew --prefix)/var/log/colima.log"colima statusIf it does not recover, restart the service:
brew services restart colimaManual Colima and brew services are fighting each other
Section titled “Manual Colima and brew services are fighting each other”Use one owner at a time. Stop the service, stop the manual VM, then choose one start path:
brew services stop colimacolima stopFor manual debugging:
colima startFor normal startup:
brew services start colimaColima will not switch to VZ or Rosetta
Section titled “Colima will not switch to VZ or Rosetta”Some Colima settings are fixed when the VM is created, including arch,
vmType, and mountType. Delete and recreate the profile:
brew services stop colimacolima stopcolima delete --forceThen run the preferred colima start command from this guide.
docker buildx inspect does not list linux/amd64
Section titled “docker buildx inspect does not list linux/amd64”This can happen even when amd64 execution works. First test the actual behavior:
docker run --rm --platform linux/amd64 alpine uname -mIf that returns x86_64, test a build:
printf 'FROM alpine\nRUN uname -m\n' | \ docker buildx build \ --platform linux/amd64 \ --progress=plain \ -t colima-amd64-smoke \ -If both commands return x86_64, the setup is working. You may also see a
Rosetta device in docker buildx inspect --bootstrap, such as
lima-vm.io/rosetta=cached.
Docker Compose or Buildx is missing
Section titled “Docker Compose or Buildx is missing”Confirm Docker can see Homebrew’s CLI plugin directory:
cat ~/.docker/config.jsonls "$(brew --prefix)/lib/docker/cli-plugins"If Buildx is still missing, add the user-level plugin symlink:
mkdir -p ~/.docker/cli-pluginsln -sfn "$(brew --prefix)/opt/docker-buildx/bin/docker-buildx" \ ~/.docker/cli-plugins/docker-buildxRosetta is missing
Section titled “Rosetta is missing”Check the Rosetta package receipt:
pkgutil --pkg-info com.apple.pkg.RosettaUpdateAutoIf no receipt is found, install Rosetta:
/usr/sbin/softwareupdate --install-rosetta --agree-to-licenseThen recreate the Colima profile with --vz-rosetta.