---
title: Install MicroK8s on WSL2
description: Canonical makes open source secure, reliable and easy to use, providing
  support for Ubuntu and a portfolio of enterprise-grade technologies. Founded in
  2004, Canonical operates globally with team members in over 80 countries.
url: https://canonical.com/microk8s/docs/install-wsl2?format=md
---

*Submit*

# Install MicroK8s on WSL2

## [Install MicroK8s on WSL2](https://canonical.com/microk8s/docs/install-wsl2?format=md#p-38004-install-microk8s-on-wsl2)

The Windows Subsystem For Linux Version 2 (also known as **WSL2**) supports running Ubuntu with systemd as the init process. This enables running snap (and MicroK8s!) natively on Windows hosts.

1. [**Install WSL2**](https://learn.microsoft.com/en-us/windows/wsl/install) on your machine following the instructions from Microsoft. Ensure that the installation completed successfully. Troubleshooting issues around WSL2 are beyond the scope of this document, but you will find lots of information on the WSL2 link above if you run into problems.
2. **Update WSL to the latest version** and ensure WSL2 is set as the default version:

   ```
   wsl --update
   wsl --set-default-version 2
   ```
3. **Install Ubuntu** and wait for the machine to come up. Configure your username and password for the Ubuntu instance. Below, we choose username `ubuntu`:
4. **Enable systemd** by running the following command in the WSL terminal:

   ```
   echo -e "[boot]\nsystemd=true" | sudo tee /etc/wsl.conf
   ```
5. **Exit the WSL terminal, then restart WSL**.

   ```
   wsl --shutdown
   wsl
   ```

From this point, `systemd` is enabled and snaps should work properly. You can list the installed snaps with

```
sudo snap list
```

6. **Install MicroK8s**.

   ```
   sudo snap install microk8s --classic
   ```
7. **Wait for MicroK8s to start**.

   ```
   sudo microk8s status --wait-ready
   ```

   We can also verify that our node is using the WSL2 kernel with:

   ```
   sudo microk8s kubectl get node -o wide
   ```
8. **Enable services and start using Kubernetes**!

   MicroK8s with a number of powerful addons out of the box. Enable the functionality you want to get started:

   ```
   sudo microk8s enable dns
   sudo microk8s enable storage
   sudo microk8s enable dashboard
   ```

   To access the dashboard, MicroK8s offers a helper command:

   ```
   sudo microk8s dashboard-proxy
   ```

   Open a browser window to the URL shown in the text and use the token to login:

   MicroK8s wraps the `kubectl` binary, and you can use it to interact with the cluster:

   ```
   sudo microk8s kubectl create deploy --image nginx --replicas 3 nginx
   ```

### [What next?](https://canonical.com/microk8s/docs/install-wsl2?format=md#p-38004-what-next)

* Want to experiment with alpha releases of Kubernetes? [See the documentation on setting channels](https://canonical.com/microk8s/docs/setting-snap-channel).
* Need to tweak the Kubernetes configuration? [Find out how to configure the Kubernetes services](https://canonical.com/microk8s/docs/services-and-ports).
* Having problems? Check out our [troubleshooting section](https://canonical.com/microk8s/docs/troubleshooting).
* Love MicroK8s? Want to contribute or suggest a feature? [Give us your feedback](https://canonical.com/microk8s/docs/get-in-touch).

Last updated 3 years ago. [Help improve this document in the forum](https://discuss.kubernetes.io/t/install-microk8s-on-wsl2/22877).
