A customized deployment of Open WebUI with SearXNG integration for enhanced RAG (Retrieval-Augmented Generation) capabilities.
- Open WebUI: Modern web interface for Ollama
- SearXNG Integration: Private search engine for RAG capabilities
- NVIDIA GPU Support: Hardware acceleration for model inference
- Secure by Default:
- HTTPS enabled
- Authentication required
- Private instance configuration
- Secure cookie settings
- Easy Maintenance: Makefile for common operations
- System Optimization: Automated system configuration for optimal performance
- Flexible Configuration: Customizable hostname and security settings
- Docker and Docker Compose
- NVIDIA GPU with compatible drivers
- Make (for using Makefile commands)
- Root access (for system initialization)
- Clone the repository:
git clone https://github.com/yourusername/open-webui.git
cd open-webui
- Create and configure your environment file:
cp .env-dist .env
Edit .env
and configure at minimum:
# System Configuration
HOSTNAME="openwebui.local" # Your preferred hostname
# Security Configuration
WEBUI_SECRET_KEY="your_secret_key" # Generate with: openssl rand -hex 32
SEARXNG_SECRET="your_searxng_secret" # Generate with: openssl rand -hex 32
- Initialize the system (requires root privileges):
sudo ./init-system.sh
This script will:
- Configure system limits and kernel parameters
- Set up NVIDIA container runtime
- Generate self-signed SSL certificates for your hostname
- Configure local domain resolution
- Install required dependencies
- Start the services:
make up
The application will be available at: https://your-configured-hostname (default: https://openwebui.local)
- Modern CPU (4+ cores)
- 16GB+ RAM
- NVIDIA GPU with 8GB+ VRAM
- SSD storage
- Ubuntu 22.04 or newer
The initialization script configures:
- Memory management
- CPU scheduling
- Network optimization
- NVIDIA settings
- System security limits
make pull # Pull pre-built Docker images from repository
make build # Build all Docker images locally
make up # Start all services (after pulling/building)
make down # Stop and remove all containers
make stop # Stop all services
make restart # Restart all services
make logs # Follow logs from all services
make upgrade # Full upgrade: down, remove images, rebuild, and start
HOSTNAME
: Your preferred hostname for accessing the applicationWEBUI_AUTH
: Enable authentication (recommended: True)WEBUI_SECRET_KEY
: Secret key for session managementWEBUI_SESSION_COOKIE_SECURE
: Force HTTPS for cookiesDEFAULT_LOCALE
: Interface language (default: "en")ENABLE_RAG_WEB_SEARCH
: Enable web search for RAGRAG_WEB_SEARCH_RESULT_COUNT
: Number of search results to useSEARXNG_SECRET
: SearXNG instance secret keySEARXNG_LIMITER
: Rate limiting (default: False for private instance)SEARXNG_PUBLIC_INSTANCE
: Keep as False for private use
- 80: HTTP (redirects to HTTPS)
- 443: Open WebUI
- 8443: SearXNG
The setup consists of four main services:
- nginx: Reverse proxy handling SSL termination and routing
- ollama: AI model serving with GPU support
- open-webui: Web interface for interacting with models
- searxng: Private search engine for RAG capabilities
- All services run in an isolated Docker network
- Authentication is enabled by default
- HTTPS enforced with auto-generated certificates
- Secure cookie settings
- Private SearXNG instance
- No public metrics endpoints
- Optimized system security limits
# View logs
make logs
# Restart services
make restart
# Stop services
make stop
# Full upgrade (recommended)
make upgrade
# Alternative manual update
make down
make pull
make up
Important data is stored in Docker volumes:
ollama_data
: Model files and configurationsopen-webui_data
: User data and settings
- If services fail to start:
make down
make up
- For image-related issues:
make upgrade
- To check logs for specific issues:
make logs
- System-related issues:
# Verify system settings
sudo sysctl -a | grep -E "vm.swappiness|vm.dirty_ratio|vm.nr_hugepages"
# Check NVIDIA configuration
nvidia-smi
nvidia-container-cli info
- Hostname/Certificate issues:
# Update hostname in .env file
HOSTNAME="your-new-hostname.local"
# Regenerate certificates with new hostname
sudo ./init-system.sh
# Restart services
make down
make up
This project builds upon:
Please refer to their respective licenses for terms of use.