How to Install Ollama on Windows 11 with WSL2 — Full Guide
Last updated 2026-07-13
A tested, no-fluff walkthrough for installing Ollama inside WSL2 on Windows 11, with full NVIDIA and AMD GPU passthrough and a clear verdict on when WSL2 beats the native installer.
By Mohamed Meguedmi · 9 min read
Key Takeaways
- WSL2 is the developer's choice, not the default. The native Windows Ollama installer is faster to set up for casual use. Choose WSL2 when you want a Linux toolchain, Docker Compose, or an environment that mirrors your production servers.
- GPU passthrough is production-ready in 2026. NVIDIA CUDA works out of the box once you install the Windows driver — no driver install inside WSL2. AMD ROCm works but is narrower on supported GPUs.
- You need WSL2, not WSL1. Only WSL2 exposes the GPU to Linux via the
/dev/dxgdevice and the DirectX-CUDA bridge. - Budget VRAM, not RAM. An 8 GB GPU comfortably runs 7B–8B models at Q4_K_M; 24 GB unlocks 32B-class models like Qwen3-Coder 32B Q4_K_M.
- Total time: ~15–20 minutes, most of it spent downloading Ubuntu and the first model.
WSL2 or the native Windows installer? The verdict first
Ollama ships a first-party Windows installer, and for a large share of readers that is the correct answer. It is a signed .exe, it registers a background service, and it detects NVIDIA GPUs with zero configuration. If your only goal is to double-click and chat with a model, stop reading and grab it from ollama.com/download.
WSL2 earns its extra 10 minutes of setup for one reason: parity with Linux production environments. Container tooling, shell scripts, systemd services, Open WebUI via Docker Compose, and CI pipelines all behave identically to a cloud Linux host. The table below is the decision you are actually making.
| Factor | Native Windows installer | WSL2 + Ubuntu 24.04 |
|---|---|---|
| Setup time | ~3 min | ~15–20 min |
| NVIDIA GPU | Automatic | Automatic (Windows driver only) |
| AMD GPU (ROCm) | Limited | Supported on ROCm-capable cards |
| Docker / Open WebUI | Via Docker Desktop | Native, matches prod |
| Linux tooling & scripting | No | Yes |
| Filesystem I/O for models | NTFS | ext4 (faster on the Linux VHDX) |
| Best for | Desktop users, quick tests | Developers, reproducible stacks |
Our recommendation: if you write code against the Ollama API, deploy to Linux, or plan to run Open WebUI, install through WSL2. Everyone else is better served by the native path. The rest of this guide covers the WSL2 route.
Prerequisites and hardware reality check
Ollama's speed is bounded almost entirely by GPU VRAM. System RAM matters only for CPU fallback, which is 10–40× slower. Match your target model to VRAM before you install anything — you can size this precisely with our cost calculator and cross-check throughput on the benchmarks pages.
| GPU VRAM | Comfortable model (Q4_K_M) | Example | Typical tok/s* |
|---|---|---|---|
| 6–8 GB | 7B–8B | Llama 3.1 8B, Qwen2.5 7B | 35–60 |
| 12 GB | 12B–14B | Gemma3 12B, Phi-4 14B | 30–50 |
| 16 GB | up to 22B | Mistral Small 3 24B (tight) | 20–40 |
| 24 GB | 32B | Qwen3-Coder 32B Q4_K_M | 18–30 |
*Indicative single-stream decode on consumer Ada/RDNA3-class GPUs; your numbers vary with quantization and context length.
Software prerequisites:
- Windows 11 (any edition), build 22000 or newer.
- Virtualization enabled in BIOS/UEFI (Intel VT-x / AMD-V) — almost always on by default.
- For NVIDIA: a current Windows Game Ready or Studio driver (R555 or newer recommended). Do not install a Linux GPU driver inside WSL2 — it will break the passthrough.
- For AMD: a ROCm-supported GPU and the matching Adrenalin driver.
Step-by-step: install WSL2 and Ubuntu 24.04
Enable and install WSL2. Open PowerShell as Administrator and run a single command. This enables the required Windows features, installs the WSL2 kernel, and pulls Ubuntu by default.
wsl --installReboot when prompted. Per the Microsoft WSL documentation, this defaults to WSL2 on Windows 11.
Confirm you are on version 2. WSL1 cannot see the GPU.
wsl --list --verboseThe
VERSIONcolumn must read2. If it shows1, convert it:wsl --set-version Ubuntu 2.Install Ubuntu 24.04 explicitly (if it wasn't the default) and create your Linux user.
wsl --install -d Ubuntu-24.04Update the distro. Inside the Ubuntu shell:
sudo apt update && sudo apt upgrade -y
Install Ollama inside WSL2
With Ubuntu running, the install is a single official script. From the WSL2 shell:
curl -fsSL https://ollama.com/install.sh | shThe script detects your architecture, installs the ollama binary to /usr/local/bin, and starts the background server on 127.0.0.1:11434. Verify it responds:
ollama --version
curl http://127.0.0.1:11434The second command should return Ollama is running. Now pull and run your first model — start small to confirm the pipeline before committing to a large download:
ollama run llama3.1:8bIf the model loads and answers a prompt, the base install is complete. The next section makes it fast.
GPU passthrough: NVIDIA CUDA and AMD ROCm
NVIDIA
This is the smooth path. WSL2 exposes the GPU through the /dev/dxg device and a WSL-specific CUDA runtime that ships with the Windows driver. You install nothing GPU-related inside Linux. Confirm the GPU is visible:
nvidia-smiIf nvidia-smi lists your card, Ollama will use it automatically — no flags required. Watch ollama ps after loading a model; a healthy result shows 100% GPU. NVIDIA's own CUDA on WSL user guide is the authoritative reference and reiterates the golden rule: keep the driver on the Windows side only.
AMD
AMD works but the supported-GPU list is narrower. Ollama bundles its own ROCm libraries, so on a supported RDNA2/RDNA3 card it often works after a standard install. If Ollama falls back to CPU, force the target with an override that reports your GPU as a supported gfx version, then restart the server:
export HSA_OVERRIDE_GFX_VERSION=11.0.0
systemctl --user restart ollama # or: ollama serveVerify GPU offload the same way — ollama ps should show a GPU percentage rather than 100% CPU.
Reach Ollama from Windows and add Open WebUI
Because WSL2 forwards localhost, a browser or app on Windows can hit http://localhost:11434 directly — no port mapping needed for local use. To expose Ollama to other machines on your LAN, bind it to all interfaces by setting the host environment variable and restarting:
export OLLAMA_HOST=0.0.0.0:11434
ollama serveBinding to 0.0.0.0 makes the API reachable by anything that can route to your PC. Only do this on trusted networks, and consider a firewall rule scoped to specific source IPs.For a chat UI, Open WebUI is the standard companion. With Docker installed in WSL2, one container connects to the host Ollama:
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
-v open-webui:/app/backend/data \
--name open-webui --restart always \
ghcr.io/open-webui/open-webui:mainOpen http://localhost:3000 in Windows, create the first account, and your local models appear in the dropdown. If you want programmatic access instead, every model you pull is immediately available over the OpenAI-compatible /v1 endpoint — see the guides hub for API integration patterns.
Troubleshooting the errors that waste an afternoon
| Symptom | Cause | Fix |
|---|---|---|
nvidia-smi not found in WSL2 | Old Windows driver, or WSL1 | Update the Windows NVIDIA driver; run wsl --update; confirm VERSION 2 |
Model loads on 100% CPU | GPU not detected / not enough VRAM | Check nvidia-smi; pick a smaller quant; for AMD set HSA_OVERRIDE_GFX_VERSION |
curl: (7) connection refused on 11434 | Server not running | ollama serve in one shell, or systemctl --user start ollama |
| Slow model downloads / TLS errors | Corporate VPN or MTU mismatch | Disconnect VPN to test; lower WSL MTU; retry the ollama pull |
| Out of disk space mid-pull | WSL VHDX default cap | Move the Ollama model dir or expand the WSL virtual disk |
A frequent gotcha: after a Windows update, WSL occasionally loses GPU visibility until you run wsl --shutdown from PowerShell and reopen the distro. If a model that previously ran on GPU suddenly drops to CPU, that shutdown-and-restart is the first thing to try.
Where to go next
Once the stack runs, the real question is which model to serve. VRAM ceilings, coding vs. general reasoning, and context-length needs all push you toward different weights. Browse the model catalog to filter by size and license, and note that every specification and benchmark on BestLLMfor is available through our public API under CC BY 4.0 and via our open-source MCP server, so you can pull model metadata straight into your own tooling.
Frequently asked questions
Is WSL2 faster than the native Windows Ollama build?
Raw inference speed is effectively identical because both use the same GPU through the same Windows driver. WSL2's advantage is ext4 filesystem I/O for model loading and a Linux environment that matches production, not higher tokens per second.
Do I need to install CUDA inside WSL2?
No. For NVIDIA, install only the Windows driver. WSL2 ships a special CUDA runtime that bridges to it. Installing a Linux GPU driver inside the distro will break passthrough — this is the single most common mistake.
Can Windows applications reach Ollama running in WSL2?
Yes. WSL2 forwards localhost, so Windows apps connect to http://localhost:11434 with no extra configuration. To reach it from other machines, bind Ollama to 0.0.0.0 and open the relevant firewall port.
Which GPU do I need to run a 32B model?
Plan for 24 GB of VRAM to run a 32B model like Qwen3-Coder 32B at Q4_K_M comfortably. On 16 GB you are limited to roughly 22B-class weights, and below 12 GB you should stay in the 7B–14B range.
Does AMD GPU acceleration work in WSL2?
Yes, on ROCm-supported cards. Ollama bundles ROCm libraries, and if it falls back to CPU you can often force detection with HSA_OVERRIDE_GFX_VERSION. Support is narrower than NVIDIA's, so confirm your specific GPU is on AMD's ROCm list first.
Conclusion & verdict
WSL2 turns a Windows 11 machine into a Linux-native AI host without dual-booting, and in 2026 GPU passthrough is reliable enough to treat as a first-class deployment target. Choose your path deliberately.
| Your situation | Verdict |
|---|---|
| You just want to chat with a model | Native Windows installer — fastest, zero Linux overhead |
| You build against the Ollama API or deploy to Linux | WSL2 — production parity is worth 15 minutes |
| You want Open WebUI + Docker Compose | WSL2 — native container workflow |
| You have an AMD ROCm-capable GPU | WSL2 — broader acceleration support |
For the developer audience this site serves, WSL2 is the setup we recommend and the one we validate against. Install it once, wire in your GPU, and you have a reproducible local LLM host that behaves exactly like the cloud you deploy to.
For running local LLMs comfortably, an RTX 5070 Ti (16 GB VRAM) is the best value for money.
Amazon Check RTX 5070 Ti price →As an Amazon Associate, BestLLMfor earns from qualifying purchases, at no extra cost to you. It does not influence our independent rankings.