---
title: WSL for data scientist
description: Tutorial on how to set up WSL with Ubuntu for a data scientist workstation.
  In 15 minutes you end up with a complete environment with tools and libraries.
url: https://canonical.com/blog/wsl-for-data-scientist?format=md
---

1. [Blog](https://canonical.com/blog)
2. Article

---

[Maciej Mazur](https://canonical.com/blog/author/mamazur "More about Maciej Mazur")

10 December 2021

# WSL for data scientist

[AI](https://canonical.com/blog/tag/ai)
[AI/ML](https://canonical.com/blog/tag/ai-ml)
[Data science](https://canonical.com/blog/tag/data-science)
[Ubuntu WSL](https://canonical.com/blog/tag/ubuntu-wsl)

---

Share the article

#### Windows Subsystem for Linux for data scientists

[Ubuntu](https://ubuntu.com/) is the number one choice for data scientists worldwide. It is also by far the most popular Linux distribution used on public clouds with machine learning offerings. However, we don’t forget about our Windows friends – many of whom had their operating system chosen by corporate IT departments. Windows users can still get all the benefits of using Ubuntu thanks to [Windows Subsystem for Linux](https://ubuntu.com/wsl).

This post will walk you through a complete setup from the new Windows 10 installation to a complete data scientist work environment. The assumption is that you have a laptop / desktop with Windows 10 and NVidia GPU. What we want to achieve is a stack like this:

# Step 1: Install WSL

First, we need to start by installing WSL itself.

Open PowerShell as an Administrator:

Type the following command to enable WSL:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your computer.

After restarting, download and install the WSL 2 Linux kernel from Microsoft for your device architecture:

* [x86\_64 for Intel and AMD devices](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi)
* [arm64 for Snapdragon and other ARM devices](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_arm64.msi)

Finally, we recommend you to set WSL 2 as the default WSL environment:

wsl.exe –set-default-version 2

# Step 2: Install Ubuntu

Download Ubuntu for WSL from the Microsoft Store.

Run Ubuntu from the **Start** menu.

Select a username and password for your administrative user.

Once the Ubuntu installation is complete, we recommend you download and try the new [Windows Terminal](https://www.microsoft.com/store/productId/9N0DX20HK701) for the best Ubuntu on WSL experience.

# Step 3: Install GPU drivers and Docker

Next, install the proper GPU drivers. Depending on your GPU, choose the right package from <https://developer.nvidia.com/cuda/wsl/download>. There is no need to install the driver inside WSL VMs, as they use the driver installed in Windows.

After that, open the Windows terminal, and set up Docker inside your Ubuntu installation:

curl https://get.docker.com | sh

distribution=$(. /etc/os-release;echo $ID$VERSION\_ID)

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add –

curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update

sudo apt-get install -y nvidia-docker2

sudo service docker stop

sudo service docker start

Now, check that everything is working fine by running a benchmark:

docker run –gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark

# Step 4: Install Data Science Stack

After this, install the [Data Science Stack](https://github.com/NVIDIA/data-science-stack):

git clone https://github.com/NVIDIA/data-science-stack

cd data-science-stack

./data-science-stack setup-system

This allows you to now create and run containers with all necessary tools:

./data-science-stack list

./data-science-stack build-container

./data-science-stack run-container

The reverse of build-container is purge-container.

# Step 5: Enjoy!

With everything set up, youcan now go to <http://localhost:8888/> and enjoy the Jupyter notebook and full power of Linux CLI.

You can try this, for example, with HP Z series laptops, which come with a [pre-setup environment](https://press.hp.com/us/en/press-releases/2021/hp-powers-real-time-collaboration-workflows.html) so that you can start working just after the first boot of your new machine.

# What’s next

There are many more reasons why Ubuntu is the de-facto standard operating system for data science. You can find them all on <https://ubuntu.com/ai>

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical.com/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### Securing AI agent workflows on Ubuntu with the new NVIDIA OpenShell snap](https://canonical.com/blog/nvidia-openshell-ubuntu-announcement)

By packaging OpenShell as a snap, Canonical is enabling enterprises to confidently run next-generation agentic workflows across local devices, hybrid environments, and private clouds.

[Canonical](https://canonical.com/blog/author/canonical)

1 June 2026

[### Canonical joins the Open Secure AI Alliance](https://canonical.com/blog/open-secure-ai-alliance)

Canonical is now part of the Open Secure AI Alliance, announced by NVIDIA with partners across cloud computing, cybersecurity, enterprise software, open source foundations, and...

[Canonical](https://canonical.com/blog/author/canonical)

28 August 2026

[### Arduino® VENTUNO™ Q is available for pre-order with Ubuntu pre-installed](https://canonical.com/blog/arduino-ventuno-q-is-available-for-pre-order-with-ubuntu-pre-installed)

London, UK – August 25, 2026 – Following our initial collaboration announcement in March 2026, Canonical and Arduino (a subsidiary of Qualcomm Technologies, Inc.) are excited...

[Canonical](https://canonical.com/blog/author/canonical)

25 August 2026

[### A look into Ubuntu Core 26: Building a local AI inference appliance in a virtual machine](https://canonical.com/blog/ubuntu-core-26-ai-box)

Welcome to this blog series which explores innovative uses of Ubuntu Core. Throughout this series, Canonical’s Engineers will show what you can build with this Core 26 release,...

[Gabriel Aguiar Noury](https://canonical.com/blog/author/g-aguiar-noury)

16 June 2026
