Local AI means the AI model runs on your own laptop. An AI model is a program that answers your questions. It does not run on a company’s server.
There are two big reasons this is appealing: privacy and saving money.
Privacy: your chats, questions, and documents never leave your laptop. They are not sent to any server. They are not used to train someone else’s model.
Saving money: the models are open-weight and free. Open-weight means anyone can use the model freely. There is no monthly subscription. All you need is a laptop and electricity.
To be honest: on a potato laptop’s CPU, a small (3B) model answers more slowly than ChatGPT. But for Q&A, summarizing documents, and helping you write, it is fast enough. This tutorial uses Ollama to run the model. Ollama is a program that runs AI models on your laptop. It also uses Open WebUI as its web interface. A web interface is the screen you open in your browser. It looks like ChatGPT, but it runs 100% offline in your browser.
Figure 1: Local AI architecture — browser, Open WebUI, Ollama, and the model, all on your laptop.
What You Need
- A Linux laptop. If yours is old, use a lightweight distro. A distro is a version of Linux. See the tutorial recommending lightweight Linux for old laptops.
- 8 GB of RAM is recommended if you want to use a 3B model. See the table below.
Docker, if you install Open WebUI with Docker. Docker is a program that runs apps inside containers. A container is a closed box holding an app and everything it needs. Or Pythonpipif you prefer to skip Docker. Pip is a tool for installing Python programs.
Step 1: Install Ollama
Install Ollama with a single command. The installer sets Ollama up as a systemd service. A systemd service is a program that runs in the background and stays alive. Its API runs on 127.0.0.1:11434. An API is a door other programs use to talk to Ollama.
curl -fsSL https://ollama.com/install.sh | sh
curl -fsSL https://ollama.com/install.sh | sh
Step 2: Download and Run a Model
Download the qwen2.5:3b model (about 1.9 GB):
ollama pull qwen2.5:3b
ollama pull qwen2.5:3b
Once the download finishes, run it and start chatting in the terminal:
ollama run qwen2.5:3b
ollama run qwen2.5:3b
Other useful commands:
ollama list
ollama ps
ollama rm <model>
ollama list
ollama ps
ollama rm <model>
ollama list shows the models you have downloaded. ollama ps shows the models currently running. ollama rm <model> deletes a model you no longer use.
Pick a Model for Your RAM
Here is the rough rule. A model that is too big for your RAM will run slowly or fail to start.
| Laptop RAM | Model size | Example models |
|---|---|---|
| 2–4 GB | 0.5B–1.5B | qwen2.5:0.5b, llama3.2:1b |
| 8 GB | 3B | qwen2.5:3b (±1.9 GB), llama3.2:3b (±2.0 GB), gemma2:2b |
| 16 GB | 7–8B | qwen2.5:7b, llama3.1:8b, mistral:7b |
Without a GPU, a model still runs on the CPU. A GPU is a graphics card that speeds up AI work. Without a GPU, the model is just slower. Speed depends on your RAM and on how many CPU cores you have. A core is a processing unit inside the CPU.
Figure 2: Install flow — Ollama, model, Open WebUI, then open it in your browser.
Step 3: Install Open WebUI
Open WebUI is a web interface for Ollama. It looks like ChatGPT. There is a chat list on the left. There is a chat column in the middle. You can switch models. If Ollama is on the same machine, run this container:
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
Then open http://localhost:3000 in your browser. The first time you open it, you are asked to create an account. This first account automatically becomes the admin.
Alternative without Docker. If you would rather not use Docker, install it with pip:
pip install open-webui
pip install open-webui
then run it:
open-webui serve
open-webui serve
Open WebUI will run on http://localhost:8080.
Single-container CPU-only alternative. There is also an image that already contains both Ollama and Open WebUI. An image is a ready-to-run package holding an app. This is good for CPU-only setups, with no separate Ollama install:
docker run -d -p 3000:8080 -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
docker run -d -p 3000:8080 -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
Warning — Ollama is not reachable from the container: Ollama binds to
127.0.0.1by default. Bind means Ollama only listens on that address. That means it can only be reached from the laptop itself. The Open WebUI Docker container runs on its own network. So it cannot reach Ollama on the laptop’s localhost. The symptom: Open WebUI shows a “Server Connection Error”. Fix it by letting Ollama listen on all interfaces. An interface is a network path on your laptop. Runsystemctl edit ollamaand add this line in the editor that opens:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Save, then reload and restart Ollama:
systemctl daemon-reload
systemctl restart ollama
systemctl daemon-reload
systemctl restart ollama
Warning: NEVER expose port
11434directly to the internet. A port is a numbered door on your network. Ollama has no authentication. Authentication is a password check before entry. Anyone who finds that port can use your Ollama.
Quick Troubleshooting
- Slow model → use a smaller model, or shrink the context. Context is the amount of text the model remembers while answering.
- Open WebUI shows a “Server Connection Error” → check
OLLAMA_HOST(see the gotcha above).
Where to Go Next
You now have your own private, offline ChatGPT. Two next steps: access this AI from your phone, and turn it into a search engine for your private documents.
- Accessing Local AI from Your Phone via LAN & Cloudflare Tunnel
- Building a Private Document Search Web App (Local RAG) with Open WebUI
Comments