Jun 04, 2024 · Local AI / Intermediate · ~3 MIN READ
Local AI with Ollama + WebUI
Run AI models locally with Ollama on Linux or WSL — includes Docker-based Open WebUI setup and a DeepSeek deployment walkthrough.
Introduction
This guide installs Ollama on Linux or Windows (via WSL), pulls and runs models, including general-purpose models like Llama 3 and reasoning models like DeepSeek, and stands up Open WebUI via Docker for a browser-based interface. One setup, multiple model families.
Think of it like keeping a personal assistant in your own house instead of phoning a call center. Everything you tell it stays under your roof, nobody else is listening in.
1) Install Ollama
- Linux: use the install script below.
- Windows: install the native app, or enable WSL and follow the Linux steps inside WSL.
1a) Windows: Enable WSL (One-Time)
$ wsl --install
Reboot if prompted. Then open Terminal and run wsl to enter your Linux distro shell.
1b) Update your Linux environment
$ sudo apt update
$ sudo apt upgrade -y
1c) Install Ollama (Linux/WSL)
$ curl -fsSL https://ollama.com/install.sh | sh
1d) Verify Ollama is running
Open: http://localhost:11434
You should see "Ollama is running".
2) Pull & Run General-Purpose Models
Pull Llama 3 (Meta):
$ ollama pull llama3
Or pull and run immediately:
$ ollama run llama3
Model libraries:
3) Pull & Run DeepSeek Models
Ollama exposes DeepSeek variants in its library. Pull one (replace with your preferred variant if needed):
$ ollama pull deepseek-r1:latest
Then run it:
$ ollama run deepseek-r1
Tip: list available models and tags in the
Ollama Library.
4) Web UI with Docker (Open WebUI)
4a) Install Docker Engine (Ubuntu)
sudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4b) Run Open WebUI container
Connects to your local Ollama at http://127.0.0.1:11434 and exposes the UI on port 8080:
$ sudo docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
4c) Verify container
$ sudo docker ps
4d) Open the Web UI
Open WebUI (http://localhost:8080) ↗
First user you create becomes the SuperAdmin, store those credentials safely.
5) Add More Models to Open WebUI
Pull additional models with Ollama (replace {ai-model}):
$ ollama pull {ai-model}
6) Fine-Tune / Create Custom Models
- In Open WebUI, go to Workspace.
- Click Create a model.
- Name your model and set a tag.
- Add a description and set model params to define behavior.
Wrap-up
One Ollama + Open WebUI setup covers both general-purpose models (Llama 3) and reasoning models (DeepSeek), swap models with ollama pull, no need to rebuild the stack per model family.