Open WebUI with Ollama gives you a browser-based AI chat app on your own hardware, with chat history, separate user accounts and document search. Ollama runs the models; Open WebUI provides the interface. A phone or laptop on your home network can use both through the same server.
On a Linux server, start with the Docker Compose setup. Open WebUI reaches Ollama over the Docker network, so port 11434 can stay off the LAN. Start with a small model and confirm it responds before adding documents or other users.
What Open WebUI adds on top of Ollama
Ollama is the engine. It downloads open models, runs them on your CPU or GPU and exposes a local API on port 11434. You can chat with it in a terminal, which is how our guide to running AI models locally with Ollama starts. Open WebUI adds separate browser accounts for people sharing that model server.
Open WebUI fills that gap:
- A browser interface with chat history, model switching, markdown and code rendering, usable from any phone or laptop on your network.
- Multiple users with roles, so family members or a small team get their own accounts and chat history.
- Knowledge bases for asking questions across your own PDFs and notes (retrieval-augmented generation, or RAG).
- Model management so you can pull and remove Ollama models without touching a terminal.
- Optional cloud connections, so the same interface can talk to OpenAI-compatible APIs when a local model is not enough.
With a local Ollama model and local document processing, your prompts and files can stay on your server. Check the embedding, search, speech and model connections before uploading private material: enabling a cloud provider or an external tool can send data outside your network.

What you need before you start
- A machine to run models. A laptop or desktop with 16 GB of RAM handles 4B to 9B models comfortably. A supported GPU with enough VRAM can make responses much faster; the model and context length both affect memory use. An always-on home server is ideal if you want the whole household to use it.
- Docker. Docker Desktop on Windows or macOS, or Docker Engine with the Compose plugin on Linux.
- Ollama, installed natively or in Docker. Step 1 covers both.
- Disk space. The standard Open WebUI image is about 1.6 GB, plus several gigabytes per model.
- A terminal and about 20 minutes.
Which model should you start with?
The model decides how good the answers are and how fast they arrive. These are approximate Q4 model-weight sizes from the Ollama library, not total disk or memory requirements. Vision projectors, other components and context add overhead. Test your workload before choosing a larger model.
| Model | Download size | Good for | Starting memory estimate |
|---|---|---|---|
| qwen3.5:4b | 3.3 GB | Fast everyday chat, summaries | 8 GB RAM |
| gemma3:4b | 3.4 GB | General chat, image understanding | 8 GB RAM |
| qwen3.5:9b | 6.6 GB | Better reasoning and writing | 16 GB RAM or 8 GB VRAM |
| gemma4:e4b | 6.6 GB | Another compact model to compare | 16 GB RAM or 8 GB VRAM |
| gemma4:12b | 7.7 GB | Higher quality on a mid-range GPU | 12 GB VRAM recommended |
| gemma4:26b | 16 GB | Larger model; needs more memory | 24 GB VRAM or a large unified-memory Mac |
| nomic-embed-text | Small | Embeddings for document search | Runs alongside a chat model |
Start with a 4B model to confirm everything works, then move up. A model that does not fit in VRAM may run partly on the CPU and respond much more slowly. If you write prompts in Hindi or another Indian language, test a few models side by side, because quality varies a lot between model families.

Step 1: Install Ollama
Pick the option that matches your machine. If Ollama is already installed, skip to Step 2.
Option A: Ollama installed on the host
On Windows and macOS, download the installer from ollama.com. On Linux, the official install script sets up Ollama as a systemd service:
curl -fsSL https://ollama.com/install.sh | shCheck that it is running and pull a first model:
ollama --version
ollama pull qwen3.5:4bOllama listens on 127.0.0.1:11434 by default. Docker Desktop uses host.docker.internal to reach the host. On Linux, a bridge-networked container cannot reach the host’s loopback address. If you need to keep an existing Linux host install, restrict access to port 11434 to your Docker network with the host firewall before changing the bind address. Ollama’s local API has no authentication. If you cannot enforce that restriction, use the Compose setup instead.
sudo systemctl edit ollama.serviceAdd these lines in the editor that opens, then save:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"Reload and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart ollamaAfter restarting Ollama, verify that Open WebUI can connect and that a separate LAN device cannot reach port 11434. Keep that port off your router’s forwarding rules.
Option B: Ollama in Docker
If you prefer everything in containers, the official image works on CPU out of the box:
docker run -d -v ollama:/root/.ollama -p 127.0.0.1:11434:11434 --name ollama ollama/ollamaFor an NVIDIA GPU, install the NVIDIA Container Toolkit first and add --gpus=all to that command. The Docker Compose file in Step 2 shows how to run both containers together, which is the tidier option.
Step 2: Run Open WebUI with Docker
First generate a secret key and keep it somewhere safe. Open WebUI uses it to sign login tokens, and without a fixed key every recreated container logs everyone out.
openssl rand -hex 32Now start Open WebUI, replacing your-secret-key with the value you just generated:
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data -e WEBUI_SECRET_KEY=your-secret-key --name open-webui --restart always ghcr.io/open-webui/open-webui:mainWhat each part does:
-p 3000:8080publishes the app on port 3000 of your machine. Change the left number if 3000 is taken.--add-host=host.docker.internal:host-gatewaylets the container reach an Ollama install running on the host.-v open-webui:/app/backend/datastores chats, users, settings and uploads in a named volume that survives updates. Never run without it.--restart alwaysbrings the container back after a reboot.
Without an OLLAMA_BASE_URL setting, Open WebUI looks for Ollama at http://host.docker.internal:11434, which is exactly where a host install lives.
The Docker Compose version (recommended for servers)
On a home server, a Compose file is easier to update and back up. This example runs Ollama on the CPU and connects Open WebUI to it by container name. GPU access needs additional configuration, such as the NVIDIA Container Toolkit and a GPU reservation on Linux. Docker on macOS does not expose Apple Metal acceleration to the container; run Ollama natively there.
services:
ollama:
image: ollama/ollama
container_name: ollama
volumes:
- ollama:/root/.ollama
restart: unless-stopped
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- WEBUI_SECRET_KEY=your-secret-key
volumes:
- open-webui:/app/backend/data
depends_on:
- ollama
restart: unless-stopped
volumes:
ollama:
open-webui:
name: open-webuiSave it as docker-compose.yml in a new folder and start it:
docker compose up -dIf Ollama runs on the host instead, delete the ollama service and the depends_on lines, remove OLLAMA_BASE_URL, and add extra_hosts: - "host.docker.internal:host-gateway" to the open-webui service. Note that Ollama is not published on a host port in this file, which keeps its API private to the Docker network in the two-container setup. If Ollama runs on the host and listens on all interfaces, host firewall rules must restrict it separately.
Which Open WebUI image tag to use
| Tag | Size | Use it when |
|---|---|---|
:main | About 1.62 GB | Default choice. Includes the bundled speech-to-text and embedding models |
:slim | About 197 MB | Low disk space or slow internet. Extra models download on first use |
:cuda | Larger | NVIDIA GPU for Open WebUI’s own embedding and speech models. Add --gpus all |
:ollama | Larger | All-in-one container that bundles Ollama inside |
:v0.13.3 style | Same as main | Production use where you want to control when upgrades happen |
:main and :latest are rolling tags that change with every release. For a household server that you do not want breaking on its own, pin a version tag and upgrade deliberately.
Step 3: Create the admin account
Open http://localhost:3000, or http://SERVER-IP:3000 from another device on your network. The first screen asks you to create an account.

The first account created on a new instance becomes the administrator automatically, and sign-up closes after that. That makes the first visit important. Complete it straight away, on a private network, before the instance is reachable by anyone else. If you are deploying on a server that might be exposed, you can pre-create the admin with the WEBUI_ADMIN_EMAIL and WEBUI_ADMIN_PASSWORD environment variables on first start instead.
Step 4: Connect Ollama and pull models
If you used the commands above, Open WebUI should already see Ollama. To check, open Admin Panel > Settings > Connections. The Ollama API section should show your URL with a working connection.

Select Manage next to the Ollama connection to pull or delete models without a terminal. Type a model name such as gemma4:e4b and start the download.

You can also type a model name directly into the model selector at the top of a new chat. If the model is not installed yet, Open WebUI offers to pull it from Ollama for you.

Once a model appears in the selector, start a chat. The first reply takes longer because Ollama loads the model into memory. Later replies are faster.
Step 5: Chat with your own documents
Knowledge bases are where Open WebUI earns its place. You can collect bills, manuals, policy documents or study notes into a collection and ask questions across them.
- Go to Workspace > Knowledge and select Create.
- Give the knowledge base a name and description.
- Upload text-based PDFs or text files and wait for processing to finish.
- In a chat, type
#and choose the knowledge base, or attach it to a model under Workspace > Models > Edit. - Ask a question whose answer is in the files and compare the cited passage with the original.

Retrieval settings such as the embedding model, chunk size and the document extraction engine live under Admin Panel > Settings > Documents. For an all-local setup, pull nomic-embed-text in Ollama and select it as the embedding model there, so your documents are indexed on your own hardware.

Scanned PDFs without a text layer are the most common reason a knowledge base seems empty. Run them through OCR first.
Step 6: Add family members or colleagues safely
Open WebUI has three roles: admin, user and pending. By default, a new account created after the first one lands in pending, which means no access until an admin approves it.
To add people:
- Go to Admin Panel > Users and add the account yourself with an email and a temporary password, then ask them to change it, or
- Temporarily enable sign-up, let them register, approve them from the users list, then switch sign-up off again.
Keep the number of admins small. An admin can change connections, see settings and manage every account. For a household, one admin and everyone else as user is the right shape.
Step 7: Reach it from outside your home
The Open WebUI documentation is clear that the app is built for private, trusted networks. It recommends placing it behind a VPN such as WireGuard or Tailscale, a zero-trust access proxy such as Cloudflare Access, or a reverse proxy with authentication, and handling rate limiting at that layer.
For most homes, the simplest secure option is Tailscale. Install it on the server and on your phone, then open http://SERVER-NAME:3000 from anywhere. Nothing is exposed to the public internet. If your broadband sits behind CGNAT, which is common on Indian fibre plans, our guide to accessing a home server behind CGNAT compares Tailscale with Cloudflare Tunnel.
If you do put it behind a domain with Caddy, the official Caddy example is short, because Caddy handles HTTPS certificates and WebSockets automatically:
chat.example.com {
reverse_proxy localhost:3000
}When you serve Open WebUI on a domain, set WEBUI_URL to that address and add every address people use to CORS_ALLOW_ORIGIN, separated by semicolons. Missing origins cause “is not an accepted origin” errors and broken live chat.
Backups and updates
Back up the data volume
Everything Open WebUI knows lives in /app/backend/data inside the container: the webui.db database, uploaded files, the vector database for knowledge bases and a cache. The Open WebUI docs warn against relying on the Database download in the admin panel, because SQLite can hold recent writes in a separate WAL file that the download misses.
The safe approach with Docker Compose is to stop the container briefly and archive the whole volume:
docker compose stop open-webui
docker run --rm -v open-webui:/data -v "$PWD":/backup alpine tar czf /backup/open-webui-backup.tgz -C /data .
docker compose start open-webuiThe Compose file above explicitly names the data volume open-webui, matching the backup command. For an existing installation, run docker volume ls and substitute its actual volume name before backing up. Keep the Compose file and WEBUI_SECRET_KEY with the backup, and copy the archive off the machine. Downloaded Ollama models can be pulled again; preserve any custom model files separately.
Update Open WebUI
With Compose, updating is two commands:
docker compose pull
docker compose up -dIf you pinned a version tag, change the tag in the file first. Read the release notes before a jump between minor versions, since releases such as v0.13.0 can include database migrations.
Troubleshooting
Open WebUI shows no models. Open Admin Panel > Settings > Connections and check the Ollama URL. With a host install on Linux, Ollama must listen on 0.0.0.0 (Step 1) and the container needs the --add-host flag. With the Compose file above, the URL must be http://ollama:11434, not localhost.
“Connection refused” to 127.0.0.1. Inside a container, localhost means the container itself, not your machine. Use host.docker.internal or the Ollama service name. On Linux, an alternative is running the container with --network=host and OLLAMA_BASE_URL=http://127.0.0.1:11434, in which case the UI is on port 8080.
Everyone gets logged out after an update. The container was recreated without a fixed WEBUI_SECRET_KEY. Set one and keep it in the Compose file.
Replies are extremely slow. The model is too large for your VRAM and is running partly on the CPU. Try a smaller model or a lower quantisation, and close other GPU-heavy apps.
Knowledge base answers ignore the documents. Check that processing finished, that the files contain real text rather than scanned images, and that the chat references the knowledge base with #.
Live chat stalls behind a reverse proxy. WebSockets are blocked or the origin is not allowed. Check your proxy configuration and CORS_ALLOW_ORIGIN.
FAQ
Is Open WebUI free?
Yes. Open WebUI is free to self-host at home. Its code is released under the Open WebUI License, which requires keeping the Open WebUI branding, so read the licence terms before you rebrand it or roll it out inside a business.
Does Open WebUI work without an internet connection?
Yes, once the images and models are downloaded. Chat, knowledge bases and user management can run locally with Ollama when their supporting models and document-processing components are local too. Use the :main image if you want the bundled embedding and speech models available offline from the start.
Can I use Open WebUI with ChatGPT or Gemini as well?
Yes. Under Admin Panel > Settings > Connections you can add OpenAI-compatible API connections alongside Ollama, then pick local or cloud models from the same selector. Prompts sent to cloud models leave your network, so keep sensitive documents on local models.
How much RAM do I need for Open WebUI and Ollama?
Open WebUI itself is light. The model is what needs memory. 8 GB of RAM runs 4B models slowly but usefully, 16 GB is comfortable for 7B to 9B models, and a GPU with 8 GB or more of VRAM gives the biggest speed jump.
Can I run Open WebUI on a Raspberry Pi?
Open WebUI runs on 64-bit ARM, but a Pi is too slow for useful model inference. A better pattern is Open WebUI on a small always-on box and Ollama on a desktop or laptop with a GPU, connected over your home network.
Where are my chats stored?
In the open-webui Docker volume, inside the webui.db database alongside uploads and the vector index. Back up that volume together with your deployment settings and secret key. Any cloud connections or external tools you enable have their own data handling.
Should I use the :ollama all-in-one image?
It is convenient for a quick test, but separate containers are easier to update and troubleshoot, and let you upgrade Ollama and Open WebUI independently. For a long-running household setup, use the Compose file with two services.
- SourceOpen WebUI: Quick start
- SourceOpen WebUI: Knowledge
- SourceOpen WebUI: Hardening
- SourceOpen WebUI: Backups
- SourceOllama: Docker
- SourceOllama: Linux install
- SourceOllama: Qwen 3.5 models
- SourceOllama: Gemma 4 models

