Table of contents

Subscribe to our newsletter.
No spam
100% Great content
Unsubscribe anytime

How to install WSL & Docker on Windows Server 2022

Have you ever wondered if it’s possible to utilize the power of Linux’s development tools on your Windows Server 2022? Or perhaps you’ve maybe needed to deploy Docker applications while running your own Windows cloud instance? While this could seem impossible at a first glance, there is actually a way - by using WSL!

With WSL, short for Windows Subsystem for Linux, in addition to some extra help from the virtualization technology, you can easily install a Linux distribution onto your Windows Server! Not only that, but you can also get Docker and start deploying containers straight onto your server with ease!

In this tutorial, we are going to go over WSL and Docker in more detail, walking you through the installation process for both as well as giving you the minimum hardware requirements so that you can be sure that the software will run on your server.

What are WSL & Docker?

Before we can proceed to the installation and configuration process, it is important to have a look at both WSL and Docker as this will allow us to understand how they work, what their individual features are as well as what we can anticipate throughout the installation process.

WSL - run Linux on your Windows Server without emulation

As we previously mentioned, WSL is a powerful tool that enables you to run a full Linux kernel directly onto your Windows machine without having to use an emulator. This can save a lot of time, effort and help you configure your system much easier, ultimately combining the power and stability of Windows Server 2022 with the development flexibility that originates from Linux.

But what are the benefits to this emulator-less approach? Firstly, you can run any Linux distribution that you choose! This means that it doesn’t matter if you want to go for Ubuntu, CentOS or even newer distros like Rocky, everything is at your fingertips.

This means that if you are already accustomed to using a particular distribution, you can easily get it up and running on your Windows cloud server with zero effort. Additionally, with WSL, you also get access to tools like Bash, Vim and Python directly from the Windows environment!

Secondly, you get the privilege of not having to constantly switch between 2 different operating systems. With WSL you get the ability to share files, launch applications and use Linux software within your Windows server, saving you time, boosting your productivity and making your workflow optimized and efficient.

Docker - containerization & easy application deployment

Docker has been gaining popularity ever since its creation as an application because of its useful features.

With Docker you get the ability to essentially pack together everything a particular application needs in order to run on any machine in one single unit called a container. This container includes all software requirements, prerequisites and libraries meaning that the app will be able to run on any other machine immediately after being deployed without you having to worry about mismatching software versions or missing libraries.

In addition to this portability feature, Docker also supports isolation, meaning that each container can operate in its own isolated environment. This offers better security and prevents resource conflicts.

Not only that but Docker also offers exceptional scalability, allowing you to deploy or retrieve containers depending on your needs, which can be helpful for both big organizations and individual developers, which is why Docker is a go-to option for VPS and VDS servers and some are even looking for cloud servers with a pre-installed Docker application in order to save time and get directly to deploying.

What you need to consider before installing WSL

Before you can proceed to getting both WSL and Docker on your Windows server, it is crucial to check whether your system meets the minimum hardware requirements in terms of resources and configuration options.

Minimum system requirements

In order to get WSL and Docker up and running, it is recommended that your server has a 64-bit CPU that supports virtualization as well as a minimum of 4GB of RAM, while also being equipped with at least 2GB of storage space.

In terms of your Windows Server 2022 version, your system should be with a build of at least 19041 or above in order to meet the compatibility requirements. In this tutorial, we are going to be focusing on installing WSL on Windows Server 2022. For any older versions, you can check out the official Microsoft documentation.

How to install WSL on Windows Server 2022

In order to get WSL up and running, we are going to be using the Windows PowerShell. So, let’s begin!

Setting up WSL with Windows PowerShell

Start by opening up PowerShell and running it as an administrator.

run as administrator

Next, enter the following command and press Enter:

wsl --install

Your distribution will then be downloaded and installed automatically.

wsl install

You will then need to restart your machine for the changes to take effect.

restart after install

After the restart takes place, a terminal window will be opened and the WSL installation will automatically continue.

wsl automatic after restart

Finally, you’d be asked to create your default UNIX (Linux) user. Just enter the desired username and password and you will be able to take full advantage of the Linux environment!

after unix creation

How to configure WSL

When the setup process concludes, you are going to see your Linux distribution appear in the Start menu. You now have to launch it in order to begin the initial configuration.

ubuntu shortcut

IMPORTANT: Your Linux distribution could start downloading some additional components when launched for the first time, meaning that you will need to wait for the download to complete! Do not close any windows and don’t worry if it takes longer to load.

You might want to update all software packages of your Ubuntu operating system, which you can do with the following command:

sudo apt update && sudo apt upgrade

You will be prompted to enter the password for your UNIX (Linux) user.

apt upgrade and update

Afterwards, you will see a list of available upgrades, just enter Y when prompted to continue and install all of them.

during installation

Installing Docker Desktop on Windows

Once you have successfully installed WSL, you can then proceed to setting up Docker Desktop. Start by navigating to the official Docker website. Next, click on the Docker Desktop for Windows button, which is located on the top of the page and your download should begin momentarily.

download docker desktop

Once downloaded, double-click on the Docker Desktop Installer.exe file to run the installer.

IMPORTANT: Make sure to check the Use WSL 2 instead of Hyper-V box before clicking OK.

docker configuration

This will initiate the installation.

installation

When the installation finishes, you will be asked to log out in order for the necessary settings to be applied. Click on the Close and log out button.

close and log out

After logging back in, you will be prompted to finalize the Docker Desktop installation. That’s it! Now you can access the Docker Desktop GUI with the shortcuts from your desktop and Start Menu.

Deploy a Cloud VPS with Docker now!

Configure
Payment methods we accept:
Bitcoin
Lightning Network (Bitcoin)
Credit card
Bank transfer