Yes—you can run Ollama and Open WebUI together on your computer using Docker, then download a model and chat with it through a browser. The key setup choice is how the two containers reach each other: use Docker Compose on a shared network, and connect Open WebUI to Ollama by its service name.
What the two services do
Ollama serves language models locally and provides an API for applications to send prompts and receive responses. Open WebUI is a separate web application that gives you a chat interface and can connect to an Ollama server. Running both in Docker keeps their application files in containers, while Docker volumes preserve downloaded models and Open WebUI data between restarts.
“Locally” means the services run on your own computer; it does not guarantee that every part of the setup is offline. You need an internet connection to download container images and models. Once downloaded, local inference can work without sending prompts to a hosted model provider, provided you select the local Ollama connection and do not configure other external services.
Before you start
- Install Docker Desktop on Windows or macOS, or Docker Engine and the Compose plugin on Linux. Confirm Docker is running.
- Allow enough free disk space. Model files can range from a few gigabytes to much larger sizes, depending on the model and its quantization.
- Check your computer’s memory and, if relevant, GPU support. A model that is too large for available memory may run slowly or fail to load.
- Use a current Docker Compose installation. The commands below assume the Compose subcommand,
docker compose.
GPU acceleration is optional. The simplest initial setup uses CPU inference, which is broadly compatible but may be slower. GPU passthrough differs by operating system and hardware; do not assume that installing Docker automatically makes a host GPU available inside a container.
Start Ollama and Open WebUI with Compose
Create a new folder, for example local-llm, and save the following as compose.yaml inside it:
services:
ollama:
image: ollama/ollama
container_name: ollama
volumes:
- ollama:/root/.ollama
restart: unless-stopped
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
depends_on:
- ollama
ports:
- "127.0.0.1:3000:8080"
environment:
OLLAMA_BASE_URL: http://ollama:11434
volumes:
- open-webui:/app/backend/data
restart: unless-stopped
volumes:
ollama:
open-webui:
From that folder, start the containers with:
docker compose up -d
The port mapping makes Open WebUI available at http://localhost:3000 on the same computer. Binding the published port to 127.0.0.1 avoids exposing the web interface on other network interfaces by default. The containers can still communicate with each other over Compose’s private network: Open WebUI reaches Ollama at http://ollama:11434, where ollama is the Compose service name.
The named volumes keep model files and Open WebUI’s database when containers are recreated. Avoid changing the Ollama URL to localhost inside Open WebUI: there, localhost means the Open WebUI container itself, not the Ollama container.
Download a model and open the chat
Open http://localhost:3000 in a browser and follow the initial account setup shown by the application. Then download a model through Open WebUI’s model controls, if available, or pull one directly through Ollama. For example:
docker compose exec ollama ollama pull llama3.2
Model names and tags change over time, so check Ollama’s current model library for available choices and their requirements. After the pull completes, select that model in Open WebUI. You can also verify Ollama from the terminal with:
docker compose exec ollama ollama list
For a quick connection check, the Ollama API is available to other containers at port 11434. You generally do not need to publish that port to the host just to use Open WebUI. Keeping it unexposed reduces unnecessary access to the service.
Configuration, updates, and stopping
To see startup and connection messages, run docker compose logs -f; press Ctrl+C to stop following the logs without stopping the containers. To stop the services while retaining their data, use docker compose down. Starting again with docker compose up -d reuses the volumes.
- Update the images with
docker compose pull, then recreate the services usingdocker compose up -d. - Keep the Compose file and a note of any custom settings so the setup can be reproduced.
- To remove the containers and network, use
docker compose down. Do not add-vunless you also intend to delete the named volumes, including downloaded models and saved application data. - The example uses the
mainimage tag for Open WebUI. For a more controlled update process, choose a published version tag from the project’s container registry rather than relying on a moving tag.
Common connection and performance problems
If Open WebUI says Ollama is unavailable, check that both containers are running with docker compose ps, then inspect their logs. Confirm the environment variable is exactly OLLAMA_BASE_URL: http://ollama:11434 and that both services are defined in the same Compose project. A host address such as localhost:11434 is usually the wrong address from inside the Open WebUI container.
If no models appear, first pull one into the Ollama container and check it with ollama list. If a model starts but responds slowly, the computer may be using CPU inference, swapping memory, or trying to load a model that exceeds available resources. Try a smaller model and close other memory-heavy applications. GPU configuration requires hardware- and platform-specific steps; consult the current Docker and Ollama instructions for your system rather than copying Linux GPU settings onto Windows or macOS.
If the browser cannot open the page, confirm the container is healthy and that port 3000 is not already in use. You can change the left side of the port mapping—for example, 127.0.0.1:3001:8080—and then visit http://localhost:3001.
Privacy and practical limits
Local inference can keep prompts on your computer when you use a local model, but Docker alone is not a privacy guarantee. The computer still downloads software and models, and application settings or optional integrations may communicate with external services. Review the configuration, keep images and model sources trustworthy, and do not expose the interface to a network unless you understand the access controls and risks.
Model quality, response speed, and context capacity depend on the specific model, its settings, and your hardware. A local setup is useful for experimentation and private workflows, but it does not make every model suitable for every task. Treat generated output as something to check, especially when accuracy matters.
Frequently Asked Questions
Can Open WebUI and Ollama run on the same computer?
Yes. Compose runs them as separate containers on one computer and connects them over a private Docker network.
Do I need to install Ollama separately on my computer?
No. In this setup the Ollama server runs in its container. You can manage it with commands such as docker compose exec ollama ollama pull llama3.2.
Why can’t Open WebUI connect to Ollama at localhost?
Inside a container, localhost refers to that container. Use the Ollama Compose service name, ollama, followed by port 11434.
Does this setup require a GPU?
No. It can run without one, though generation may be slower. GPU acceleration depends on compatible hardware and operating-system-specific container configuration.
Will my models and chats disappear when I stop Docker?
Not when you stop or remove the containers with the named volumes intact. Running docker compose down -v removes those volumes and their stored data.
Can I use it without internet?
After downloading the images and a model, local chatting can work without internet if the configuration uses only local services. Initial downloads require connectivity.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Valheim Server Not Showing in Community List Fixes
- DisplayPort vs HDMI: Which Cable Should You Use?
- Soundbar vs 2.1 Speaker System: Which Is Better?
- Surface Won’t Turn On: Quick Fixes1.8 h
- Survive Lava for Brainrot Tier List170 points
- MySQL Dump Import: Fix Common Errors