Local LLM Deployment · Windows

Local LLM Deployment on Windows: A Practical WSL2 + Ollama Guide (2026)

Windows is the trickiest major platform for local LLMs: native builds lag behind Linux, and most tutorials assume a Mac or a Linux box. This guide shows the setup that actually works on a Windows PC in 2026 — Ollama running inside WSL2 with full NVIDIA GPU acceleration — in about an hour, with fixes for the three problems that catch everyone.

FreeLast tested: 2026-10-22Audience: Windows PC owners with an NVIDIA GPU

Why WSL2, not the native Windows build

Ollama ships a native Windows app, and it works. But the WSL2 route — running the Linux Ollama server inside Windows Subsystem for Linux 2 — has three practical advantages that matter after day one:

If you are on macOS or already run Linux, see our Ollama on Mac and Linux guide instead. The rest of this guide assumes a Windows 10 or 11 machine with an NVIDIA GPU.

Prerequisites: the 5-minute checklist

Before touching the terminal, verify these. Skipping this list is where most failures come from:

Step-by-step: WSL2 + CUDA + Ollama in one session

1. Install WSL2 with Ubuntu

Open PowerShell as administrator and run one command. This installs WSL2 and Ubuntu (default distro):

wsl --install

Reboot when prompted, then launch "Ubuntu" from the Start menu and create your Linux username and password. Confirm you are on WSL version 2:

wsl -l -v

Ubuntu should show VERSION 2. If it shows 1, run wsl --set-version Ubuntu 2 and wait for the conversion.

2. Verify GPU passthrough inside WSL2

Inside the Ubuntu terminal, check that the GPU is visible through the passthrough driver:

nvidia-smi

If you see your GPU name and driver version, passthrough works — no CUDA toolkit install needed for Ollama. (Only install the CUDA toolkit inside WSL2 if you plan to compile tools like llama.cpp from source.)

3. Install Ollama and pull your first model

curl -fsSL https://ollama.com/install.sh | sh ollama pull llama3.1:8b ollama run llama3.1:8b "Explain overfitting in one paragraph."

If the answer streams back at usable speed, your Windows PC is now a working local LLM server. Check GPU offload with ollama ps — it should show the model loaded on GPU.

4. Expose the API to Windows apps

By default Ollama listens only on localhost inside WSL2, which Windows apps cannot reach. Tell it to listen on all interfaces, then restart:

# in WSL2 sudo systemctl edit ollama # add: [Service] Environment="OLLAMA_HOST=0.0.0.0" sudo systemctl restart ollama

From Windows PowerShell, test the connection to the WSL2 IP (or use localhost — WSL2 mirrors it since the 2023 networking update):

# in Windows PowerShell curl http://localhost:11434/api/tags

You now have an OpenAI-compatible API endpoint that any Windows AI app — LibreChat, AnythingLLM, Continue for VS Code — can point at. Set the app's base URL to http://localhost:11434/v1.

Which model fits your VRAM: the 2026 quick table

Quantized (Q4_K_M) models are the sweet spot: roughly 70% of full quality at a fraction of the memory. Match your card to a row and you will not run out of memory mid-generation:

GPU VRAMRecommended quantized modelsGood for
6 GB (RTX 3060 laptop)phi4-mini, qwen2.5:3b, llama3.2:3bChat, summarization, light coding help
8 GB (RTX 4060/3070)llama3.1:8b, qwen2.5:7b, mistral:7bGeneral assistant, RAG, solid coding
12 GB (RTX 4070/3080)qwen2.5:14b, gemma2:9b, deepseek-r1:8bStronger reasoning, longer context
16 GB+ (RTX 4080/4090)qwen2.5:32b, llama3.3:70b (Q3)Near-frontier local quality

Rule of thumb: a Q4_K_M model needs roughly 0.6 GB of VRAM per billion parameters, plus ~1 GB of overhead for context. For a deeper cost-and-hardware breakdown, see our budget hardware model comparison.

The three problems that catch everyone (and their fixes)

Problem 1: WSL2 eats all your RAM

By default WSL2 can consume up to half your system RAM, which slows Windows to a crawl when a model is loaded. Cap it in %USERPROFILE%\.wslconfig (create the file if missing):

[wsl2] memory=10GB processors=8 swap=4GB

Then run wsl --shutdown in PowerShell to apply. With this cap, Windows stays responsive while Ollama holds a model on the GPU.

Problem 2: Windows Firewall blocks LAN access

If you want other devices on your home network (a phone, another PC) to reach Ollama, exposing 0.0.0.0 is not enough — Windows Firewall blocks inbound 11434. Add an inbound rule for port 11434 scoped to your private network only. Never expose this port to the public internet without authentication in front of it.

Problem 3: Ollama does not start after reboot

WSL2 distros do not boot on their own. Two options: keep it simple and launch Ubuntu once after login, or automate it with a Windows Task Scheduler task that runs wsl -d Ubuntu -e sudo systemctl start ollama at logon. Pick the simple route until you know you need it running 24/7.

Related reading

Limits and notes

This guide targets NVIDIA GPUs; AMD and Intel Arc cards can run local models via llama.cpp and ROCm-on-WSL builds, but driver support is rougher and outside this guide's scope. Context windows above 32k tokens on consumer cards get slow regardless of setup — split long documents before sending them. And remember: a local model is private by default, but the moment you open port 11434 to your network, treat it like any other service and firewall it.