Docker
The Docker module runs Docker Engine as a system service in the VM. It adds the Docker CLI, the Compose plugin and Lazydocker, and lets your VM user run Docker without sudo.
Enable Docker
Add lmx:docker to the modules in limanix.toml:
[nixos]
modules = ["lmx:docker"]Apply the change from your Mac. The update restarts the VM; see Changing a VM.
limanix update --config limanix.tomlRun containers
Check that Docker Engine runs:
docker psThe command lists running containers. An empty list is normal before you start any.
Run lazydocker for a terminal interface to containers, logs, images and volumes. lmx help docker lists the module's commands and common tasks.
Run a Compose project
Share the project's directory with the VM. Then run this in the VM, from the directory that contains the Compose file:
docker compose up -dReach a container from your Mac
docker run -p 8080:80 IMAGE publishes the container's port 80 on port 8080 of the VM. From your Mac, connect to the VM's address and that port. Network shows how to find the address.
Docker manages the firewall rules for published ports itself:
- A published port is reachable without adding it to
network.portsinlimanix.toml. - Removing a port from
network.portsdoes not close a published port. - To keep a port inside the VM, publish it on the loopback address:
docker run -p 127.0.0.1:8080:80 IMAGE.
Compose ports: entries behave the same way. A container started with --network host uses the VM's network directly, and network.ports applies to it as to any other service in the VM. Docker's guides cover port publishing and firewall rules.
Permissions
The module adds your VM user to the docker group. Docker commands then work without sudo.
WARNING
Membership in the docker group is equivalent to root access in the VM.
Versions
| Selector | Docker Engine and CLI | Notes |
|---|---|---|
lmx:docker, lmx:docker-29 | 29.x | Default |
lmx:docker-28 | 28.5.2 | End of life |
Lines marked .x come from the catalog's NixOS package set and get its patch releases with each catalog release. Support status follows Moby's branch maintenance table. The end-of-life line prints a warning when the VM builds: Docker Engine 28.5.2 no longer receives upstream security updates.
Select one line per VM. Two lines stop the build with docker: select one line. Both lines keep containers, images and volumes in the same storage; switching lines does not create a separate Docker environment.
Data and settings
| What | Where |
|---|---|
| Images, containers and volumes | /var/lib/docker on the guest disk |
| Service | docker.service |
| Settings | Standard virtualisation.docker.* NixOS options, in your own module |
The module has no settings of its own. Deleting the VM deletes the guest disk and the Docker volumes on it; see Files and storage.
