Skip to main content
  1. Articles/

Lima and Colima

·
Ro'i Bandel
Author
Ro’i Bandel
Table of Contents
Docker - This article is part of a series.
Part 3: This Article

Today I learned about Lima and Colima, which help run Linux VMs and containers on macOS.

I learned about these tools while writing How To Install Docker. Although I’ve heard about them in the past, I kept forgetting what they were called, which is one reason I am writing about them now.

Lima

Lima launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2).

As this description states, Lima is similar to WSL. When using Windows, I have gotten used to a workflow based around WSL, both for Docker and with Git. I have not used macOS yet but expect to one day get a MacBook as a work laptop, and will have to learn an effective workflow for macOS.

Colima

Colima - container runtimes on macOS (and Linux) with minimal setup.

Differences between Lima and Colima

How does Colima compare to Lima?

Colima is basically a higher level usage of Lima and utilises Lima to provide Docker, Containerd and/or Kubernetes.


“How does Lima relate to Colima?”

Colima is a third-party project that wraps Lima to provide an alternative user experience for launching containers.

The key difference is that Colima launches Docker by default, while Lima launches containerd by default.

It’s worth noting that current versions of Lima also support using Docker as a container runtime, and the same is true the other way: Colima supports using containerd as a container runtime.

Installation

Install Lima

Example
# Homebrew
brew install lima

# MacPorts
sudo port install lima

# Nix
nix-env -i lima

Install Colima

Colima is available on Homebrew, MacPorts, and Nix. Check here for other installation options.

Example
# Homebrew
brew install colima

# MacPorts
sudo port install colima

# Nix
nix-env -iA nixpkgs.colima

Using Docker with Lima and Colima

Docker with Lima

Documentation / Examples / Containers / Docker | Lima

Lima Docker Rootless

limactl start template://docker
export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
docker run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine

Lima Docker Rootful

limactl start template://docker-rootful
export DOCKER_HOST=$(limactl list docker-rootful --format 'unix://{{.Dir}}/sock/docker.sock')
docker run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine

Docker with Colima

Docker client is required for Docker runtime. Installable with brew brew install docker.

You can use the docker client on macOS after colima start with no additional setup.

brew install docker
colima start

Linux Support

Both run on Linux hosts. Lima also supports non-macOS hosts (Linux, NetBSD, etc.) and Colima’s README lists Linux as supported.

There’s less reason to use Lima/Colima on Linux than on macOS, but it may still be useful in certain cases, since it is another way to run VMs on Linux.

Apple Container

After years of mac users using projects such as Lima, Colima and others in order to run containers on macOS, Apple released their own solution a few months ago: Container. This seems like a good solution that likely has good performance. Notably, this solution is not based on Docker, but can nevertheless run OCI containers.


Featured image by Aarom Ore on Unsplash.

Docker - This article is part of a series.
Part 3: This Article

Related

How To Install Docker

·
Step-by-step Docker Engine install on Linux and WSL with post-install steps, verification commands, and alternative container runtime options.

Git Setup for Windows and WSL

·
Configure Git once for both Windows and WSL: install Git and GCM, reuse your .gitconfig, and enable seamless credential handling across environments.

KYAML

·
Today I learned, in Kubernetes v1.34, kubectl will also support a new strict subset of YAML called KYAML.