Fact-checked against Open WebUI and Ollama documentation · 29 November 2026
Editorial Reviewed · Imran Khan Pathan
Open WebUI with Ollama gives you a self-hosted ChatGPT alternative for basic AI chat. This tutorial shows how to install Open WebUI on Windows, Mac (macOS), and Ubuntu using Docker. You’ll download a small model, run your first chat, and set up a two-service Docker Compose stack if you want to manage Open WebUI and Ollama separately. The downloaded model can run offline after setup.
TL;DR: Install Docker, start the bundled Open WebUI image, and visit http://127.0.0.1:3000 from that same computer. Create the first admin account, pull gemma3:1b, choose it from the model selector, and send a test prompt. Two Docker volumes preserve the model files and the WebUI data.
What Open WebUI and Ollama each do
Open WebUI handles the chat interface, accounts, conversation history, and provider settings. Ollama loads the model and generates the response. The browser connects to Open WebUI, which sends the prompt to Ollama. With the bundled Docker image, that last connection stays inside the container.
This distinction explains two common symptoms. If the browser cannot display the sign-in page, start with Docker and the port mapping. If the page loads but the model selector is empty, check the Ollama connection and the list of installed models. Each check answers a different question and saves you from reinstalling a working component.
Choose a setup that fits your computer
| Setup | Choose it when | Where the models live |
|---|---|---|
| Bundled Docker image | You want a first installation with one container and no existing Ollama setup. | The Ollama Docker volume. |
| Open WebUI with an existing Ollama installation | You already use Ollama and want to keep its installed models. | Your existing Ollama installation. |
| Separate Docker services | You want to upgrade Open WebUI and Ollama independently. | The volume assigned to the Ollama service. |
The walkthrough uses the first option and starts without GPU flags. Use a computer that can run Docker and leave enough disk space for the container image, model files, and application data. At the time of the documentation check, the Ollama library listed the 1B model download at about 806 MB. The download size is separate from the memory needed to run the model. Larger models and longer conversations can increase the load on your machine.
You can read the guide on a phone. Run the installation and open the localhost address on the computer hosting Docker. Localhost means the device you are currently using, so the same address on your phone refers to the phone.
Step 1. Start Open WebUI and Ollama
On Windows, start Docker Desktop with the WSL 2 backend. On a Mac, start Docker Desktop for macOS. On Ubuntu, start Docker Engine and install the Docker Compose plugin if you plan to use the Compose example. Check for it with docker compose version. Run the following in a terminal on that computer. The example binds the browser interface to the loopback address for a personal setup and uses a dedicated container name to make the later commands predictable.
docker versiondocker volume create open-webuidocker volume create ollamaGenerate a long, random secret with a password manager and replace REPLACE_WITH_LONG_RANDOM_SECRET before running this command. Keep the same secret when recreating the container. The command is written on one line so it can be pasted into PowerShell or a shell without changing line continuation characters.
docker run -d --name open-webui --restart unless-stopped -p 127.0.0.1:3000:8080 -v open-webui:/app/backend/data -v ollama:/root/.ollama -e WEBUI_SECRET_KEY=REPLACE_WITH_LONG_RANDOM_SECRET ghcr.io/open-webui/open-webui:ollamaPort 3000 is the port you visit on the computer. Port 8080 is the one Open WebUI listens on inside the container. The open-webui volume stores application data such as users and chats. The ollama volume stores model files for the bundled Ollama. Keeping both matters when replacing the container.
docker ps --filter name=open-webuidocker logs --tail 50 open-webuiNVIDIA GPU: On a supported Docker host, add --gpus=all before the image name in the bundled docker run command. On Linux, configure the NVIDIA Container Toolkit. Docker Desktop GPU passthrough on Windows requires the WSL 2 backend. See Docker’s GPU support guide.
The first start can take a while as Docker pulls the image and the application initializes. Once the container is running and the interface responds, open http://127.0.0.1:3000. If port 3000 is occupied, choose another available host port, such as 3001. Use that new port in the browser and leave the container port at 8080.
Step 2. Create the admin account and pull a model
On an empty Open WebUI instance, the first account you create becomes the primary administrator. Sign in on the new local instance. Then pull the model from the same terminal where you ran Docker.
docker exec open-webui ollama pull gemma3:1bdocker exec open-webui ollama listWait until the download completes and confirm gemma3:1b appears in the list. Putting the Ollama command after docker exec open-webui tells Docker to run it inside the bundled container. Running ollama pull on the host would target a separate native Ollama installation if one is present.
You can also manage models from the Open WebUI admin interface. Go to Admin Panel → Settings → Connections and open the Ollama management controls. The official screenshot below illustrates the controls. Some labels and styling can vary by release.

Step 3. Select the model and verify your first chat
Open a fresh chat. Expand the model selector near the top of the page and select gemma3:1b. If you are an administrator, typing an unavailable model name in the selector can also offer a download shortcut. The official screenshot illustrates that shortcut with a sample model. Use the gemma3:1b tag for this walkthrough.

Start with a short task based entirely on the facts you provide. That makes it easy to check whether the model actually followed your instructions.
Turn these notes into three bullet points. Keep the exact date
and time and do not add details.
Meeting: 8 December at 2:30 p.m.
Location: Room 4
Bring: the printed project briefCheck for the exact date, time, room number, and document name. A successful response confirms that the browser, Open WebUI, and Ollama can communicate. It also gives you an early sense of how faithfully the small model follows formatting instructions. If the first reply is slow, give the runtime time to load the model and try a second prompt before comparing performance.
docker exec open-webui ollama psRun that command while the model is loaded. The PROCESSOR column can show CPU, GPU, or a split. A small model is a practical way to validate the setup. Move to a larger model only if your hardware has room and the tasks you care about need better output.
Already using Ollama? Reuse the models you have
Use the standard Open WebUI image and connect it to the existing Ollama backend. For Ollama running directly on the same computer as Docker, Open WebUI documents http://host.docker.internal:11434 as a common endpoint. On Linux Docker Engine, you may need to add the host gateway mapping when creating the container. Enter the connection in Admin Panel → Settings → Connections.
From inside a Docker container, localhost refers to that container. If Ollama runs on your computer outside Docker, pointing Open WebUI to http://127.0.0.1:11434 from inside its container points it at the wrong place. If a host gateway resolves but the connection still fails, check which interface Ollama listens on and whether the host firewall permits access from the Docker network. Keep the Ollama API accessible only to the clients that need it.
Open WebUI and Ollama Docker Compose setup
Save this example as docker-compose.yml in a new folder. Add a .env file in the same folder and set WEBUI_SECRET_KEY to a long, random value. Keep the secret private and retain it when you recreate the service. This example uses port 3001 so it can coexist with the port 3000 setup above.
services:
ollama:
image: ollama/ollama:latest
restart: unless-stopped
volumes:
- ollama-data:/root/.ollama
open-webui:
image: ghcr.io/open-webui/open-webui:main
restart: unless-stopped
depends_on:
- ollama
environment:
OLLAMA_BASE_URL: http://ollama:11434
WEBUI_SECRET_KEY: "${WEBUI_SECRET_KEY:?Set WEBUI_SECRET_KEY in .env}"
ports:
- "127.0.0.1:3001:8080"
volumes:
- webui-data:/app/backend/data
volumes:
ollama-data:
webui-data:Run these commands from the folder containing the Compose file. Wait for Ollama to start before running the model download.
docker compose up -ddocker compose psdocker compose exec ollama ollama pull gemma3:1bOpen http://127.0.0.1:3001, create an administrator account for this instance, and select gemma3:1b. Open WebUI reaches the Ollama Docker Compose service at http://ollama:11434 through the project’s network. Only the WebUI port is published to the host, and both services use fresh project volumes. If the model is missing, check docker compose logs ollama and confirm the model is present with docker compose exec ollama ollama list. See Docker’s Compose networking guide and the Ollama Docker guide.
Troubleshoot an empty model list or a slow reply
| Symptom | Check | Next action |
|---|---|---|
| Browser cannot connect | Check the container status and startup logs. | Open the host port you mapped and allow initialization to finish. |
| Chat screen opens, but no models appear | Run docker exec open-webui ollama list for the bundled install. | Pull a model if the list is empty. If the model exists, check the configured Ollama connection and refresh. |
| Model exists in your terminal but disappears in the interface | Compare host Ollama with bundled Ollama. | Pull the model into the instance Open WebUI is actually using, or switch the connection to the existing instance. |
| Reply starts slowly or generation stalls | Check the loaded model, processor, and current memory pressure. | Start with a smaller model and a shorter conversation. Compare the first and second request separately. |
| Chat history or model files seem missing after an update | Inspect the mounts on the replacement container. | Reconnect the original named volumes before creating new user data. |
docker volume lsdocker inspect open-webui --format '{{json .Mounts}}'Record the image version and keep a backup of the application data before an upgrade. If you tried several commands from different tutorials, check the volume names carefully. Two commands can mount data to the same path inside the container while using different volumes on the host.
What stays local and what can leave your machine
A plain chat with a downloaded Ollama model can run locally after setup. Pulling the Docker image or downloading a new model still needs network access. If you connect a cloud model provider, enable internet search, or configure a feature to use an external service, that feature can send data outside the computer. Check the active provider for each workflow before you use it with sensitive files.
Start with a sample text file or harmless prompts. If offline operation matters, download the dependencies first, disconnect your network, and repeat a basic chat. Test document processing, embeddings, and other optional features separately because their configuration can differ from the chat model.
Project 1. Benchmark two Ollama models on your own computer
Use this project to decide which model you would actually keep installed. Start with gemma3:1b. If you have enough disk and memory, pull gemma3:4b and run the same tests on both. Ollama lists the 4B tag as a larger download and as supporting both text and image input. Keep this comparison text-only so both models receive the same input.
docker exec open-webui ollama pull gemma3:4bdocker exec open-webui ollama listCreate three fresh chats per model. In the first, repeat the meeting-notes prompt from the setup. In the second, give the model a short inventory list and ask it to find the cheapest item while preserving the currency. In the third, ask it for an exact two-field JSON object from a support message. Save the outputs verbatim. Rate a JSON response as a failure if you cannot parse it without edits, even when the fields look correct.
Extract order_id and issue as a JSON object with exactly those keys.
Message: Order A-184 arrived with a cracked lid.Measure time to the first visible reply and time to completion. Compare the first request after a model loads with a repeated request in a new chat. Keep the model, conversation length, and optional tools fixed within each comparison. Check docker exec open-webui ollama ps during generation to note whether it ran on CPU, GPU, or both. Treat those observations as measurements of your hardware and workload.
| Test | Passing result | What failure tells you |
|---|---|---|
| Meeting summary | Three bullets preserve the date, time, and room. | The model may need clearer constraints or a second review. |
| Inventory | The answer names the cheapest item and copies its price correctly. | The model may be unreliable for even simple comparisons in that format. |
| Support message | The response parses as JSON and has two correct fields. | Validate outputs before sending them to another application. |
Assignment: Pick one default model and write down the workload it passed, how long a reply took, and one task for which you would choose a different model. Repeat the three prompts after changing the default model in your workspace.
Project 2. Build a local document Q&A assistant
Open WebUI Knowledge lets you attach reference files to a conversation or a model. With retrieval augmented generation (RAG), the application retrieves relevant excerpts and gives them to the model. Full text mode includes the whole attached file in context. Start with a small text file in full text mode to isolate whether the model can answer from a clean reference. Move to retrieval once that baseline works.
Build a reference file with known answers
Save the following as demo-equipment-policy.txt. This is a fictional policy for the exercise.
Equipment checkout policy
An employee may borrow one monitor for up to 14 calendar days.
A manager must approve any extension in writing before the return date.
Return equipment to the second-floor service desk.
If equipment is damaged, report it to the service desk within one business day.- Open Workspace → Knowledge, create a private knowledge base named Equipment policy lab, and upload the file.
- Open a fresh chat and attach the knowledge base. For the first test, use the full text option on the attachment where available. Ask about the maximum checkout period and the return location.
- Check for 14 calendar days and the second-floor service desk. Then ask how much the late fee is. The file does not specify a fee, so the answer should say the policy gives no amount.
- Repeat with focused retrieval. For native knowledge tools, choose a model that supports native function calling and verify Builtin Tools and the Knowledge Base tool category are enabled. Model size alone does not establish that a model can use these tools.
Use only the attached equipment policy. Quote one sentence that
supports each answer. If the file gives no answer, say that the
policy does not specify it.
Who approves an extension, and when?The expected answer is a manager, in writing before the return date. Check the quoted sentence against the file. If the interface shows a source citation, open it. A visible citation confirms a source was associated with the response. Read the excerpt to establish whether the source actually supports the claim.

Diagnose retrieval before changing models
If a PDF answer is wrong, open the file in Workspace Knowledge and inspect the indexed text. A scanned page may show fine in the Preview tab while the extracted text is missing or incomplete. In that case, use a searchable version or an appropriate OCR workflow and re-index. If the expected sentence exists in the indexed text, narrow the question and check that the intended knowledge base is attached. For a short reference, compare full text mode so you can see whether retrieval or the model introduced the error.
Change one setting at a time. After changing an embedding model, follow the documented procedure to re-index existing content. For offline use, verify the extraction and embedding providers separately from Ollama. A local chat model can coexist with a remote document processor. The provider settings determine where a file or its extracted text is processed.
Assignment: Create a second fictional policy whose answer to the checkout question is different. Attach one source at a time and verify each answer. Attach both and ask the model to identify the conflict by file name. Pass only if it distinguishes the two documents and makes the disagreement explicit.
Project 3. Run a backup and recovery drill
Use the named volumes from the walkthrough. Back up Open WebUI application data before updating. The examples below use a POSIX shell and write an archive into the current folder. On Windows, use PowerShell and replace "$PWD:/backup" with "${PWD}:/backup". For the restore command, use "${PWD}:/backup:ro". In Windows Command Prompt, the equivalents are "%cd%:/backup" and "%cd%:/backup:ro". Run the commands from the folder where the backup should live. Keep backups private because they can contain chat history, uploaded files, and account data. If you need to reproduce the exact model environment without downloading again, also archive the Ollama volume or record the model tags and IDs from ollama list.
docker stop open-webuidocker run --rm -v open-webui:/data:ro -v "$PWD:/backup" alpine tar -czf /backup/open-webui-backup.tar.gz -C /data .docker start open-webuitar -tzf open-webui-backup.tar.gzVerify the archive exists and lists entries before relying on it. Restore into a new, empty volume for the drill. This preserves the live volume and puts you in a position to examine the recovery before switching traffic.
docker volume create open-webui-restore-testdocker run --rm -v open-webui-restore-test:/restore -v "$PWD:/backup:ro" alpine tar -xzf /backup/open-webui-backup.tar.gz -C /restoreFor a full drill, start a second instance on loopback port 3001 using the original image version, the recovered test volume, and a separate Ollama volume. Reuse the application secret from the backed-up instance where it is required for continuity. Sign in at port 3001, find a known test chat, and open a file that was part of the knowledge base. A successful archive listing alone does not prove that the credentials or UI workflows recover.
How to safely update Open WebUI with Docker
This update sequence is for the bundled :ollama installation above. Finish the backup drill and verify the archive first. Keep a record of the currently running image and the Docker run options, including the secret, port, and any GPU flags. Pull the new image while the old container is still running. Continue only if each command succeeds.
docker pull ghcr.io/open-webui/open-webui:ollamadocker stop open-webuidocker rm open-webuidocker run -d --name open-webui --restart unless-stopped -p 127.0.0.1:3000:8080 -v open-webui:/app/backend/data -v ollama:/root/.ollama -e WEBUI_SECRET_KEY=REPLACE_WITH_LONG_RANDOM_SECRET ghcr.io/open-webui/open-webui:ollamaUse your existing WEBUI_SECRET_KEY in the last command. Both original named volumes are mounted again: open-webui preserves accounts, chats, and uploads, and ollama preserves the downloaded models. For the separate Compose setup above, run docker compose pull open-webui followed by docker compose up -d open-webui from the Compose project folder to update just the WebUI image.
After startup, check docker logs --tail 50 open-webui, sign in, open a known conversation, and send a test prompt. If an upgrade migrated the database, recovery may require the previous image and a restore of its matching pre-update backup. For a shared deployment, review release notes and pin the tested image version. See the official Open WebUI update guide.
Deploy for a small team and verify access
Move beyond localhost only after the local chat and restore drill pass. For a small team, run Open WebUI behind an HTTPS reverse proxy on a private network, using separate named accounts and least-privilege roles. Keep Ollama on a private interface or container network. If the proxy runs on the same host as Open WebUI, the loopback port is a suitable upstream. If it runs inside a separate container, use the shared network and service name.
- Record the tested image version and set a maintenance window before rolling out changes. Keep an application-volume backup from before the update because database changes can make an image rollback alone insufficient.
- Use the official reverse proxy example for your proxy. Set the public application URL and permitted browser origin to the intended HTTPS address where the deployment requires it. Preserve WebSocket support and confirm streaming replies through the proxy.
- Create a normal user and an admin account. Sign in as the normal user in a separate browser session. Confirm that the user can chat with an allowed model and cannot open a private knowledge base created by another user.
- Run an oversized test file and a normal test file. Verify that the server handles uploads within its configured limits and displays a clear error above those limits.
- Repeat the exact same basic chat, document question, and role checks after each upgrade. Record the image version, test date, and result.
Final project. Deliver a private assistant with a recovery plan
Build a small assistant that answers questions about two fictional documents. Write five test questions before loading the files. Include two questions with exact answers, one with missing information, one that compares the documents, and one for which the documents disagree. Record the expected results and open every citation you use as evidence.
| Skill | Proof you can do it |
|---|---|
| Install and diagnose | Explain which port belongs to the browser, which backend runs the model, and how to distinguish an empty model list from a connection failure. |
| Choose a model | Compare two candidates on the same prompts and justify the default with results you recorded. |
| Verify document answers | Check all five questions, including the missing-answer and conflict cases, against the indexed text. |
| Operate the service | Back up, restore to a separate volume, and verify a known chat and file after recovery. |
| Validate team access | Confirm a standard user can use the intended model while private knowledge remains restricted. |
Frequently asked questions
Do I need an API key?
The bundled Ollama walkthrough uses a model downloaded locally. It needs no third-party AI provider key. The WEBUI_SECRET_KEY in the Docker command is an application secret for your own installation.
Can I run this without a dedicated GPU?
Yes. The bundled image supports a CPU-only run. Start with the small model used here and judge response speed on your machine. If you add an NVIDIA GPU later, follow the platform-specific Docker guide before changing the container options.
Can I use the 1B model for images?
The Ollama library lists gemma3:1b as text-only. Some larger Gemma 3 tags support image input. Check the tag and make sure your hardware has enough memory before switching.
Where are chats and models stored?
In the bundled setup, Open WebUI data is in the open-webui volume, and Ollama model files are in the ollama volume. A browser bookmark helps you find the interface. The volumes hold the application and model data that you need to preserve when replacing the container.
Can I install Open WebUI without Docker?
Yes. In a Python 3.12 virtual environment, install it with the first command and start it with the second. Open http://localhost:8080 in your browser.
python -m pip install open-webuiopen-webui serveCan I connect OpenAI or Claude API keys?
Yes. Go to Admin Panel → Settings → Connections and add a provider under OpenAI API Connections. Use https://api.openai.com/v1 with an OpenAI key, or https://api.anthropic.com/v1 with an Anthropic key for Claude. Local Ollama models can stay available alongside these connections. Chats sent to either cloud provider require internet access and go to that provider. See the OpenAI-compatible setup and the Claude setup.
Related Links
- n8n AI Agents workflow tutorial
- Google AI Studio masterclass
- Best AI coding tools guide
- Agentic AI explained

