OllamaBeginner45 min8 sections

Install Ollama on Windows 11 with WSL2 and CUDA

Run local LLMs on Windows 11 the right way, WSL2, the WSL CUDA toolkit, and Ollama with full GPU acceleration. Native installer covered too.

MyAIHardware EditorialUpdated May 20, 2026
Install Ollama on Windows 11 with WSL2 and CUDA

Before you start

  • Windows 11 22H2 or newer (Pro or Home both fine)
  • Administrator account
  • NVIDIA GPU with the latest Game Ready or Studio driver installed
  • At least 25 GB free on C:

Required hardware

  • NVIDIA RTX 4070 or better

    Amazon
  • Samsung 990 Pro NVMe 4TB optional

    Amazon
Step 01

Native vs WSL2, pick the right path

Ollama ships a native Windows installer that uses CUDA directly. It works and is the easiest option for someone who just wants a chatbot. But every other tool in the local-AI ecosystem, vLLM, llama.cpp builds, Hugging Face Transformers, LangChain, runs more cleanly on Linux. Putting Ollama inside WSL2 lets you mix and match these tools without dual-booting.

We will cover both. If you only ever plan to chat with Ollama or use Open WebUI, the native installer is fine. If you plan to do anything with Python AI tooling, and most of this site assumes you will, install via WSL2.

Tip

On the same machine WSL2 Ollama and native Ollama can coexist but they fight for port 11434. Pick one.

Step 02

Option A: Native Windows install (fastest)

Download the OllamaSetup.exe installer from ollama.com. It places ollama in %LOCALAPPDATA%\Programs\Ollama, drops a tray icon, and starts the daemon at login. No reboot required. The native build links against the same NVIDIA driver your games use, so as long as nvidia-smi works in PowerShell you are done.

powershell
# In PowerShell (no need to be admin):
winget install Ollama.Ollama

# Or download manually from https://ollama.com/download/windows

# Verify
ollama --version
ollama pull llama3.1:8b
ollama run llama3.1:8b

winget is the cleanest path. Auto-updates with `winget upgrade`.

Step 03

Option B: Install WSL2 first

If you want the Linux path, enable WSL2 with a single PowerShell command. This installs the WSL feature, the kernel, and Ubuntu 22.04 as your default distro. You need to reboot after this, there is no skipping it. After the reboot, Ubuntu launches automatically and prompts you for a username and password.

powershell
# Run as Administrator
wsl --install -d Ubuntu-22.04

# After reboot, in the Ubuntu window:
sudo apt update && sudo apt upgrade -y
Step 04

Step 2: Install the NVIDIA WSL CUDA toolkit

WSL2 is special, you do NOT install a Linux NVIDIA driver inside it. The Linux side talks to your Windows driver through a passthrough device. What you do need is the CUDA toolkit, which provides the user-mode libraries. NVIDIA ships a WSL-specific package that does not bring its own driver. Use that one.

bash
# Inside Ubuntu WSL
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install -y cuda-toolkit-12-4

# Verify
nvidia-smi

nvidia-smi works inside WSL2 because Windows forwards the driver. No Linux driver install.

Warning

Never run `sudo apt install nvidia-driver-XXX` inside WSL2. It will install incompatible libraries that break the passthrough.

Step 05

Step 3: Install Ollama inside WSL2

Now Ollama installs the same way as on a real Ubuntu box, one curl pipe. The installer's CUDA-detection logic works inside WSL too. After install, ollama serve runs as a systemd service inside WSL. Note: WSL2's systemd integration must be enabled in /etc/wsl.conf, which the Ubuntu-22.04 image ships with already.

bash
curl -fsSL https://ollama.com/install.sh | sh
sudo systemctl enable --now ollama
ollama pull llama3.1:8b
ollama run llama3.1:8b
Step 06

Step 4: Reach Ollama from Windows apps

WSL2 networks live on a virtual switch. By default localhost:11434 in Windows is forwarded into WSL automatically, so an Open WebUI Docker container or a Python script running in Windows can still hit http://localhost:11434. If for some reason that does not work, find your WSL IP with `wsl hostname -I` and use that.

powershell
# From PowerShell, should print model list:
curl http://localhost:11434/api/tags

# If localhost forwarding is broken, get WSL IP:
wsl hostname -I
Step 07

Step 5: Make Ollama start at login (WSL)

By default WSL only runs while you have a terminal open. To keep Ollama running in the background even with no terminal, create a small shortcut that runs wsl -d Ubuntu-22.04 -u root -- service ollama start on user logon. Put it in shell:startup. This is hacky but it is what every WSL Ollama user does, and it costs you ~5 MB of idle RAM.

powershell
# In Windows Run dialog (Win+R), type: shell:startup
# In that folder, create a file ollama-start.bat with these contents:
@echo off
wsl -d Ubuntu-22.04 -u root -- service ollama start
Step 08

Performance note: where models live

By default WSL stores its filesystem inside %USERPROFILE%\AppData\Local\Packages\... on your C: drive. If you have a small SSD and a fat HDD, that bites, a single 70B model is 40 GB. The cleanest fix is to set OLLAMA_MODELS to a path that lives on a Windows drive mounted into WSL, e.g. /mnt/d/ollama-models. Don't use a network drive, model loading reads many gigabytes sequentially and any latency kills startup time.

bash
sudo systemctl edit ollama.service
# Add:
# [Service]
# Environment="OLLAMA_MODELS=/mnt/d/ollama-models"
sudo systemctl daemon-reload
sudo systemctl restart ollama

Tags

#ollama#windows#wsl2#cuda#installation

Stuck? Share your build?

Hundreds of homelabbers are working through these same tutorials in our community. Drop your config, ask the hard question, or show off what you built.

Join the discussion

Stay Ahead of the AI Curve

Get weekly AI hardware news, benchmark updates, and deals in your inbox. Founding-subscriber list, be one of the first.

✓ No spam✓ Weekly digest✓ Unsubscribe anytime