A local chatbot needs a model server and a browser interface that can reach it. Ollama supplies the model, while a fresh Open WebUI instance provides the chat page for the first conversation.
Ollama must already be running with a pulled chat model and an API listener reachable from Docker. The host alias reaches host services rather than the container's own loopback interface. On Linux, adding that alias does not make an Ollama listener bound only to host loopback reachable; a listener restricted to the Docker-facing interface or another private route is needed.
The first account on a new Open WebUI data volume becomes its administrator. Local-only browser access requires Docker Engine 28.0.0 or newer, and a protected secret file must be retained with the data volume for later container recreation. An existing instance with saved provider settings needs its connection edited separately.
Steps to set up an Ollama chatbot in Open WebUI:
- Confirm that Ollama lists a pulled chat model.
$ curl --fail --silent --show-error http://127.0.0.1:11434/api/tags
The response must contain a model name in models. An empty list needs a model pulled in Ollama before chat can work. The model shown later is named company-chat; your model name can differ.
- Create a directory for the new instance's secret file.
$ mkdir -p ~/open-webui
- Change into the secret-file directory.
$ cd ~/open-webui
- Restrict permissions for files created in the current shell.
$ umask 077
- Enable overwrite protection in the current shell.
$ set -C
This prevents redirection from replacing an existing env file and losing its secret.
- Generate the persistent WEBUI_SECRET_KEY in the protected env file.
$ printf 'WEBUI_SECRET_KEY=%s\n' "$(openssl rand -hex 32)" > open-webui.env
The secret is not printed, and only the file owner can read it. The same file is needed for future container recreation; changing the key can invalidate sessions and encrypted integration data.
Related: How to set WEBUI_SECRET_KEY in Open WebUI - Start the fresh Open WebUI instance with the host's Ollama URL.
The loopback mapping keeps the first administrator signup off other host interfaces. The Ollama API also needs a private, container-reachable listener; exposing port 11434 publicly would let others use the model server without Open WebUI authentication.
$ docker run --detach \ --name open-webui \ --publish 127.0.0.1:3000:8080 \ --add-host=host.docker.internal:host-gateway \ --env OLLAMA_BASE_URL=http://host.docker.internal:11434 \ --env-file open-webui.env \ --mount type=volume,source=open-webui,target=/app/backend/data \ --restart unless-stopped \ ghcr.io/open-webui/open-webui:v0.12.4
The command prints the container ID. The named volume stores accounts and chats outside the container. This first-use setup needs an unused container name and a fresh volume; saved connection settings in an existing volume can override the URL. The host-gateway mapping supplies the host alias on Linux, while Docker Desktop already provides it.
Related: How to fix Open WebUI localhost connection errors in Docker - Wait for the Open WebUI health endpoint to answer.
$ curl --fail --silent --show-error http://127.0.0.1:3000/health {"status":true}
Initial startup can take several minutes while bundled components initialize or download models. If the request fails during startup, wait before retrying; an unhealthy or exited container needs diagnosis with docker logs open-webui.
- Open http://127.0.0.1:3000 in a browser on the Docker host.

- Click Get started to open administrator setup.

- Enter the administrator's display name in Name.

- Enter the administrator's email address in Email.

- Enter a strong password in Password.

- Click Create Admin Account.
A successful first signup opens the application and may display the release notes.
- Dismiss the What's New in Open WebUI dialog if it appears.
The first chat is already open after onboarding.
- Open the model picker in the chat composer.

- Select your pulled Ollama model from the list.
The selected model here is company-chat:latest. If your model is missing, its native API must be reachable from the Open WebUI container before refreshing the model list can help.
Related: How to refresh the Open WebUI model list - Enter a short question in the chat composer.
What is 7 plus 5? Answer with just the number.
- Press Enter to send the question.

- Confirm that a reply appears beneath the selected model's name.
A generated reply shows that the first conversation reached the model, rather than only listing it. If the model list loads but chat fails, the Ollama logs and provider connection are the next places to inspect. The data volume and protected env file keep this installation available for later use.
Related: How to fix Open WebUI localhost connection errors in Docker