🧠 Hosting Ollama + Open WebUI on Apple Silicon – A Complete Guide

Date Created: 2025-05-07
By: 16BitMiker
[ BACK.. ]

I picked up a refurbished Mac with Apple Silicon—specifically an M2 model with 96GB of RAM—after spotting it at a surprisingly reasonable price. It wasn’t the latest generation, but the specs were exactly what I was looking for: powerful enough to experiment with large language models locally, without relying on cloud infrastructure or remote GPUs.

It’s been an incredible experience. With this setup, I’m able to run LLMs right on the machine, talk to them through a clean browser interface, and keep everything containerized and isolated using Docker. In this guide, I’ll walk you through everything I did to get Ollama and Open WebUI working together on macOS, including a networking trick with socat that bridges Docker to your local system.

Let’s get started. 🚀

🧰 What You'll Need

🛠️ Step 1: Install Required Tools

First, make sure you have the tools we’ll need:

Now start the Ollama service:

This runs a local HTTP server on port 11434 and makes Ollama ready to receive requests.

🧭 Step 2: Set Up Port Forwarding (Docker Can’t Talk to localhost Directly on macOS)

On macOS, Docker containers can’t directly reach services running on localhost. To work around this, we use socat to proxy traffic from an external port (11435) to Ollama’s internal service on localhost:11434.

📋 Option 1: Start Socat via Login Agent (macOS Launch Agent)

This method ensures the proxy starts automatically every time you log in.

🔹 Create a new .plist file:

Paste the following content:

🔹 Load the launch agent:

To unload it:

📋 Option 2: Start socat via ~/.zprofile

If you’d rather not use the macOS launch agent system, you can simply start the proxy on shell login:

This adds a background job to your login shell that starts socat and logs output to /tmp.

⚡ Handy Aliases in .zshrc

To simplify your workflow, add a few helpful aliases to your ~/.zshrc:

Apply your changes:

🐳 Step 3: Docker Compose for Open WebUI

Next, let’s launch Open WebUI using Docker Compose. This gives you a clean browser-based frontend for interacting with your local Ollama models.

📋 docker-compose.yml

Create a folder (e.g., ollama-webui) and save the following as docker-compose.yml:

🔹 Start the container:

🔹 Stop it when done:

🧪 Test It Out!

Let’s test the full stack:

  1. Start Ollama:

  2. Confirm the proxy is running:

  3. Open your browser to:

You should now see Open WebUI connected to your local Ollama instance.

🧠 Why I Love This Setup on Apple Silicon

This setup runs beautifully on Apple Silicon. Thanks to the M2’s performance and unified memory, even larger models respond quickly and don’t bog down the system.

Although my machine isn’t the newest on the block, its 96GB RAM and efficient chip architecture make it well-suited for serving and interacting with local AI models. The combination of Docker isolation, Ollama’s CLI server, and Open WebUI’s frontend makes for a clean and reliable environment.

✅ Final Thoughts

If you're exploring local LLM workflows on Apple Silicon, this is a setup worth trying. It’s lightweight, private, and fast. With Docker for isolation, a socat bridge for networking, and Open WebUI for interaction, it’s easy to spin up and maintain.

You don’t need the absolute latest hardware to get started. Just a well-equipped Mac and a little configuration, and you’ll be running your own local AI stack with no cloud dependencies.

Happy hacking! 🧪✨

📚 Read More