How to Install Open WebUI with Docker on Linux

Tested on: Ubuntu 26.04 LTS, Debian 12 — Docker 27.x — Last updated: June 2026
Open WebUI is a self-hosted ChatGPT-like interface for local LLMs. It connects to your local Ollama instance and runs entirely in your browser — no data leaves your machine. This guide installs it with Docker in under five minutes.
- Prerequisites
- Step 1 — Install Docker (if not installed)
- Step 2 — Run Open WebUI with Docker
- Step 3 — Connect to Ollama
- Step 4 — Install with Docker Compose (recommended)
- Step 5 — Enable NVIDIA GPU Acceleration (Optional)
- Step 6 — Expose Open WebUI Over HTTPS with Nginx
- Managing the Container
- Configure Open WebUI
- Connect External LLM APIs
- Chat with Documents (RAG)
- Backup and Restore
- Troubleshooting
- What to Do Next
- Recommended Models by Use Case
- Image Generation with Open WebUI
Prerequisites
- Docker installed and running (
docker --versionto verify) - Ollama running locally on port 11434 (see our Ollama installation guide)
- At least one model pulled:
ollama pull llama3.2:3b
Step 1 — Install Docker (if not installed)
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker jm
# Log out and back in to apply group changesStep 2 — Run Open WebUI with Docker
One command starts Open WebUI and connects it to your local Ollama:
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:mainOpen http://localhost:3000 in your browser. On first launch, create an admin account.
Step 3 — Connect to Ollama
Open WebUI auto-detects Ollama at http://host.docker.internal:11434. If models do not appear, go to Settings → Connections and set the Ollama API URL to:
http://host.docker.internal:11434Step 4 — Install with Docker Compose (recommended)
For a more maintainable setup, use Docker Compose. Create docker-compose.yml:
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
restart: always
ports:
- 3000:8080
extra_hosts:
- host.docker.internal:host-gateway
volumes:
- open-webui:/app/backend/data
volumes:
open-webui:docker compose up -dStep 5 — Enable NVIDIA GPU Acceleration (Optional)
By default, Open WebUI does not pass GPU resources to the container. If you have an NVIDIA GPU, use the CUDA image variant and add --gpus all to speed up inference through Ollama:
docker run -d
-p 3000:8080
--gpus all
--add-host=host.docker.internal:host-gateway
-v open-webui:/app/backend/data
--name open-webui
--restart always
ghcr.io/open-webui/open-webui:cudaFor Docker Compose, add the deploy block to the service definition:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]This requires the NVIDIA Container Toolkit installed on the host. Verify the GPU is visible inside the container after starting it:
docker exec open-webui nvidia-smiStep 6 — Expose Open WebUI Over HTTPS with Nginx
Running on localhost:3000 is fine for a single machine. To access Open WebUI from another device or share it with your team, set up Nginx as a reverse proxy with a Let's Encrypt SSL certificate.
sudo apt install nginx certbot python3-certbot-nginxCreate /etc/nginx/sites-available/openwebui:
server {
listen 80;
server_name webui.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 3600s;
client_max_body_size 100M;
}
}sudo ln -s /etc/nginx/sites-available/openwebui /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d webui.yourdomain.comOpen WebUI is now at https://webui.yourdomain.com. The proxy_read_timeout 3600s prevents long LLM responses from timing out. The client_max_body_size 100M allows uploading large documents for RAG.
Managing the Container
# Check status
docker ps | grep open-webui
# View logs
docker logs open-webui -f
# Update to latest version
docker pull ghcr.io/open-webui/open-webui:main
docker compose up -d --force-recreate
# Stop
docker compose downConfigure Open WebUI
After the first login, go to Admin Panel → Settings to secure and customize your instance:
- Disable public signup: Settings → General → toggle off Enable New Sign Ups. Prevents anyone who finds the URL from creating an account.
- Require admin approval: Admin Panel → Settings → Default User Role → set to Pending. New registrations are held until you approve them manually.
- Default system prompt: Settings → Interface → Default System Prompt. Sets a base persona for every new conversation.
- Pull models from the UI: Models → pull icon → type any Ollama model tag (e.g.
qwen2.5:7b,mistral:7b). No terminal needed after initial setup.
Connect External LLM APIs
Open WebUI can route requests to external providers alongside your local Ollama models. Go to Admin Panel → Settings → Connections:
- OpenAI: set API Base URL to
https://api.openai.com/v1and paste your API key. GPT-4o and o1 appear in the model picker next to local models. - Groq (free, fast inference): API Base URL
https://api.groq.com/openai/v1and a Groq API key fromconsole.groq.com. Gives you Llama 3.3 70B at ~800 tokens/second for free. - Anthropic Claude: not natively supported as an OpenAI-compatible endpoint. Run a local proxy like LiteLLM to expose Claude via an OpenAI-compatible URL, then point Open WebUI at the proxy.
Switching between local and remote models happens in the model picker at the top of each chat — no settings change needed per conversation.
Chat with Documents (RAG)
Open WebUI includes built-in RAG (Retrieval-Augmented Generation). Upload PDFs, Word files, or plain text and ask questions about them using any loaded model. Documents are chunked and embedded locally — nothing leaves your machine.
Upload a file for a single chat: click the + icon next to the message input, select a file, and Open WebUI embeds it automatically as context for your questions.
Create a persistent knowledge base (reusable across chats):
- Go to Workspace → Knowledge → Create
- Upload one or more documents to the collection
- Reference it in any chat with
#collection-name
The default embedding model is nomic-embed-text via Ollama. Pull it before using RAG:
ollama pull nomic-embed-textBackup and Restore
All Open WebUI data — conversations, users, settings, uploaded documents — lives in the open-webui Docker volume. Export it to a single archive:
# Backup
docker run --rm
-v open-webui:/source
-v $(pwd):/backup
alpine tar czf /backup/open-webui-backup.tar.gz -C /source .
# Restore (stop the container first)
docker compose down
docker run --rm
-v open-webui:/target
-v $(pwd):/backup
alpine tar xzf /backup/open-webui-backup.tar.gz -C /target
docker compose up -dSchedule this as a cron job to run nightly if the instance is shared or contains important documents.
Troubleshooting
No models appear in the interface
Ollama is not reachable from inside the container. Verify Ollama is running and confirm the connection URL in Settings → Connections. Also check that the container started with --add-host=host.docker.internal:host-gateway.
Port 3000 already in use
# Use a different port
docker run -d -p 8080:8080 ...Container exits immediately
docker logs open-webui --tail 50The most common cause is a volume permission issue. Remove the volume and recreate: docker volume rm open-webui then run again.
Cannot access Open WebUI from another device on the LAN
Docker binds to all interfaces by default. If a device on the same network cannot reach it, the firewall is likely blocking the port:
sudo ufw allow 3000/tcp
# Confirm Docker is listening on all interfaces
ss -tlnp | grep 3000RAG documents not being indexed
The embedding model must be available in Ollama. Check whether it is installed:
ollama list | grep embedIf nomic-embed-text is missing, pull it with ollama pull nomic-embed-text. Then go to Admin Panel → Documents and re-index your existing documents.
Cannot connect to external API (OpenAI, Groq)
Verify the API base URL ends in /v1. Test the key directly from the terminal before troubleshooting Open WebUI settings:
curl https://api.openai.com/v1/models
-H "Authorization: Bearer YOUR_API_KEY"If curl succeeds but Open WebUI fails, the key was likely entered with a leading or trailing space. Clear the field and retype it manually in the settings panel.
What to Do Next
You now have a private, self-hosted ChatGPT running entirely on your machine. From Open WebUI you can manage multiple models, create custom system prompts, use document RAG, and connect to remote APIs like Claude or OpenAI if needed — without your data ever leaving your machine by default.
Recommended Models by Use Case
Once Open WebUI is running, pull models from Ollama directly from the interface or the terminal. These are solid starting points that run on consumer hardware:
- General chat and writing:
llama3.2:3b(fast, 2 GB VRAM) orllama3.1:8b(better quality, 5 GB VRAM) - Code generation:
qwen2.5-coder:7bordeepseek-coder-v2:16b— both outperform GPT-3.5 on coding benchmarks - Long documents and RAG:
mistral:7b— handles 32K context, good at following instructions over long text - Fast on low VRAM:
phi3.5:3.8b— runs on 2 GB, noticeably faster than Llama 3.2 3B - Multilingual:
qwen2.5:7b— strong in Spanish, German, French and Chinese alongside English
Pull any model from within Open WebUI: go to Models in the left sidebar, click the cloud icon, and type the model tag. No terminal needed once Open WebUI is running.
Image Generation with Open WebUI
Open WebUI integrates with AUTOMATIC1111 and ComfyUI for text-to-image generation directly from the chat interface.
Start AUTOMATIC1111 with the API flag enabled:
./webui.sh --api --listenThen in Open WebUI go to Admin Panel → Settings → Images, set the engine to AUTOMATIC1111, and set the base URL to http://localhost:7860. After saving, a camera icon appears in the chat input. Type an image description and generate it without leaving the interface — the result appears inline in the conversation.
