Self-host Open WebUI + Ollama in production — the config nobody writes about

Published: (April 17, 2026 at 05:38 AM EDT)
2 min read
Source: Dev.to

Source: Dev.to

The stack

  • ollama – LLM runner
  • openwebui – Chat UI
  • nginx – Reverse proxy + SSL

The nginx config that trips everyone up

Open WebUI uses WebSockets for streaming. Without the proper headers, responses just hang.

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 300s;

Also set a larger upload limit for documents and images:

client_max_body_size 50M;

Lock down auth

By default Open WebUI allows anyone to sign up. For a team setup, add these environment variables:

WEBUI_AUTH=true
ENABLE_SIGNUP=false

Now only the admin can create accounts. Add your SMTP configuration to send email invites.

GPU passthrough (NVIDIA)

In docker-compose.yml, uncomment the following section to expose the GPU to the container:

deploy:
  resources:
    reservations:
      devices:
        - driver: nvidia
          count: all
          capabilities: [gpu]

Install the NVIDIA container toolkit and restart Docker. Without this, Ollama will fall back to CPU (still works but much slower).

Automated backups

Run the command below to back up the Open WebUI data volume:

docker run --rm \
  --volumes-from "$(docker compose ps -q openwebui)" \
  -v "$(pwd)/backups:/backup" \
  alpine \
  tar czf "/backup/openwebui_$(date +%Y%m%d).tar.gz" /app/backend/data

Add a daily cron job (e.g., 2 AM) to automate the backup:

0 2 * * * /opt/openwebui/scripts/backup.sh

Oracle Cloud Always Free – 4 vCPU / 24 GB RAM (ARM). Sufficient for running Llama 3.2 (2 B) with a small team.

Full kit

All the pieces above are packaged into a ZIP that includes:

  • docker-compose.yml
  • Nginx configuration
  • Backup and model scripts
  • .env.example

You can download it from Gumroad:

https://peachjed.gumroad.com/l/cazucc

0 views
Back to Blog

Related posts

Read more »