Sep 28, 2021

Replace Docker Desktop with Multipass

Replace Docker Desktop with Multipass

Why

Because Docker Desktop is taking a lot of resource from my Mac.

Update (2026): Docker Desktop is now free for personal use and small businesses (fewer than 250 employees and less than $10M revenue). If you still want a lighter alternative, OrbStack and Colima are the common choices today. The Multipass approach below still works.

Getting Started

The following steps have been tested on my Intel Macbook w/ 16gb ram.

You need to remove Docker Desktop before starting this tutorial.

Install Multipass & Docker

Multipass is a CLI tool that lets you create and run an Ubuntu VM in a minute.

Require Homebrew installed

brew install multipass docker

Test install

multipass version

multipass  1.7.0+mac
multipassd 1.7.0+mac

(Current Multipass is 1.14+. The output above is from 2021.)

Create Multipass VM

First, create a VM config file docker.yaml

docker.yaml
users:
  - name: ubuntu
    sudo: ALL=(ALL) NOPASSWD:ALL
    ssh_authorized_keys:
      - your-ssh-public-key # replace with the content of ~/.ssh/id_ed25519.pub
package_update: true
packages:
  - avahi-daemon
  - ca-certificates
  - curl
  - gnupg
  - lsb-release
runcmd:
  - curl -fsSL https://get.docker.com | sudo bash
  - sudo systemctl enable docker
  - sudo systemctl restart ssh
  - sudo groupadd docker
  - sudo usermod -aG docker ubuntu

Then run this command to create a Ubuntu VM

multipass launch -c 2 -m 1G -d 5G -n docker lts --cloud-init docker.yaml

lts gives you the current Ubuntu LTS. (The original post used 20.10, which reached end of life in July 2021.)

This will take a few mins to build and start. Once it's done you can see what is running with

multipass list

Connect to VM

SSH into docker VM

ssh ubuntu@docker.local

Make sure you accepted the VM host key and saved your SSH key — this is required for Docker to auto connect to the remote Docker engine.

Also check that docker is installed on the VM by running

docker info

Setup docker host

Add this to your ~/.zprofile to always use this DOCKER_HOST

export DOCKER_HOST="ssh://ubuntu@docker.local"

Apply changes

source ~/.zprofile

Check docker info

docker info

Reference

Tags: