Latest

Open WebUI with Ollama in Docker: installation, first admin account, updates and data backup

Ollama runs the models; Open WebUI puts a web interface in front of it with users, history and documents. How to install it with Docker or Docker Compose, connect it to Ollama (including the extra step on Linux), create the first admin, update without losing data and back up the volume.

By 5 min read

Ollama on the command line is fine for trying a model. But when you want conversation history, several users, document uploads and an address to open from any browser at home or in the office, you need an interface. Open WebUI is an open-source project that does exactly that and installs as a single Docker container. In this guide we connect it to Ollama and set it up so that it can be updated and backed up without surprises.

What you need first

  • Docker installed (Docker Engine on Linux, Docker Desktop on Windows and macOS).
  • Ollama installed with at least one model downloaded.
  • A check that Ollama answers on port 11434:
curl http://localhost:11434/api/tags

If you get a JSON list of models, Ollama is ready.

Which setup to choose

Situation Image Notes
Ollama already installed on the same computer ghcr.io/open-webui/open-webui:main The most common: one container for the interface
Everything in Docker, managed together open-webui:main + ollama/ollama in a Compose file Handy with Portainer: a single stack
One container with Ollama inside ghcr.io/open-webui/open-webui:ollama Quick to try, less flexible

Installation with Ollama already on the computer

First generate a secret key: it signs login sessions and must stay the same every time the container is recreated, otherwise all users are signed out.

openssl rand -hex 32

Then start Open WebUI, replacing YOUR-KEY with the value you got:

docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  -e WEBUI_SECRET_KEY="YOUR-KEY" \
  --name open-webui --restart always \
  ghcr.io/open-webui/open-webui:main

What the options do:

  • -p 3000:8080: the interface will be at http://localhost:3000;
  • --add-host=host.docker.internal:host-gateway: lets the container reach Ollama running on the computer;
  • -v open-webui:/app/backend/data: all data (users, conversations, documents, settings) goes into the open-webui volume. Without this volume you lose everything the first time the container is recreated.

On Linux there is one more step

On Linux Ollama listens only on 127.0.0.1, so the container cannot reach it and the model list in Open WebUI stays empty. Tell Ollama to listen on the other interfaces too:

sudo systemctl edit ollama.service

In the editor that opens, add:

[Service]
Environment="OLLAMA_HOST=0.0.0.0"

Then apply:

sudo systemctl daemon-reload
sudo systemctl restart ollama

Warning: the Ollama API has no authentication. With 0.0.0.0 it becomes reachable from the whole local network: if the computer is on an untrusted network, restrict port 11434 with the firewall, and never forward it from the router.

Installation with Docker Compose (or as a Portainer stack)

This file starts Ollama and Open WebUI together, with two separate volumes for models and interface data:

services:
  ollama:
    image: ollama/ollama
    volumes:
      - ollama:/root/.ollama
    restart: unless-stopped

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
      - WEBUI_SECRET_KEY=YOUR-KEY
    volumes:
      - open-webui:/app/backend/data
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama:
  open-webui:
docker compose up -d

In this setup Ollama publishes no port to the outside: only Open WebUI reaches it on the stack’s internal network. To download a model:

docker compose exec ollama ollama pull llama3.2

To use an NVIDIA graphics card inside the Ollama container you need the drivers and the NVIDIA Container Toolkit on the Docker host; details are in the ollama/ollama image documentation.

First login: the administrator

  1. Open http://localhost:3000 (or http://SERVER-ADDRESS:3000 from another PC on the network).
  2. The first screen offers to create the admin account: the first account created is the administrator of the instance. Create it straight away, before making the service reachable by others.
  3. Pick the model from the drop-down at the top left and ask a test question.

Accounts created after the first stay pending until the administrator approves them in the Admin Panel. If the instance is just for you, you can turn sign-ups off entirely in the general settings of the same panel.

If the model list is empty

Check Command or path
Does Ollama answer on the computer? curl http://localhost:11434/api/tags
Can the container reach Ollama? docker exec open-webui curl -s http://host.docker.internal:11434/api/tags
Address configured in the interface Admin Panel → Settings → Connections: the Ollama address must be http://host.docker.internal:11434 (or http://ollama:11434 with Compose)
What the container says docker logs --tail 50 open-webui

On Linux the cause is almost always the OLLAMA_HOST step described above.

Updating without losing data

Data lives in the volume, so the container can be removed and recreated.

With docker run:

docker rm -f open-webui
docker pull ghcr.io/open-webui/open-webui:main

then the same docker run command used for installation, with the same WEBUI_SECRET_KEY.

With Compose:

docker compose pull
docker compose up -d

In Portainer the equivalent is Recreate on the container with the re-pull image option, or updating the stack. Before a major update, take the backup below.

Backing up the volume

This command creates an archive of the whole volume in the current folder:

docker run --rm \
  -v open-webui:/data \
  -v "$(pwd)":/backup \
  alpine tar czf /backup/open-webui-backup.tar.gz -C /data .

For a consistent backup, stop the container first (docker stop open-webui) and start it again right after. The archive contains conversations and uploaded documents: store it as you would store those documents. With Compose the real volume name carries the stack prefix: find it with docker volume ls.

Three security rules

  • Do not publish port 3000 on the Internet. To use it away from home, go through a VPN.
  • If you use it in an office, put it behind a reverse proxy with HTTPS: without encryption, passwords and conversations travel in clear text on the network.
  • Keep the image up to date and review who has an account: every approved user can use the models and, if enabled, upload documents.

Sources

  • Open WebUI, Quick Start: install commands, first account and updating (accessed 11 November 2026).
  • Ollama, FAQ: the OLLAMA_HOST variable and service configuration on Linux.
  • Docker, volumes documentation.