By Daniel Rohregger, Microsoft MVP Published Updated
This article shows you how to install Microsoft Foundry Local, including the Phi-4 and Phi-4 Reasoning models, on a current version of macOS, with Open WebUI as a graphical interface that makes it easy to use local large language models offline.
macOS version: macOS Tahoe 26.2
Homebrew version: 5.0.8
Foundry Local version: 0.8.117
Open WebUI version: v0.6.43
There’s also a step-by-step video walkthrough on YouTube, on the 365 Checkpoint channel.
Installing Homebrew and Microsoft Foundry Local
You’ll do the whole installation in the macOS Terminal. Open a new, regular Terminal window.
First, install Homebrew if you don’t have it yet, using the current command below. If the command has changed, you’ll always find the latest one at https://brew.sh.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You’ll be asked for your password once. You need an account with admin rights; confirm with Return. The installation then takes a few minutes.
When it’s done, you need to run three commands to add Homebrew to your user path. The easiest way is to copy them straight from Homebrew’s own instructions in the Terminal, since those already contain the right paths for your system.
echo >> /Users/<Username>/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/<Username>/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Next, install Foundry Local with this command:
brew tap microsoft/foundrylocal
and this one:
brew install foundrylocal
Microsoft lists the same two macOS commands in its Foundry Local CLI documentation. That Foundry Local runs entirely on your own device and needs no Azure subscription is stated in What is Foundry Local?.
Then use these commands to start the service and list the available models:
foundry service start
foundry model list
The following command installs an AI model and loads it into the cache. After a restart, it’s available again as soon as you start the service.
foundry model run <modelname>
Note: depending on the model and your internet speed, an install can take anywhere from a few minutes to quite a while. The GPT OSS model can take more than 30 minutes before it’s up and running.
After you install or “run” a model, it opens in interactive chat mode. You don’t need this mode to use the model later; it just lets you try the model right in the Terminal. To leave interactive chat mode on macOS, press:
CTRL+C
Installing Open WebUI
With Homebrew and Foundry Local installed, it’s time to add an interface.
Open WebUI is an open-source project that you’ll use as the interface for Foundry Local. It can do a lot more than that, but it also connects directly to a service running on your machine. So with this setup, you can use AI anytime, offline, without depending on other devices or an internet connection.
Installing Open WebUI takes a few prep steps before the actual install.
Preparing the Python environment for Open WebUI
brew install uv
Next, create a new folder for Open WebUI and the config files it generates, and switch straight into it:
mkdir ~/openwebui && cd ~/openwebui
Then set up and activate the Python environment:
uv init --python=3.11 .
uv venv
source .venv/bin/activate
Now you can install Open WebUI:
uv pip install open-webui
and start it:
cd ~/openwebui
source .venv/bin/activate
open-webui serve
Open WebUI is now running locally on your machine at http://localhost:8080.
Connecting Foundry Local to Open WebUI
A few more steps, and you can reach Foundry Local through the interface.
Important: keep both Terminal windows open (Open WebUI and Foundry).
Both services have to be running. So after every restart, run these commands again:
cd ~/openwebui
source .venv/bin/activate
open-webui serve
foundry service start
Creating an account in Open WebUI
Go to http://localhost:8080 and create an account. The account is entirely local, but write down the password anyway. If you lose it, you’ll have to reinstall Open WebUI. The account never goes online; it only identifies you on this installation.
Finding the Foundry service port
For Open WebUI to reach Foundry, you need to point it to the right port. The port is dynamic, which means it changes every time the service starts. Microsoft describes the same Open WebUI setup and the dynamic port in the CLI reference; there, the command in the current preview is foundry server status.
While the service is running, this command shows you which port it’s currently using:
foundry service status
> 🟢 Model management service is running on http://127.0.0.1:59338/openai/status
In this example, it’s 59338.
Connecting Foundry and Open WebUI
Now, in Open WebUI, click the profile icon, go to Admin Settings > Connections, and edit the URL for the OpenAI service.
To reach your local Foundry service, use this format:
http://localhost:<PORT>/v1
Set encryption to None.
You can test the connection with the small arrow icon. Once you save and start a “New Chat,” your installed models should show up.
Every time you restart your Mac, the Foundry port changes, so you’ll need to update it in the admin settings after each restart.
More useful commands
foundry service status # Check status
foundry service start # Start service
foundry service stop # Stop service
foundry service restart # Restart service
foundry model list # List available models
foundry cache list # List downloaded models
foundry cache clear # Clear cache (delete models)
brew upgrade foundrylocal # Update Foundry Local
This walkthrough covers Foundry Local 0.8.117. The CLI has since become a preview with changed commands; if you’re upgrading from 0.8.x, Microsoft says to stop the old service first with foundry service stop, then run brew update and brew upgrade microsoft/foundrylocal/foundrylocal.
Questions? Just leave a comment under the YouTube video!
What this means for your workday
Everything you need is in this article. If you want to apply it to your own setup, coaching for IT teams and admins is the place to start.