Back to Blog

Stop Paying for ChatGPT — Self-Host It Free with Open WebUI + Ollama (2026)

By Ayyaz Zafar
Self-host ChatGPT free on your Mac with Open WebUI, Ollama, and Gemma 4 — tutorial 2026

A Free, Fully Offline ChatGPT — Running on Your Mac

Two free open-source tools — Open WebUI and Ollama — give you a ChatGPT-like experience that runs entirely on your machine. Same clean dark UI, same conversation history, same file uploads. No subscription. No API key. No data leaving your computer.

The whole setup takes under ten minutes. Single Docker command, single model pull, done. If you've been paying $20/month for ChatGPT Plus, this video pays for itself in the first month — $240 a year saved, forever.

What This Stack Is

  • Open WebUI — the chat interface. Looks and feels like ChatGPT. Conversation history, file uploads, model picker, a clean dark UI.
  • Ollama — runs the AI model locally on your Mac. Works on both Apple Silicon and Intel Macs.
  • Gemma 4 — Google's open-source model. The smallest variant (gemma4:e2b) is about 7GB and runs on basically any Mac.

Together, they replace ChatGPT, Claude, and Gemini for free. Nothing is sent to a server. Nobody is logging your prompts. Nobody is training on your data.

Prerequisites

Two installs before you start:

Both take ~3 minutes total. Verify they're installed:

docker --version
ollama --version

Step 1: Pull the Gemma 4 Model

Open your terminal and run:

ollama pull gemma4:e2b

This downloads the smallest Gemma 4 variant (~7GB). It runs well on basically any Mac, including older Intel ones.

If your Mac is beefier, you can pull a larger variant for smarter answers:

  • gemma4:e4b — ~9GB
  • gemma4:26b — ~18GB
  • gemma4:31b — ~20GB

Bigger model = smarter answers, slower responses. Start with e2b — you can always pull a larger one later.

When the download finishes, verify the model is on disk:

ollama list

You should see gemma4:e2b in the output.

Step 2: Launch Open WebUI in Docker

This is one Docker command. Copy and paste it:

docker run -d -p 3000:8080 -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://host.docker.internal:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Quick breakdown of what this does:

  • -p 3000:8080 — maps port 3000 on your Mac to port 8080 inside the container (that's how you'll access the UI)
  • -v open-webui:/app/backend/data — keeps your chat history and settings persistent across restarts
  • OLLAMA_BASE_URL=http://host.docker.internal:11434 — tells Open WebUI to connect to the Ollama instance running on your Mac
  • --restart always — auto-launches every time you reboot. Set it once, forget it forever.

Wait ~30 seconds for the image to pull and the container to start. Then verify it's running:

docker ps

You should see open-webui listed as Up.

Step 3: Open the UI and Sign Up

In your browser, go to http://localhost:3000. The first time you load it, you'll be asked to create an account. The first account becomes the admin — that's you. Use any email and password.

This is local — nothing is sent anywhere. The "signup" is just for local user management.

Once signed in, you'll land on the main chat interface. Click the model picker in the top-left and select gemma4:e2b. Open WebUI auto-detects every model in your Ollama install — pull more later, they'll show up here automatically.

Step 4: Verify It Runs Offline (The WiFi-Off Test)

Send a test message to confirm everything's wired up:

write a fun two-line poem about a developer who finally cancelled their ChatGPT subscription

You'll see the response stream in real time, just like ChatGPT.

Now turn your WiFi off (click the WiFi icon in the macOS menu bar → Turn Wi-Fi Off). Send another message:

explain why JSON is better than XML in one sentence

It still works. Your conversations never touch the internet. This is what private AI actually looks like.

Step 5: Upload Your Own Documents (RAG)

This is the feature that makes this better than ChatGPT free. You can upload documents and ask the AI questions about them — it's called RAG (retrieval-augmented generation).

Click the + (paperclip) icon in the chat input. Pick a PDF, Markdown file, or text document. The file uploads as an attachment chip above the input.

Then ask anything about it:

summarize this document in 3 bullet points and tell me the main argument

Gemma 4 reads the document and produces a real summary. ChatGPT free doesn't let you upload files at all. ChatGPT Plus charges $20/month for the privilege. Open WebUI gives it to you free, locally, on documents that never leave your machine.

Confidential contracts. Internal docs. Personal journals. Whatever — the AI reads it, you keep ownership.

Bonus Features Worth Knowing About

  • Conversation history — saved forever in the left sidebar. Click any chat to resume it.
  • Pin chats — right-click a conversation → Pin. Keeps important threads at the top.
  • Memory system — Settings → Personalization. The AI can remember things across sessions.
  • Multi-backend — Settings → Connections. You're not locked to local models. You can also connect ChatGPT, Claude, Gemini, or any OpenAI-compatible API right from the same UI. Use Claude for serious work and local Gemma for everyday questions — switch with one click.

The Cost Comparison

Service Monthly Yearly
ChatGPT Plus $20 $240
Open WebUI + Ollama $0 $0

Both give you chat, file upload, history, multiple models. Open WebUI also gives you full data privacy.

If you only use AI a few times a week, this is a no-brainer. If you use AI daily for serious work, keep your Claude or ChatGPT subscription too — but use this for the everyday stuff and save half your bill.

Useful Links

Share this article