This is how I like to install Docker on my workstations.
Choose Environment
Docker runs best on Linux. If using Linux, skip to Install Docker below. If using Windows, read the WSL section first.
I don’t use macOS so cannot advise on installation methods for Docker on macOS. However, Lima, Colima and Rancher Desktop are possible options. See Alternative Docker Installation Methods below.
WSL
On Windows, Docker Engine can be installed inside WSL. This is an alternative to using Docker Desktop (unlike Docker CE, Docker Desktop is not open source).
Install WSL command
You can install everything you need to run WSL with a single command. Open PowerShell in administrator mode by right-clicking and selecting “Run as administrator”, enter the wsl --install command, then restart your machine.
wsl --installThis command will enable the features necessary to run WSL and install the Ubuntu distribution of Linux. (This default distribution can be changed).
Install Docker
1. Install using the official Docker installation script
/bin/sh -c "$(curl -fsSL https://get.docker.com)"2. After the install completes, complete the Linux post-installation steps for Docker Engine by running the following commands
sudo usermod -aG "docker" "${USER}"
newgrp docker
sudo systemctl enable --now docker.service
sudo systemctl enable --now containerd.serviceOptional: Confirm Docker Is Installed
1. Confirm docker is installed and check versions
docker version
docker --version2. Confirm the docker buildx and docker compose plugins are also installed (likely already installed alongside docker)
docker buildx version
docker compose version3. Run a test container
docker run --rm hello-worldAlternative Docker Installation Methods
I do not suggest Docker Desktop as an installation method because it is not open source.
- Manual Install: Follow the steps in Install | Docker Docs according to your distribution.
- Ansible: Use geerlingguy/ansible-role-docker: Ansible Role - Docker.
- Docker on NixOS: Docker - NixOS Wiki.
- Rancher Desktop: Follow Installation | Rancher Desktop Docs.
- Lima: Lima; GitHub - lima-vm/lima: Linux virtual machines, with a focus on running containers.
- Colima: GitHub - abiosoft/colima: Container runtimes on macOS (and Linux) with minimal setup.
Docker Alternatives for Running OCI Containers
All of these tools can run OCI containers (sometimes referred to as “Docker containers”).
Resources
- Install | Docker Docs
- Post-installation steps | Docker Docs
- GitHub - docker/docker-install: Docker installation script
- Install WSL | Microsoft Learn
Featured image by Ian Taylor on Unsplash.





