7 mins read
How to install docker on Windows without Docker Desktop? Beginner-Friendly Instruction
What are the alternatives to Docker Desktop for Windows? 3 ways to install Docker: in this article, you will find a step-by-step guide on how to install Docker on Windows without using Docker Desktop.
Intro
The easiest way to install Docker on your device is to use the Docker Desktop installer with WSL installation. For various reasons (such as lack of license for commercial use, the need for emulation on virtual machines, or inconvenience of use), there may be a need to use a different installation method. In this article, I would like to offer you 3 alternative, free, and available for any purpose methods of installing Docker on the Windows operating system. To begin, let's briefly discuss what Docker consists of - its main components:
- Docker Daemon - the main process that manages containers, images, and volumes on the host. It can be running in various installation options, such as WSL, VirtualBox virtual machine, or on a separate host.
- Docker CLI - the command-line interface through which you will interact with the Docker Daemon. It should be installed on your operating system.
Ways to Install Docker on Windows
1. Rancher Desktop
The main and most popular alternative to installing Docker without Docker Desktop is Rancher Desktop. Rancher Desktop is an application for local container and Kubernetes cluster management on your computer, providing a convenient interface for developers. It allows for easy deployment and management of containerized applications, integrating with Docker and Kubernetes tools. The structural diagram of Rancher components is shown in the image below.
As part of the pre-requisites, make sure that:
- Your device has at least 4 CPUs and 8GB RAM.
- You have administrator rights (required for WSL installation during Rancher Desktop setup).
- Hyper-V is enabled. To check this, go to
Settings
->Control Panel
->Programs and Features
->Turn Windows features on or off
. Check ifHyper-V
(orVirtual Machine Platform
) andWindows Subsystem for Linux
(if available) are selected. If not, select them. You will need to restart your device after making these changes. For more information on enabling Hyper-V, refer to the Microsoft documentation.
Installation
To install Rancher Desktop, go to their official website, select your system, and click the "Download" button. Wait for the MSI file to download and run it. Choose a location for the installation and run the installer.
Wait for the installation to finish and launch the program.
On the first run of Rancher Desktop, it will prompt you for installation configuration. Choose the container engine dockerd
, and if you want to install Kubernetes, select it.
Wait for the setup and installation of your WSL. The initial setup with downloading and configuring may take approximately 5-10 minutes. After the WSL setup is complete, you can find two new virtual machines on your system, which can be listed using the command $ wsl -l
:
- rancher-desktop
- rancher-desktop-data
To verify the correctness of the installation, execute the command docker run hello-world
to start a test container. You can also execute the command by connecting directly to the virtual machine using the command rdctl shell
. After a successful launch, you will be able to see your container with an "exit" status on the Containers page in the program interface.
Profit!
2. Minikube
Minikube is a tool for running a single-node Kubernetes cluster on your local machine. It is suitable for development and testing, making it easier to deploy and manage Kubernetes applications. To use the Docker installation method through Minikube, you need to download Docker CLI locally, install Minikube with the Docker daemon running inside it, and set the DOCKER_HOST path in your terminal.
Make sure you have at least 2 CPUs, 2GB RAM, and 20GB of free disk space on your system.
First, download Docker CLI to your device. Download the latest available version of the Docker client from the website https://download.docker.com/win/static/stable/x86_64/, extract the archive, and add the path to the docker
executable to your PATH environment variable.
Next, download and install the latest release of Minikube from the link. After installation, also add the path to minikube.exe
to your PATH environment variable.
Before starting the virtual machine setup in Minikube, you need to decide which driver type you want to install. Minikube supports QEMU, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware Fusion/Workstation. If you want to use Hyper-V, you need to disable the "Virtual Machine Platform" settings as instructed in the previous method. If you want to use VirtualBox, make sure the "Virtual Machine Platform" setting is disabled. Then, download VirtualBox (version 5.2 and above) from the official website.
If you choose to use VirtualBox, set it as the default driver using the command minikube config set driver virtualbox
.
Now, you can start the virtual machine with Minikube by running the command minikube start
. You will see information about the new virtual machine installation process in the output.
* minikube v1.31.2 на Microsoft Windows 10 Home ...
* minikube 1.33.1 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.33.1
* To disable this notice, run: 'minikube config set WantUpdateNotification false'
* Automatically selected the virtualbox driver
* Downloading VM boot image ...
Downloading and setting up the virtual machine may take 5-10 minutes. Subsequent launches will be faster.
After the virtual machine has finished starting, you need to run a command to update the DOCKER_...
variables in your terminal:
For PowerShell: minikube docker-env | Invoke-Expression
For bash emulators: eval $(minikube docker-env)
Now you can use Docker in your terminal. To verify this, run the command docker run hello-world
.
Profit!
3. Any remote dockerd host
You can also run Docker without using Minikube or something else on your computer by connecting to any remote Linux host on which dockerd is up and running.
In order to do this, you need to have the Docker CLI locally, set DOCKER_...
environment variables to point to your host (or use -H
option with value of selected host every time when you are connecting to remote host), and use Docker.
Let's see the setup configuration using a remote Linux host on a virtual machine in VirtualBox by manually creating a virtual machine with the operating system distribution you need.
To do this, follow these steps: 0. Disable "Virtual Machine Platform" (or "Hyper-V"), which we configured for the Rancher Desktop method.
- Install Docker CLI - download the latest available version of the Docker client from the website https://download.docker.com/win/static/stable/x86_64/ and add the executable file
docker
to the PATH. - Download and install Oracle VirtualBox from https://www.virtualbox.org/wiki/Downloads.
- Choose the operating system, download its image, and create a virtual machine with this image. For example, for Ubuntu, visit https://ubuntu.com/download/server.
- Configure port forwarding from the virtual machine to your host. You can do this manually by forwarding ports 2375 and 2376 or by creating a network bridge and network adapter in VirtualBox on the Network tab to forward all ports from the virtual machine.
- Manually install Docker in Linux on the virtual machine in TCP mode using official instructions.
- Set the
DOCKER_HOST
variable on your local machine with the address of your virtual machine and port 2376, for example,tcp://192.168.99.100:2376
. - Now you can use Docker.
Conclusion
Here are three ways to run Docker on the Windows operating system without using Docker Desktop.