How to Set Up Local LLMs (Ollama + Open WebUI) for Offline Corporate Data Privacy (2026)
Complete step-by-step guide to deploying air-gapped local LLMs using Ollama and Open WebUI on Docker with zero external telemetry, GPU acceleration, and role-based access control.
Sending proprietary source code, patient health records, customer PII, or internal financial spreadsheets to public cloud LLM endpoints poses massive compliance risks under GDPR, HIPAA, and ISO 27001. In 2026, enterprise engineering teams are rapidly adopting self-hosted, air-gapped language models to ensure 100% data residency and zero external telemetry.
By orchestrating Ollama as the backend inference runtime alongside Open WebUI as the collaborative enterprise chat interface, small-to-midsize businesses can deliver a seamless, ChatGPT-grade internal AI portal with zero per-seat subscription costs.
Executive Summary & Hardware Sizing (2026)
Modern quantized models (Q4_K_M) achieve near-lossless output while running comfortably on consumer and enterprise workstations. A single NVIDIA RTX 4090 (24GB VRAM) or Apple M3/M4 Max (64GB unified memory) comfortably serves 14B to 32B parameter models with sub-50ms token generation latency across 20+ concurrent employees.
1. Model Selection & Hardware Sizing Matrix
Before provisioning hardware, balance model reasoning capabilities with available VRAM:
| Model & Parameters | Quantization | Minimum VRAM / RAM | Inference Speed (RTX 4090) | Recommended Corporate Use Case |
|---|---|---|---|---|
| Llama 3.3 (8B) / Qwen 2.5 (7B) | Q4_K_M | 6 GB VRAM / 16 GB RAM | 85 tokens/sec | Fast internal email drafting, meeting summarization |
| Qwen 2.5 Coder (14B) | Q5_K_M | 12 GB VRAM / 32 GB RAM | 55 tokens/sec | Private code review, refactoring, SQL query generation |
| Llama 3.3 (70B) | Q4_K_M | 42 GB VRAM / 64 GB RAM | 22 tokens/sec (Dual 3090/4090) | Complex legal document analysis, contract auditing |
2. Step-by-Step Production Docker Compose Setup
Create a dedicated directory /opt/local-ai on your Ubuntu 24.04 LTS host. Ensure NVIDIA Container Toolkit is installed so Docker can access GPU passthrough.
# 1. Install NVIDIA Container Toolkit (Ubuntu/Debian)
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
Save the following docker-compose.yml file:
version: '3.8'
services:
ollama:
image: ollama/ollama:latest
container_name: corporate-ollama-engine
restart: unless-stopped
ports:
- "127.0.0.1:11434:11434" # Bind strictly to localhost for privacy
environment:
- OLLAMA_KEEP_ALIVE=24h
- OLLAMA_FLASH_ATTENTION=1
- OLLAMA_NUM_PARALLEL=4
volumes:
- /opt/local-ai/ollama:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: corporate-open-webui
restart: unless-stopped
ports:
- "0.0.0.0:8080:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- WEBUI_AUTH=True
- ENABLE_SIGNUP=False # Only admins can invite staff
- DEFAULT_MODELS=llama3.3:latest
- WEBUI_SECRET_KEY=9f8c4b2e817a26f04d9c7e3a1b5d6e2f
volumes:
- /opt/local-ai/webui:/app/backend/data
depends_on:
- ollama
3. Pulling Models and Verifying Terminal Output
Execute into the running Ollama container to fetch your corporate baseline models:
# Start services in daemon mode
sudo docker compose up -d
# Download Llama 3.3 and Qwen Coder
docker exec -it corporate-ollama-engine ollama pull llama3.3:8b
docker exec -it corporate-ollama-engine ollama pull qwen2.5-coder:14b
# Confirm models loaded into GPU VRAM
docker exec -it corporate-ollama-engine ollama ps
4. Troubleshooting Common Errors
- Error: CUDA out of memory: Occurs when context length (
num_ctx) is too large for physical VRAM. AddOLLAMA_NUM_PARALLEL=1and reduce context window to 8192 in the Open WebUI Model Parameter Settings. - Error: connection refused localhost:11434: Ensure the container network is shared. In
docker-compose.yml, Open WebUI must reach Ollama via the service namehttp://ollama:11434, NOTlocalhost. - CORS blocking / WebUI disconnects: Set
OLLAMA_ORIGINS=*inside Ollama's environment variables if connecting external UI clients across subnet boundaries.
Frequently Asked Questions (FAQ)
Can employees upload PDFs and spreadsheets for RAG search locally?
Yes. Open WebUI contains a built-in Vector Database (ChromaDB) that embeds and queries uploaded corporate documents locally without sending a single byte to external clouds.
How do we enforce SSO with Google Workspace or Microsoft Entra ID?
Open WebUI natively supports OAuth2/OIDC. Set ENABLE_OAUTH_SIGNUP=True and inject your corporate Client ID and Client Secret in environment variables.