Run This Ai
EN DE

Open WebUI unter Ubuntu 24.04 installieren

A step-by-step installation guide.

Open WebUI Anleitung — Ubuntu 24.04

Einführung

Open WebUI ist das beste selbstgehostete UI für Ollama — ChatGPT-ähnlich mit RAG, Multi-User-Unterstützung, Sprache, Bildgenerierung und Plugins. Verbindet sich mit Ollama, OpenAI-APIs & mehr. Installation auf Ubuntu 24.04 mit Docker hinter Nginx + SSL.

Voraussetzungen

  • Ubuntu 24.04 · min. 2 vCPU / 2 GB RAM (4 vCPU / 4 GB+ für RAG)
  • Docker (24.x+) + Compose v2 · Ollama auf localhost:11434
  • Ports 80/443 offen · Domain → Server-IP
💡 Hast du Ollama? Open WebUI verbindet sich über OLLAMA_BASE_URL.

1 — Docker installieren

curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER && newgrp docker
docker --version && docker compose version

2 — Docker Compose

~/open-webui/docker-compose.yml:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    restart: unless-stopped
    ports: ["3000:8080"]
    volumes: [./open-webui:/app/backend/data]
    environment:
      - OLLAMA_BASE_URL=http://host.docker.internal:11434
      - WEBUI_SECRET_KEY=***      - WEBUI_NAME=Mein KI
      - DEFAULT_MODELS=llama3.2:latest
      - ENABLE_SIGNUP=true
⚠️ Linux: host.docker.internal wird nicht aufgelöst. Verwende die LAN-IP des Hosts oder extra_hosts: - "host.docker.internal:host-gateway".
openssl rand -hex 32
docker compose up -d

Besuche http://deine-ip:3000 → erstelle ein Admin-Konto.

3 — Nginx + SSL

sudo apt install -y nginx certbot python3-certbot-nginx

/etc/nginx/sites-available/open-webui:

server {
    listen 80; server_name deine-domain.de;
    return 301 https://$host$request_uri;
}
server {
    listen 443 ssl http2; server_name deine-domain.de;
    ssl_certificate /etc/letsencrypt/live/deine-domain.de/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/deine-domain.de/privkey.pem;
    location / {
        proxy_pass http://127.0.0.1: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-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 86400s;
    }
}
sudo ln -s /etc/nginx/sites-available/open-webui /etc/nginx/sites-enabled/
sudo nginx -t && sudo certbot --nginx -d deine-domain.de
sudo systemctl reload nginx

Umgebungsvariablen

  • OLLAMA_BASE_URL — Ollama-Endpunkt (Standard: http://localhost:11434)
  • WEBUI_SECRET_KEY — Sitzungsschlüssel. Generieren mit: openssl rand -hex 32
  • WEBUI_NAME — Benutzerdefinierter Name
  • DEFAULT_MODELS — Vorausgewählte Modelle (durch Kommas getrennt)
  • ENABLE_SIGNUPfalse = keine öffentliche Registrierung (Standard: true)
  • RAG_EMBEDDING_ENGINE — Embedding-Backend (Standard: ollama)
  • RAG_TOP_K — Chunks pro RAG-Anfrage (Standard: 5)

Beinhaltet ChromaDB.

Backups

cd ~/open-webui && tar -czf bk-$(date +%F).tar.gz ./open-webui

Cron (3 Uhr morgens, 30 Tage Aufbewahrung):

0 3 * * * cd /home/ubuntu/open-webui && tar -czf /backups/ow-$(date +\%F).tar.gz ./open-webui && find /backups -name 'ow-*.tar.gz' -mtime +30 -delete

Aktualisierung

cd ~/open-webui && docker compose pull && docker compose up -d
⚠️ Erst Backup erstellen — DB-Migrationen sind irreversibel.

Fehlerbehebung

DB-Migration schlägt fehl

Prüfe docker compose logs --tail=100, stelle Backup wieder her. Manuelle Anleitung.

Ollama verweigert Zugriff

  • sudo systemctl status ollama; curl localhost:11434/api/tags
  • Setze OLLAMA_HOST=0.0.0.0:11434, falls nur 127.0.0.1 aktiv ist
  • docker exec open-webui curl http://<host>:11434/api/tags

host.docker.internal schlägt fehl

Nur bei Docker Desktop — nicht bei Docker Engine unter Linux. Lösungen:

  1. Host LAN-IPhttp://192.168.1.50:11434
  2. extra_hostsextra_hosts: - "host.docker.internal:host-gateway"
  3. network_mode: host — WebUI auf Port 8080

MIT. Dokumentation · GitHub · Discord

#install_guide