ChatGPT is fantastic until you paste a chunk of your codebase into it and realize you just handed your proprietary code to a third-party server. Open WebUI fixes that tension. It gives you the same polished chat experience — history, markdown, code blocks, even voice — except it runs on your own hardware and talks to models you control. In this guide I’ll show you exactly how to self-host Open WebUI with Docker in under 20 minutes, connect it to Ollama, and bolt on RAG so it can answer questions from your own documents.

What is Open WebUI?

Open WebUI is a self-hosted web interface for AI models. It looks and feels like ChatGPT, but every byte stays on your machine. It began as the frontend for Ollama, and it’s still the fastest way to wrap a friendly chat UI around a local LLM. Under the hood it’s a FastAPI backend with a React frontend, packaged neatly into a single Docker container.

Why self-host Open WebUI?

  • Privacy — your prompts, documents, and chat history never leave your network.
  • Cost — once you own the hardware, unlimited chat costs nothing per token.
  • Control — no rate limits, no censorship surprises, no vendor changing the model under you.
  • Multi-user — share one instance with family or a team, each with their own account and history.

What you need

  • A server or mini PC with Docker and Docker Compose.
  • Ollama installed (or any OpenAI-compatible API).
  • About 20 minutes.

Step 1: Run Ollama (or point at an existing API)

Open WebUI needs a model backend. The simplest option is Ollama running on the same machine. If you haven’t set it up yet, follow the Ollama guide first — it takes minutes. Once Ollama is running, it listens on port 11434.

If you’d rather use a remote OpenAI-compatible API (OpenAI, Groq, a cloud LLM), you can skip Ollama entirely and configure the endpoint later in the admin settings.

Step 2: Create the Docker Compose file

Create a folder and a compose file:

mkdir open-webui && cd open-webui
nano docker-compose.yml

Paste this:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    restart: always
    volumes:
      - open-webui-data:/app/backend/data
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://host.docker.internal:11434
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  open-webui-data:

The extra_hosts line is the trick that lets the container reach Ollama running on your host — no matter whether you’re on Linux, macOS, or Windows.

Step 3: Start it

docker compose up -d

Open your browser at http://your-server-ip:3000. The first account you create becomes the admin.

Step 4: Connect Ollama (per-OS notes)

  • Linux — the compose file above works as-is thanks to host-gateway.
  • macOS / Windows (Docker Desktop) — host.docker.internal resolves automatically; the same file works.
  • Ollama in a separate container — swap the OLLAMA_BASE_URL to your Ollama container name, e.g. http://ollama:11434, and put both on the same Docker network.

Adding RAG: talk to your own documents

One of Open WebUI’s killer features is built-in Retrieval-Augmented Generation. Upload a PDF, a markdown file, or a text doc, and the model will answer questions grounded in that content instead of hallucinating. In the Workspace, create a “Knowledge” collection, upload your files, and reference it with # in any chat. Your private documents never leave the machine.

Open WebUI can also pull live answers from the web. Head to Admin Panel → Settings → Web Search, pick a provider (SearXNG, Google PSE, or others), add the API key, and your chats can browse the internet on demand.

Open WebUI vs ChatGPT vs other self-hosted UIs

Feature Open WebUI ChatGPT Other self-hosted UIs
Data stays local ✅ Yes ❌ No ✅ Usually
Model choice Any Ollama / API Vendor models only Varies
Built-in RAG ✅ Yes Limited Sometimes
Multi-user ✅ Yes Paid Varies
Web search ✅ Configurable ✅ Built-in Sometimes
Setup effort Low (Docker) None Low–high

Common mistakes to avoid

  • Port collision — if 3000 is taken, change the host port (e.g. "8081:8080").
  • Forgetting the volume — without the named volume you’ll lose every chat and uploaded doc on update.
  • Skipping Ollama first — Open WebUI is just a UI; with no model backend it has nothing to chat with.
  • Exposing it raw to the internet — don’t port-forward 3000 blindly. Put it behind Tailscale or a reverse proxy with auth.

Pro tips

  • Use main tag for updates, then docker compose pull && docker compose up -d to upgrade.
  • Back up the volume — open-webui-data holds accounts and history; include it in your regular homelab backups.
  • Try a smaller model first — a 7B model runs comfortably on 8 GB of RAM; start there before pulling a 70B beast.
  • Limit signups — after creating your admin account, disable open registration so random network devices can’t create accounts.

FAQ

Is Open WebUI free? Yes. It’s open source (BSD-3 license), and the self-hosted version costs nothing beyond your own hardware.

Do I need Ollama to use Open WebUI? No. Ollama is the most common backend, but Open WebUI works with any OpenAI-compatible API, including OpenAI, Groq, and vLLM.

Can multiple people use one Open WebUI instance? Yes. Each user gets their own account and private chat history, with role-based permissions you manage as admin.

Is Open WebUI safe to expose to the internet? Not by default. Keep it on your local network or behind a VPN like Tailscale. If you must expose it, add a reverse proxy with HTTPS and authentication.

How much RAM do I need? It depends on the model, not the UI. Open WebUI itself is light; a 7B model wants roughly 8 GB of RAM.

Go build your private ChatGPT

Self-hosting Open WebUI is the fastest way to get a ChatGPT-class experience without handing your data to a third party. It’s a single Docker container, it talks to models you already run with Ollama, and it grows with you — RAG, web search, and multi-user access are all built in.

If you’re new to containers, brush up on Docker basics first. Then grab your server, follow the steps above, and enjoy a private AI assistant that’s genuinely yours.