Install Open WebUI on a VPS (Docker + HTTPS)

Open WebUI gives Ollama a ChatGPT-style chat interface — model picker, conversation history, multi-user accounts, document upload for RAG, and OpenAI-API compatibility. Here's the production deploy with Docker, Nginx, and a real certificate.

Disclosure: contains an affiliate link to Inferno VPS.

What Open WebUI gives you

Prerequisites

Tested on Ubuntu 22.04, Docker CE 27.3, Open WebUI 0.4.x, Ollama 0.4.6, on a 16 GB Inferno VPS.

Step 1 — The Compose file

mkdir -p ~/open-webui && cd ~/open-webui
nano docker-compose.yml
name: open-webui

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:v0.4.7
    restart: unless-stopped
    ports:
      - "127.0.0.1:8080:8080"
    volumes:
      - open_webui_data:/app/backend/data
    environment:
      OLLAMA_BASE_URL: "http://host.docker.internal:11434"
      WEBUI_SECRET_KEY: "${WEBUI_SECRET_KEY}"
      ENABLE_SIGNUP: "false"
      DEFAULT_USER_ROLE: "pending"
      ENABLE_LOGIN_FORM: "true"
      WEBUI_AUTH: "true"
      DATA_DIR: "/app/backend/data"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    deploy:
      resources:
        limits:
          memory: 2G
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

volumes:
  open_webui_data:

Important details:

Step 2 — Generate the secret key

cat > .env <<EOF
WEBUI_SECRET_KEY=$(openssl rand -base64 32)
EOF
chmod 600 .env

The secret key signs session JWTs. Losing it logs everyone out (annoying); leaking it lets an attacker forge sessions (bad).

Step 3 — Bring it up

docker compose up -d
docker compose logs -f open-webui

Wait for "Application startup complete." The first start downloads embedding models for RAG and takes 1-2 minutes.

Step 4 — Nginx + HTTPS

sudo nano /etc/nginx/sites-available/chat
server {
    listen 80;
    server_name chat.example.com;

    location /.well-known/acme-challenge/ { root /var/www/html; }

    client_max_body_size 100M;   # for RAG document uploads

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_buffering off;
        proxy_read_timeout 600s;
    }
}
sudo ln -s /etc/nginx/sites-available/chat /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d chat.example.com --redirect

Step 5 — Create the admin account

Visit https://chat.example.com/. Because we disabled signup but allow the first-account creation, the very first registration becomes admin. Pick a strong password.

After creating the admin, immediately go to Admin Panel → Settings → confirm:

Step 6 — Connect to Ollama and pick a default model

Admin Panel → Connections → Ollama. The endpoint should already be set to http://host.docker.internal:11434. Click "Test" — should return green.

In Settings → Models, you'll see whatever Ollama has pulled. Pin a default model for new conversations.

Step 7 — RAG (optional)

Open WebUI ships with built-in embeddings and a vector store. To use it:

  1. In a chat, click the "+" → "Upload Document." PDF, DOCX, TXT, MD, HTML.
  2. The document is chunked, embedded, and stored in the local vector DB.
  3. Subsequent questions in that conversation retrieve relevant chunks and inject them into the prompt.

For better-than-default embeddings, pull nomic-embed-text in Ollama and set it as the embedding model in Admin → Settings → Documents.

Performance and resource use

Open WebUI itself is light — ~300-400 MB RAM. The heavy work is Ollama. On the 16 GB Inferno test box running Ollama + Open WebUI + Nginx, idle memory use stays under 6 GB; loaded with a 14B model the total hits ~12 GB. Plenty of headroom for the typical small-team use case.

Updating

cd ~/open-webui
# Edit docker-compose.yml — bump the tag
docker compose pull
docker compose up -d
docker compose logs -f open-webui

The open_webui_data volume holds users, conversations, and the vector DB — preserved across image updates within the same major version. Back it up the same way as our n8n backup pattern.

Common Open WebUI mistakes

"Connection to Ollama failed"

The host.docker.internal trick depends on Docker 20.10+ and the extra_hosts: host-gateway line. Confirm with docker compose exec open-webui ping host.docker.internal. If Ollama is in its own container, use that container's network alias instead.

"Streaming responses arrive in big chunks"

Nginx is buffering. The proxy_buffering off line in the config example fixes it.

"Document upload returns 413"

Default client_max_body_size is 1 MB. Set to 100M (as in the example) and reload Nginx.

"Anyone can register a new account"

You didn't restart after setting ENABLE_SIGNUP=false, or the variable is set inside Open WebUI's admin settings instead of the env. Set in both places to be safe.

"RAG retrieval returns irrelevant chunks"

The default embedding model is generic. Pull nomic-embed-text via Ollama and set it as the embedding model — meaningfully better retrieval for English text.

VPS for an Ollama + Open WebUI stack?

A 16 GB Inferno plan runs an 8-14B model + Open WebUI + Nginx with room to spare. With local AI inference, all your conversations stay on your hardware.

View Inferno plans →

What to do next


Author: Hanna Wagner — Frankfurt. Last tested: 2026-05-22 on Open WebUI v0.4.7, Ollama 0.4.6, Docker CE 27.3.