How to install Docker without Docker Desktop on Windows (2023)

Also, learn how to use Portainer as an alternative Docker GUI

How to install Docker without Docker Desktop on Windows (1)

As a developer who switched from Linux to Windows for many reasons, I've been using Docker Desktop for a few months because it automatically updates my Docker environment.

Unfortunately this is no longer possible and I have to remove Docker Desktop.

Luckily I haven't used Docker Desktop for any commands or functionality other than updating the Docker engine, so this change won't impact my workflow.

Docker has updated itsDocker Desktop License Agreementand enable professional use of Docker Desktop in large organizations without a paid Docker subscription. So if your company has more than 250 employees or more than $10 million in annual revenue, you won't be able to use Docker Desktop without a paid subscription. It remains free for small businesses, personal use, open source projects, and educational purposes.

This license update applies only to Docker Desktop and not to Docker or Docker Engine. This way, you can continue to use Docker for development and all kinds of environments, including production. Normally, this license update will not affect your company's business when working with Docker.

To follow this procedure, you need a WSL2 compatible workstation like Windows 10 version 2004 or later. To check which version is installed, pressWindows-Logo-Key + Rand press Enter to view your system settings. If you don't meet the requirements, update your Windows.

If Docker Desktop is installed, you must uninstall it

(Video) How to install docker in Windows 10 without Docker Destop?

On Windows, the Linux subsystem must be enabled. This can be done by pressing the buttonWindows registry key, type "Turn Windows features on and off" and open it.

How to install Docker without Docker Desktop on Windows (2)

Scroll down and toggle the feature on if it's off.

How to install Docker without Docker Desktop on Windows (3)

Once activated, press OK and restart your computer.

You can also install the Linux subsystem with a PowerShell command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

After configuring the prerequisite, you need to open a PowerShell with administrative privileges and install Ubuntu on WSL2 with the following command:

wsl --set-default-version 2
wsl --install -d Ubuntu

You can also install various Linux submodules in this step.

After the installation is complete, you need to verify that Ubuntu was installed on the correct version:


If everything worked correctly, your Ubuntu should be installed with the appropriate WSL version. If the version is not correct, you can change it with:

(Video) Install Docker in WSL 2 without Docker Desktop

wsl --set-version ubuntu-JJ.MM 2

YY.MM is the version of the version of Ubuntu you recently installed.

To install Docker on Windows within the Ubuntu submodule, you can follow the official steps to install Docker on Ubuntu:

Another option is to create a new file and copy the following script into it. These commands are simply copied from the official tutorial into a file to share with other developers.

Go to your Ubuntu submodule in PowerShell and run the file to install Docker and the required dependencies.

Now you can start and check if everything is working correctly with:

sudo service docker start # Start engine
sudo service docker status # gives good status information
docker run hello-world # Run a test docker container

After the last command finishes, you should see the output of the running Docker image:

If you install Ubuntu as your WSL2 distribution and use at least one based on Ubuntu Hirsute Hippo (21.04), your docker daemon may not start properly.

while trying to walkStauerproduces the following error log:

INFO[2021-09-25T15:06:20.839195000+08:00] Loading containers: Start.
INFO[2021-09-25T15:06:20.885624800+08:00] Stop event flow after graceful shutdown error="<nil>" module=libcontainerd namespace=moby
INFO [2021-09-25T15:06:20.885865900+08:00] Stop integrity check after graceful shutdown module=libcontainerd
INFO[2021-09-25T15:06:20.886012400+08:00] Stop event flow after graceful shutdown Error = "Context aborted" Module = libcontainerd Namespace = plugins.moby
Error starting daemon: Error initializing network driver: Error getting driver instance: Error adding return rule in chain DOCKER-ISOLATION-STAGE-1: (iptables failed: iptables --wait - A DOCKER-ISOLATION-STAGE- 1 -j RETURN : iptables v1.8.7 (nf_tables): RULE_APPEND failed (no such file or directory): rule chain DOCKER-ISOLATION-STAGE-1
(initial state 4))

I realize itiptablesused by Docker is anftablesExecution. This resulted in an error because Ubuntu from version 20.10 changed the firewall system tonftables(You couldread about it on this website). Unfortunately withnftablesnatively requires Linux kernel 5.8, but the latest kernel version for WSL is 5.4.

Fortunately, Ubuntu still has the option of using a legacy version ofiptablescurrently running:

(Video) Docker in WSL WITHOUT windows docker desktop!

$ sudo update-alternatives --config iptablesThere are 2 options for alternate iptables (providing /usr/sbin/iptables).Selection route priority status
-------------------------------------------------- ----------
* 0 /usr/sbin/iptables-nft 20 Auto-Modus
1 /usr/sbin/iptables-legacy 10 Modo-Handbuch
2 /usr/sbin/iptables-nft 20 Modo manual
Press <Enter> to keep the current selection[*] or type the selection number: 1
Upgrade alternatives: Use /usr/sbin/iptables-legacy to mount /usr/sbin/iptables (iptables) in manual mode

After updating theiptablesJust restart the docker daemon and you will find that docker is working properly.

Docker Compose can be installed from within the Ubuntu submodule. Open a PowerShell window and switch to the Ubuntu submodule. Then download the latest version from GitHub:

$ sudo curl -L`name -s`-`name -m` -o /usr/local/bin/docker -compose

Next, grant permissions to run the docker-compose command:

sudo chmod +x /usr/local/bin/docker-compose

You can then test the functionality by running itdocker-compose-versioninside the Ubuntu submodule orwsl docker-compose-versionfrom any PowerShell window.

If you follow the tutorial you should have:

  1. WSL2 Linux subsystem installed
  2. Docker installed and configured on Ubuntu
  3. Docker Compose installed

You can use any Docker command inside your Ubuntu submodule and also inside a PowerShell by prefixing the command with awsl:

wsl docker-compose-version

For convenience, you should be able to use any docker command without addingwslbefore. To achieve this, you can create an alias for your PowerShell.Read about it hereand configure everything.

Then locate your PowerShell profile


and open this file in an editor and paste this content:

function start-wsldocker {
wsl docker $argumente
function home WslDockerCompose {
wsl docker $argumente
Set-Alias-DockerName-Value Home-WslDocker
Set-Alias ​​​​-Name docker-compose -Wert Home-WslDockerCompose

Save the file and restart your PowerShell terminal to test if the alias is working by typing:


If you don't get an error, it's working as expected.

(Video) Docker on windows without docker desktop

To better replace Docker Desktop and have something like a Docker GUI, consider installing Portainer in your local environment.

Portainer is a powerful GUI-based container-as-a-service solution that enables companies to easily and securely manage and deploy cloud-native applications.

With Porttainer you can:

  1. Deploy apps with defined app templates (click to deploy)
  2. Deploy and manage stacks from compose files, including deploying directly from Git
  3. Deploy and manage containers, including the ability to edit a running container
  4. Drag/Push/Create images
  5. create networks
  6. Create/Delete Volumes
  7. View a Docker event log
  8. View Docker Engine (host) information and apply security checks as needed

This Docker Compose file can be used to install Portainer CE as a Docker service that will automatically restart when not running.

# docker-compose.yml
Version: '3'

Picture: portainer/portainer-ce:latest
container_name: portainer
Reboot: unless stopped
Security option:
- no new privileges: true
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./portainer-data:/data
- 9000:9000

Save it in any folder and run it in your PowerShell:

docker-compose up -d

Switch to your browser and open ithttp://localhost:9000.

Time notice:Make sure to log in and create your credentials shortly after Portainer is ready or it will automatically shut down for security reasons. If you didn't create the credentials in time and it shuts down automatically, you need to restart the service.


There are several advantages over the Docker desktop version:

  1. The Docker engine is free. Therefore, upgrading the license is not a problem for your development and production environment.
  2. Portainer is production-ready software for managing your Docker environment, which is also commonly used in a server cluster environment.
  3. You will learn the basics of Docker much faster and acquire more DevOps skills.
  4. Production environments often run on Linux, so your development environment is closer to the production environment.

In contrast

The only downside for me is that you have to manually update it yourself instead of clicking the "OK" button when a new version is available.

(Video) Install Docker on Windows (WSL) without Docker Desktop...Easy steps!!!

Thank you for reading this article!

I hope you enjoyed reading it and now you can install the Docker environment on your Windows host in the Ubuntu submodule. Also, I hope you can now use and install Portainer and Docker Compose on Windows. If it works for you, I'd love to get your feedback in the comments section. If you have any questions, write them down below. I will answer if possible.

This article was published on my blog at

Do you want to connect?If you are interested, please feel free to contact me atmy personal website,blood,LinkedIn, jGitHub!


Is there an alternative to Docker desktop? ›

Rancher Desktop is a Docker Desktop alternative for Mac, Windows, and Linux. It features a built-in GUI and is easy to use. The container runtime used by Kubernetes and Rancher Desktop is similar. Rancher Desktop offers container management for building, pushing, and running containers.

Is it possible to install Docker in Windows? ›

Install Docker Desktop on Windows

If you haven't already downloaded the installer ( Docker Desktop Installer.exe ), you can get it from Docker Hub. It typically downloads to your Downloads folder, or you can run it from the recent downloads bar at the bottom of your web browser.

Can we build Docker image without Docker desktop? ›

Google solves this problem by providing a tool called Kaniko. Kaniko helps you build container images within a container without any access to the Docker daemon. That way, you can execute your build jobs within containers without granting any access to the host filesystem.

Is Docker for Windows the same as Docker desktop? ›

Docker Desktop for Windows is a product meant for running both Linux and Windows containers on Windows. It's not meant for a production environment, and instead is meant for a desktop/client SKU of Windows, hence the Windows 10 requirement. So you could think of this as Docker for Windows 10.

Is Docker free without Docker desktop? ›

It remains free for smaller companies, private use, open-source projects, and educational purposes. This license update is only related to Docker Desktop and not to Docker or the Docker Engine. This enables you to still use Docker for development and all types of environments, including the production ones.

Is Docker free without desktop? ›

Basically, if your company has 250+ employees or makes more than $10 million in annual revenue, you will not be able to use Docker Desktop without the paid subscription. It remains free for smaller companies, private use, educational purposes and open-source projects.


1. Install Docker in WSL2 without Docker Desktop
2. Docker Complete Setup on Windows (With WSL Ubuntu)
(The Codeholic)
3. Free Docker Desktop Alternative For Mac And Windows
(DevOps Toolkit)
4. [Without Docker Desktop] Install Docker Daemon inside WSL2
5. Using Containers without Docker Desktop
(The Pragmatic Programmer)
6. Setup a Windows Development Environment with WSL2, Docker and VSCode
(Steven Koon)


Top Articles
Latest Posts
Article information

Author: Trent Wehner

Last Updated: 09/21/2023

Views: 5951

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.