AI & LLM Tools

Open WebUI with Ollama: Local and Remote Setup Guide

J
James Eriksson
··13 min read
Run Open WebUI and Ollama locally or split them for better performance. Pick models by RAM/VRAM, set up Docker or native install, and troubleshoot connection issues.
TL;DR
  • Open WebUI is a ChatGPT-like interface; Ollama runs language models locally. You can run both on one machine or split them for better performance.
  • Model size depends on your RAM and VRAM: 7B models need 4.7GB, 70B models need 40GB. Start with Mistral or Llama 2 in Q4 quantization if unsure.
  • Local setup: install Ollama, pull a model, then run Open WebUI with Docker. Remote setup: expose Ollama with OLLAMA_HOST=0.0.0.0:11434, then point Open WebUI to its IP with the OLLAMA_BASE_URL environment variable.
  • Managed Open WebUI services (like Opsily) let you skip the ops work while keeping Ollama on your hardware or moving both to managed hosting.
  • Common issues: models not appearing (refresh the page or check the Ollama URL), connection refused (firewall or wrong IP), and slow inference (model too large for your hardware).

Open WebUI and Ollama together give you a complete self-hosted AI chatbot setup. Open WebUI provides a ChatGPT-like interface, while Ollama runs language models locally on your hardware. You can run both on one machine, or split them across two for better performance and flexibility.

How Open WebUI and Ollama Work Together

Open WebUI is a web interface for conversing with language models. Ollama is the engine that downloads and runs those models. Think of Open WebUI as the dashboard and Ollama as the motor underneath. By default they communicate over localhost on your machine, but you can also run them separately and connect over a network. Open WebUI with 158.0k GitHub stars and Ollama with 186.1k stars are both actively maintained and widely used for AI self-hosting. Both projects add features regularly: Ollama released v0.40.15 in November 2026, and Open WebUI stays current with 20,281 commits in active development. The two projects were designed to work together, so they handle all the handshake details automatically as long as you point Open WebUI at the right address.

Your first decision is whether to run both on one machine or split them. A single-machine setup is simpler: you install both, pick a model, and start chatting. A split setup gives you flexibility: you could run Ollama on a GPU-heavy server in your basement while Open WebUI runs on a small cloud instance or laptop. This also lets multiple people use the same Ollama instance. You can even use a managed Open WebUI service (like Opsily's hosted offering) while keeping Ollama self-hosted on your own hardware.

Choosing the Right Ollama Model for Your Hardware

Ollama supports hundreds of models. Picking the right one depends on your RAM, VRAM, and whether you have a GPU. The wrong choice wastes money and time; the right one runs smoothly. Start with your machine's specifications: note your RAM, whether you have a dedicated GPU (NVIDIA, AMD, or Apple Silicon), and how much VRAM that GPU has. Desktop or server? Laptop? Raspberry Pi? Your hardware determines which models will fit.

Model sizing scales with parameter count. A 1B model takes roughly 500MB to 2GB. The 7B models (Mistral, Llama 2) run in 3.5GB to 8GB. The 13B models (Openchat, Orca) need 8GB to 16GB. Larger models like Llama 2 70B demand 40GB of memory or VRAM. The 405B models from Llama 3.1 need 231GB and are beyond most personal setups. Dan Vega's benchmarks (from his blog) confirm this: an 8B model on your machine needs about 4.7GB of available memory, and a 70B model needs around 40GB.

Quantization matters. Ollama downloads models in different formats: FP16 (full precision, largest), Q5 (5-bit, high quality), Q4 (4-bit, good middle ground), and Q3 (3-bit, smallest but lossy). A 7B model in FP16 takes 14GB. The same model quantized to Q4 takes 4GB. You trade a tiny loss in quality for huge savings in size and speed. Most people start with Q4: fast, accurate enough, and fits in modest hardware.

Hardware floor: 8GB RAM minimum for CPU-only inference on small models. Want GPU acceleration? 16GB RAM plus a dedicated GPU (6GB VRAM minimum, 12GB+ recommended) gets you to 13B models. A 24GB VRAM card (like an RTX 3090 Ti or RTX 4090) lets you run 70B models smoothly. The rule of thumb: take the model size in GB, add 2-3GB for overhead, and ensure your GPU has that much VRAM, or your system has that much RAM if you're using CPU only.

Local Setup: Ollama + Open WebUI on One Machine

Running both on one machine is the simplest path. Install Ollama first, then Open WebUI, point them at each other, and go. Both tools offer Docker containers, native installers, and source builds. Docker is easiest because you skip dependency issues.

Start with Ollama. Download from ollama.com for Windows, macOS, or Linux. The installer adds Ollama to your PATH and starts the service automatically. Run ollama serve in a terminal to confirm it's running on the default port. Now pull a model: ollama pull mistral for a 7B model that fits most machines, or ollama pull llama2 for another solid 7B option. The first pull takes minutes to download gigabytes of data. Subsequent pulls are faster.

Next, install Open WebUI. Use Docker: docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway ghcr.io/open-webui/open-webui:main. This starts Open WebUI on your local machine and tells it to reach Ollama through Docker's host gateway (Docker's way of saying "the host machine"). The --add-host flag handles the networking for you.

Alternatively, install Open WebUI with pip or pipx: pip install open-webui then open-webui serve. Both methods work; Docker is cleaner for keeping your system tidy.

Open your browser to the local Open WebUI interface (the Docker command above will show the URL). Create an account, and Open WebUI will auto-detect Ollama on your machine. Start a conversation; it should list the models you pulled. If models don't appear, check that Ollama is running by testing the API endpoint. Open WebUI caches the model list, so refresh the page if you just added a new model.

This setup works for personal use or small teams on one network. All data stays on your machine. No cloud, no API keys.

Remote Setup: Open WebUI Connects to a Separate Ollama Server

Run Open WebUI on one machine and Ollama on another when you want to separate the interface from the compute. Ollama can saturate a GPU while Open WebUI needs minimal resources. You keep the expensive hardware in one place and access it from anywhere on your network.

Start with the Ollama server machine. Install Ollama and pull your models as before. By default, Ollama only listens on localhost for security. To let other machines connect, set an environment variable and restart. On Linux: OLLAMA_HOST=0.0.0.0:11434 ollama serve. On macOS, edit ~/.zprofile or ~/.bash_profile to add export OLLAMA_HOST=0.0.0.0:11434, then restart the Ollama app. On Windows, set the system environment variable OLLAMA_HOST and restart the service.

Test connectivity from another machine on the network by querying the Ollama API endpoint. If that returns a JSON list of your models, Ollama is reachable.

Now deploy Open WebUI on a different machine. Use Docker with the OLLAMA_BASE_URL environment variable:

docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=http://<ollama-machine-ip>:11434 ghcr.io/open-webui/open-webui:main

Replace <ollama-machine-ip> with the IP address of your Ollama server (e.g., 192.168.1.50). Open WebUI will connect to Ollama on startup and pull the model list.

Network considerations: both machines must be on the same network or have routing configured. If they're behind a router, use local IP addresses (192.168.x.x or 10.x.x.x). If they're in different data centers, you need a VPN or reverse proxy. Firewalls matter: make sure port 11434 is not blocked between the two machines. If Open WebUI can't connect, test the connection to debug. No response means a firewall is in the way.

Security: Ollama on 0.0.0.0:11434 has no authentication. Anyone with network access can use your Ollama instance (and rack up compute bills if you're on cloud). For production, add a reverse proxy like Nginx with basic auth, or keep Ollama on a private subnet away from the internet. This setup is safe for home networks. Do not expose port 11434 to the internet without a proxy.

Connecting Managed Open WebUI to Your Ollama Instance

Some teams prefer not to manage Open WebUI themselves. Opsily and other providers offer managed Open WebUI: they host it, handle updates, and scale the interface for you. You run Ollama yourself (on your hardware or another provider), and connect the managed instance to it.

With a managed Open WebUI, you get a dashboard at a provider's domain. You still control Ollama. This splits responsibility: Opsily handles uptime and security of the interface, you handle the model server. The managed instance talks to your Ollama over the internet (if you expose it with a reverse proxy and authentication) or over a private connection (if you have a VPN or dedicated link).

To connect: the managed Open WebUI dashboard has a settings pane for model providers. Enter your Ollama server's URL with authentication configured. The managed instance pulls your model list and lets your team chat with your Ollama models through a professional interface.

The trade-off: you pay a monthly fee for the managed Open WebUI (see /hosting/open-webui/open-webui-pricing for current rates), but you avoid managing web server certificates, scaling the interface, patching security updates, and debugging deployments. You pay less to host Ollama because it's compute-only; the interface lives on a managed platform. This works well for teams: shared login, usage tracking, and professional uptime.

You can also run both managed: Opsily or another provider runs your Ollama server and Open WebUI together. You get a single dashboard, no ops work, and predictable pricing. This is the hands-off option and costs more but suits busy teams.

Common Issues and Troubleshooting

Models don't appear in Open WebUI after I pulled them with Ollama. Check that Ollama is running with the appropriate process monitor for your operating system. Reload the Open WebUI page; it caches the list. If still blank, click Settings > Models and manually add the Ollama URL for local or remote setup. If the URL is wrong, Open WebUI shows an error; fix the URL and click Connect.

Connection refused or timeout. Open WebUI can't reach Ollama. Local setup: ensure Ollama is running. Remote setup: verify the IP address and port. Test the connection from the Open WebUI machine. If the test fails, a firewall is blocking it or the IP is wrong. Check your network and firewall rules.

Models run slowly or use all my RAM. You picked a model too large for your hardware. Stop the model (chat sidebar, pause icon or quit). Pull a smaller model: ollama pull mistral instead of ollama pull llama2-70b. Or quantize: Ollama defaults to Q4; check ollama list to see what you pulled. Rerun with a smaller quantization (e.g., ollama pull mistral:q3-k-m for aggressive compression).

GPU not being used. Ollama defaults to CPU. Set the CUDA_VISIBLE_DEVICES or ROCM_VISIBLE_DEVICES environment variable before starting, or run ollama pull <model>:gpu (if available). For NVIDIA: restart with CUDA_VISIBLE_DEVICES=0 ollama serve. Confirm with ollama ps (running models) and check if GPU memory is in use with system monitoring tools.

Port 11434 already in use. Another service is using that port. Change Ollama's port by setting the environment variable and restarting. Then update Open WebUI to point to the new port.

Performance Optimization Tips

Ollama infers models on CPU by default if GPU support is not detected. For faster responses, enable GPU acceleration. On Linux with NVIDIA, ensure CUDA drivers are installed and restart Ollama; it auto-detects CUDA. On macOS with Apple Silicon, Ollama uses the Neural Engine automatically. On Windows with NVIDIA, install CUDA toolkit and let Ollama find it on restart.

Batch inference vs. streaming. Ollama defaults to streaming: tokens appear one at a time in Open WebUI. This feels fast but uses less GPU parallelism. Batch inference waits for the full response, using more VRAM but finishing faster. Open WebUI doesn't let you switch easily, so test both with ollama run <model> in the terminal to see which feels better for your use case.

Model offloading. If you have limited VRAM, Ollama can offload layers to RAM. As Ollama processes tokens, some layers stay in RAM and are moved to VRAM as needed. This is slower than keeping the whole model in VRAM but avoids out-of-memory crashes. Set the num_gpu variable when pulling: ollama pull mistral --num-gpu 10 to keep 10 layers on GPU and offload the rest.

Temperature and context window. Open WebUI's Settings > Parameters let you tune model behavior. Lower temperature (0.1-0.5) = more focused, repetitive answers. Higher temperature (0.7-1.2) = creative, varied answers. Increasing the context window (how many previous messages the model remembers) uses more memory; start at the model's default and increase gradually.

Network latency in remote setups. If Open WebUI and Ollama are far apart (different data centers), network latency adds 10-100ms per request. Keep them on the same LAN if possible, or use a VPN to reduce round-trip time. Batch large requests instead of streaming for network-constrained setups.

Next Steps

You now have a working Open WebUI + Ollama setup, local or remote. If you're running this for a team or want to ditch the ops work, Opsily offers managed hosting for Open WebUI. You can keep your Ollama server or let us host that too. Visit /hosting/open-webui to explore pricing and deployment options.

Multiple models at once? Open WebUI supports switching between models per-conversation. You can run several small models or one large one, depending on your hardware. As your use cases grow, consider /hosting/open-webui/hosted-open-webui for a fully managed setup that scales.

Frequently Asked Questions

What is the difference between Open WebUI and Ollama?

Ollama is a language model engine: it downloads and runs models on your hardware. Open WebUI is a web interface for chatting with those models. Ollama is the backend; Open WebUI is the frontend. You need both: Ollama to serve models, Open WebUI to access them.

Can I run Open WebUI without Ollama?

Yes, but you need another language model backend. Open WebUI supports OpenAI, Anthropic, Hugging Face, and other APIs. You can also run other local backends like vLLM or LM Studio and point Open WebUI to them via their APIs. Ollama is popular because it's free and self-contained.

How do I download models for Ollama?

Use the ollama pull <model-name> command. Ollama has a model library at ollama.com/library. Try ollama pull mistral for a 7B model or ollama pull neural-chat for a conversation-tuned 7B. The first pull downloads gigabytes; subsequent pulls are instant if the model is cached.

How do I run Open WebUI with Docker?

Use the official image: docker run -d -p 3000:8080 ghcr.io/open-webui/open-webui:main. This starts Open WebUI on your local port 3000. For Ollama on the same machine, add --add-host=host.docker.internal:host-gateway so Open WebUI can reach your Ollama service. For Ollama on another machine, add -e OLLAMA_BASE_URL=http://<ip>:11434.

How do I create custom Open WebUI agents or workflows?

Open WebUI supports function calling and Python-based agents. In the interface, go to Workspace > Tools to write custom tools. Advanced users can edit the Open WebUI source (Python/Svelte) to add custom logic. Cohorte's guide covers building a Python agent that chains Ollama responses; it's worth reading for examples.

Does Open WebUI support multiple users?

Yes. Open WebUI has built-in user accounts, roles (admin/user), and conversation isolation. Each user sees only their conversations. Managed Open WebUI (like Opsily's offering) adds team features: shared model access, usage limits, and audit logging.

Can I secure Ollama on a remote server?

Ollama has no built-in authentication. Use a reverse proxy (Nginx, Caddy) with basic auth or TLS certificates. Or keep Ollama on a private subnet and access Open WebUI through a VPN. For production, do not expose Ollama to the internet unguarded.

The Bottom Line

Open WebUI and Ollama are a powerful pair for self-hosted AI. Start with a single-machine setup if you're new: install Ollama, pick a model that fits your hardware, then add Open WebUI. If you want to scale or avoid ops work, split them across machines or move to a managed service. The architecture grows with you. For a hands-off setup that handles scaling and security, check out /hosting/open-webui for Opsily's managed Open WebUI hosting options.

Skip the self-hosting ops
Opsily hosts Open WebUI with zero downtime, automatic updates, and team features. Connect your Ollama or let us run that too.
Get Started Free

Ready to self-host your own apps?

One server. Multiple apps. No per-app fees.

Get started →