Self-Host OpenWebUI: The Ultimate Interface for Your Local AI Models in 15 Minutes
Running AI models locally with Ollama is powerful, but chatting through a terminal isn't exactly user-friendly. OpenWebUI transforms your local LLM setup into a polished, ChatGPT-like experience — complete with conversation history, model management, RAG capabilities, and multi-user support.
In this guide, you'll deploy OpenWebUI with Docker Compose, connect it to Ollama, and have a fully functional AI interface running in under 15 minutes.
Why Self-Host OpenWebUI?
- Privacy-first: Your conversations never leave your server
- No subscriptions: One setup, unlimited users, unlimited chats
- RAG built-in: Upload documents and chat with your files
- Model flexibility: Switch between Llama, Mistral, CodeLlama, and more
- Multi-user: Share with your team or family with granular permissions
Prerequisites
- VPS or homelab server with 2+ CPU cores, 4GB+ RAM (8GB recommended)
- Docker and Docker Compose installed
- Ollama running (optional but recommended — see our Ollama guide)
- A domain pointed to your server (for HTTPS via reverse proxy)
Step 1: Create the Docker Compose File
Create a directory for OpenWebUI and navigate into it:
mkdir -p ~/openwebui && cd ~/openwebui
Create docker-compose.yml:
version: '3.8'
services:
openwebui:
image: ghcr.io/open-webui/open-webui:main
container_name: openwebui
restart: unless-stopped
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://host.docker.internal:11434
- WEBUI_SECRET_KEY=your-secret-key-here-change-me
- ENABLE_SIGNUP=true
- DEFAULT_USER_ROLE=pending
volumes:
- openwebui-data:/app/backend/data
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- ai-network
volumes:
openwebui-data:
networks:
ai-network:
driver: bridge
Step 2: Configure Environment Variables
Create a .env file for sensitive configuration:
# Core Settings
WEBUI_SECRET_KEY=$(openssl rand -hex 32)
ENABLE_SIGNUP=true
DEFAULT_USER_ROLE=pending
# Ollama Connection (adjust if Ollama runs on a different host)
OLLAMA_BASE_URL=http://host.docker.internal:11434
# Optional: External Database (PostgreSQL)
# DATABASE_URL=postgresql://user:pass@postgres:5432/openwebui
# Optional: Redis for caching
# REDIS_URL=redis://redis:6379/0
# Optional: SMTP for email notifications
# SMTP_SERVER=smtp.gmail.com
# SMTP_PORT=587
# [email protected]
# SMTP_PASSWORD=your-app-password
# WEBUI_URL=https://ai.yourdomain.com
Step 3: Launch OpenWebUI
Start the container:
docker compose up -d
Check logs to ensure it's running:
docker logs -f openwebui
Wait for the "Application startup complete" message, then access the web interface at http://your-server-ip:3000.
Step 4: Initial Setup
On first access, you'll be prompted to create an admin account:
- Enter your name, email, and a strong password
- Click "Create Admin Account"
- You'll be redirected to the main chat interface
If Ollama is running, available models will appear automatically in the dropdown. If not, you can configure the connection in Settings → Admin Settings → Connections.
Step 5: Pull Your First Model
If you haven't already, pull a model through Ollama:
# On your host (where Ollama runs)
ollama pull llama3.2:3b
# Or a larger model for better quality
ollama pull llama3.1:8b
# For coding tasks
ollama pull codellama:7b
Refresh OpenWebUI — your models will now appear in the selector.
Step 6: Enable HTTPS with a Reverse Proxy
For production use, put OpenWebUI behind a reverse proxy. Here's a Traefik configuration example:
# docker-compose.yml addition
labels:
- "traefik.enable=true"
- "traefik.http.routers.openwebui.rule=Host(`ai.yourdomain.com`)"
- "traefik.http.routers.openwebui.entrypoints=websecure"
- "traefik.http.routers.openwebui.tls.certresolver=letsencrypt"
- "traefik.http.services.openwebui.loadbalancer.server.port=8080"
Or use Nginx Proxy Manager, Caddy, or any reverse proxy you prefer.
Step 7: Configure Advanced Features
Enable RAG (Retrieval-Augmented Generation)
OpenWebUI supports document uploading out of the box:
- Go to Workspace → Documents
- Upload PDFs, text files, or markdown documents
- In chat, click the + button and select your document
- Ask questions — OpenWebUI will retrieve relevant context
Set Up Model Presets
Create specialized assistants in Workspace → Models:
- Coding Assistant: System prompt focused on code generation and review
- Writing Helper: Tone and style guidelines for content creation
- Data Analyst: Instructions for structured analysis and reporting
Configure User Permissions
In Admin Panel → Users, you can:
- Approve or reject signups
- Assign roles (user, moderator, admin)
- Set model access permissions per user
- Monitor usage and conversations
Verification Steps
Confirm everything is working:
- Access the UI: Navigate to your domain and log in
- Test a model: Send a message and receive a response
- Check Ollama connection: Settings → Connections shows "Connected"
- Upload a document: Test RAG with a small PDF
- Create a second user: Verify multi-user functionality
Next Steps
Now that OpenWebUI is running, explore these related guides:
- Self-Host Ollama — Run AI models locally
- Self-Host LiteLLM — One API for all your AI models
- Self-Host Coolify — Deploy apps with a Vercel-like experience
- Self-Host Traefik — The ultimate reverse proxy
Troubleshooting
Models Not Appearing
- Verify Ollama is running:
curl http://localhost:11434/api/tags - Check
OLLAMA_BASE_URLmatches your Ollama host - Restart OpenWebUI after pulling new models
Container Won't Start
- Check port 3000 isn't already in use:
netstat -tlnp | grep 3000 - Review logs:
docker logs openwebui - Ensure sufficient disk space for model storage
Slow Responses
- Use smaller models (3B instead of 70B) for faster inference
- Enable GPU acceleration in Ollama if available
- Check CPU/memory usage during generation
Conclusion
OpenWebUI bridges the gap between raw Ollama models and a polished AI experience. With multi-user support, RAG capabilities, and a familiar ChatGPT-like interface, it's the perfect addition to any self-hosted AI stack.
The setup takes minutes, but the productivity gains last indefinitely. Your AI, your data, your rules.