Docker Desktop is the default way to run containers on a Mac. Among other things, you get an installer, a GUI, and a settings window. It is a full desktop app for what is, underneath the UI, a Linux VM running a Docker daemon.
colima runs the same Docker daemon without the app. The daemon runs inside a Lima VM (a Linux virtual machine that colima uses to host the daemon), and you drive it with the same docker CLI you already use every day. This article is the full presentation of the switch from Docker Desktop.
What colima actually is
With colima, you have three layers:
- Lima (lima-vm.io): a macOS tool that runs Linux virtual machines, optimized for container-style development workloads.
- The Docker daemon: the stock
dockerd, running inside that VM, with other container runtimes available as alternatives (Lima's containerd, Kubernetes, Incus). - The docker CLI you already have: colima registers a Docker context (a named connection endpoint), and the
dockerprogram talks to it.
The docker context ls command on a Mac with Docker Desktop shows two entries: default and desktop-linux. After colima starts, there is a third one, named colima. You have to switch to the colima context, using the command:
docker context use colima After that, every docker build, docker run, or docker compose command goes to the same CLI program; only the endpoint behind it is different.
Switching from Docker Desktop
On a clean machine, add the Docker client first, via brew install docker. Install colima using brew install colima, then do:
colima start docker context use colima docker run hello-world Using colima start creates and boots the VM.
If Docker Desktop was running before the switch, quit it first; two daemons cannot both publish the same default socket path. Note that Docker Desktop stays there, and you can come back to it whenever you want, using docker context use desktop-linux.
Running a real web server
The running of the hello-world container proves the plumbing. Let's now use a real web server, with no custom code; the Python image ships a working HTTP server in its standard library, and it can serve a directory of your files. For example, do:
docker run -d --name demo -p 8765:8000 \ -v "$PWD:/srv" \ python:3-slim python -m http.server 8000 --directory /srv That command pulls the image, starts the server detached, publishes its port, and bind-mounts your current directory into the container.
The -p 8765:8000 part is the port forward — the container's port 8000 (the Python standard-library server's listen port) is published on the host's 8765. The -v "$PWD:/srv" option is a bind mount.
To make sense of those things on colima, picture the network as two hops. Inside the Lima VM, containers talk to each other over the VM's internal network. To reach the host (the Mac), traffic has to cross a second boundary: colima's port-forwarding, which is what bridges the VM's network to the host's localhost. The -p 8765:8000 mapping crosses that boundary once. The bind mount crosses a different boundary, the filesystem one.
By default on macOS 13 and later, colima shares your home directory into the VM with virtiofs (colima's default VM type is vz, and Lima pairs vz with virtiofs). The -v "$PWD:/srv" mount then bind-mounts from there into the container.
Curl the server to check:
curl -s localhost:8765 | head -2 This returns:
<!DOCTYPE HTML> <html lang="en"> Also, the curl -s -o /dev/null -w "%{http_code}\n" localhost:8765 command prints 200.
Do additional checks using:
docker logs demo docker ps So it works! Those directory files are served in a container, in about ten seconds.
When you are done, remove the container:
docker rm -f demo One more container: a reverse proxy
Both containers we discussed, hello-world and the Python server, run alone. But real stacks have more than one container, and in everyday's web server hosting situations, we often have containers talking to each other. Caddy, a packaged web server, is the natural fit here; in two lines of configuration, it will reverse-proxy to anything else on the same network.
Below is the real working case: Caddy in front of the Python server, run as a two-service stack with Docker Compose.
The proposed Docker Compose setup, declared as two services of one stack, is as follows:
services: demo: image: python:3-slim command: python -m http.server 8000 --directory /srv working_dir: /srv volumes: - ./:/srv ports: - "8765:8000" web: image: caddy:2 depends_on: - demo ports: - "8080:80" volumes: - ./caddy:/etc/caddy Save that as compose.yaml in the directory you want served (the same place the python -m http.server demo used).
For the Caddy configuration, you need what is called the Caddyfile to live one directory down from that place, in ./caddy/Caddyfile, with the following directive:
:80 { reverse_proxy demo:8000 } (Remember to do a mkdir -p caddy, before saving the Caddyfile.)
Now, you can "compose up" the stack, curl the service, and then teardown when you are done:
docker compose up -d curl -s localhost:8080 | head -2 docker compose down Some details on what is happening here:
- The
docker compose up -dcommand starts both containers detached; the curl reaches Caddy onlocalhost:8080and sees the same directory listing the Python server served on its own, but this time it arrived through two containers. When done,docker compose downstops both and removes the network Compose created for them. - The Caddy configuration's
reverse_proxy demo:8000works because Caddy and the demo container run inside the VM, where they can reach each other directly. The only port crossing colima's port-forwarding layer is the one Caddy publishes (8080); the inner hop from Caddy todemostays on the VM's network.
Also, you can use docker compose exec when you need a running Caddy to pick up config changes without a restart. Change the Caddyfile, then:
docker compose exec -w /etc/caddy web caddy reload In this command line, web is the service name from the compose file, and caddy reload applies the new Caddyfile in place.
As you can see, the behavior with all those compose commands is identical on Docker Desktop and on colima.
Sizing the VM
In colima, the settings window feature you have with Docker Desktop becomes CLI flags. They are set at start time:
colima start --cpu 4 --memory 8 --disk 60 -
--cpu,--memory: the VM's share of the machine. Desktop defaults are not the same as colima's defaults, so adjust the size to what you actually set in Desktop, which you can read in its settings before switching. -
--disk: the VM's disk image size, in GB.
To change any of them later, restart with the new values or edit the generated template directly using colima start --edit, which opens the VM's configuration file in your editor. The flags are conveniences while the template is the source of truth.
What you give up
When you switch, you give up some features or have some costs:
- No more GUI. Everything here is based on
colimacommands and the configuration template. - Desktop's extensions ecosystem. The extension marketplace is Desktop-specific; nothing colima-side replaces it.
- Desktop's settings slider for resource changes. Resizing means a stop and a start with flags (or editing the template), not moving a slider while the daemon runs.
- First-start cost. The initial
colima startcreates the Lima VM and pulls the Linux image; this may take minutes, instead of seconds.
None of these are arguments against colima. It's a trade, and you are choosing the CLI-first configuration of the same engine over the GUI-first one.
This article expands issue #13 of my newsletter, Shellcraft — one piece of terminal craft per week.
