How to run Ollama 24/7 on a Mac mini
A Mac mini with Apple silicon is one of the nicest boxes you can buy for running local models. Unified memory means the GPU can use most of the RAM, it is silent, and it idles at a few watts.
Getting Ollama to run on it is a two-minute job. Getting it to run all the time, reachable from your other devices, and back on its own after a crash, a reboot or a power cut, takes a bit more. Here is the full setup.
1. Install Ollama
Two ways, pick one.
The Ollama app from ollama.com: drag it to Applications, open it once. It runs in the menu bar and starts at login. Easiest, but it’s a regular app: it only runs once you are logged in.
Homebrew, which gives you a plain binary you can run as a service:
brew install ollama
which ollama # /opt/homebrew/bin/ollama on Apple silicon
For a server, we prefer the Homebrew binary under our own launchd job, below. Whichever you choose, don’t run both at once: they’d fight over port 11434.
Pull a model to check it works:
ollama serve & # temporary, just for this test
ollama run llama3.1:8b "Say hello in five words."
2. Run it as a service with launchd
launchd is macOS’s service manager. A small plist tells it to start ollama serve, set its environment, and relaunch it whenever it stops.
Save this as ~/Library/LaunchAgents/com.me.ollama.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>com.me.ollama</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/ollama</string>
<string>serve</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>OLLAMA_HOST</key><string>0.0.0.0:11434</string>
<key>OLLAMA_KEEP_ALIVE</key><string>-1</string>
</dict>
<key>RunAtLoad</key><true/>
<key>KeepAlive</key><true/>
<key>StandardOutPath</key><string>/tmp/ollama.log</string>
<key>StandardErrorPath</key><string>/tmp/ollama.log</string>
</dict>
</plist>
Load it and check it’s running:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.me.ollama.plist
launchctl print gui/$(id -u)/com.me.ollama | grep state
curl http://localhost:11434/api/tags
What each piece does:
RunAtLoadstarts Ollama as soon as the job loads, at every login.KeepAliverelaunches it if it crashes or gets killed. Trypkill ollamaand watch it come back.OLLAMA_KEEP_ALIVE=-1keeps a model in memory instead of unloading it after the default five minutes, so the first request of the morning isn’t slow. Drop it if you switch between many big models.
If you used brew services start ollama before, stop it first (brew services stop ollama) so you don’t end up with two.
Agent or daemon?
A LaunchAgent starts when your user logs in. If you want Ollama up right after boot with no login at all, put a similar plist in /Library/LaunchDaemons/, owned by root, with a UserName key set to your account (so it doesn’t run as root) and OLLAMA_MODELS pointing at your models folder (by default ~/.ollama/models). It then starts as soon as macOS is up, login window or not.
3. Serve it on your network
By default, Ollama listens on 127.0.0.1:11434: only the Mac itself can talk to it. Setting OLLAMA_HOST to 0.0.0.0:11434, as in the plist above, makes it listen on every interface, so your laptop, your phone or another server at home can use it.
Note that a line in your .zshrc won’t do it: launchd doesn’t read your shell profile. If you use the Ollama app rather than your own job, the official way is:
launchctl setenv OLLAMA_HOST "0.0.0.0:11434" # then quit and reopen the Ollama app
That setting doesn’t survive a reboot, which is one more reason to prefer the plist.
From another machine on your network:
curl http://192.168.1.50:11434/api/tags
Give the Mac a fixed address (a DHCP reservation in your router) so this URL never changes. If the macOS firewall is on and blocks the request, allow incoming connections for ollama.
One warning: Ollama’s API has no password. Serve it on your home network only. Never port-forward 11434 to the internet.
4. Keep the Mac itself awake and up
A perfect service on a sleeping Mac is still down. On the Mac mini, in System Settings › Energy, turn on “Prevent automatic sleeping when the display is off” and “Start up automatically after a power failure”. Or from the Terminal:
sudo pmset -a sleep 0
sudo pmset -a autorestart 1
The rest of the always-on basics (Ethernet, UPS, updates, alerts) are in our Mac mini home server checklist.
5. Surviving power cuts with FileVault on
Here is the trap. After a power cut, the Mac powers back on and stops at the FileVault screen. Your disk is locked, so launchd can’t start your Ollama job, agent or daemon. Everything waits for a password.
Don’t turn FileVault off to fix it: your Mac mini probably holds API keys and private documents, and it is easy to carry away. Instead:
- For restarts you choose,
sudo fdesetup authrestartrestarts without stopping at FileVault, once. - For power cuts, recent macOS on Apple silicon (macOS 26 or later) can unlock FileVault over SSH: with Remote Login on, connecting with your password at the FileVault screen unlocks the disk.
If your job is a LaunchDaemon, Ollama starts right after that unlock. If it’s a LaunchAgent, it waits for your user to log in. The full walkthrough, including how to reach the Mac from outside when nothing on it runs yet, is in How to unlock FileVault remotely after a power cut.
6. Reach it from your iPhone
At home, any iPhone app that speaks the Ollama API can point at http://192.168.1.50:11434. Away from home, don’t open a port: connect your iPhone to your home network through a VPN. The most robust option is a VPN server on your router (WireGuard on a Freebox, a FRITZ!Box and some others), because it works even when the Mac is stuck before macOS starts. See if your box has one in our router list.
7. Memory sizing
On Apple silicon, the model has to fit in unified memory alongside macOS and anything else you run. As a rough guide for 4-bit quantized models (the Ollama default for most tags):
- 16 GB: 7B to 8B models comfortably.
llama3.1:8bis about 5 GB. - 24 to 32 GB: up to around 14B with room for long contexts, or a 30B-class model if you keep everything else light.
- 64 GB and up: 70B-class models become realistic.
Context length costs memory too, and more parallel requests multiply it. Check what’s loaded and whether it runs fully on the GPU:
ollama ps
If the PROCESSOR column shows a CPU share, the model doesn’t fit and part of it is running much slower. Pick a smaller model or a smaller quantization.
Where Macaron fits
Macaron watches over the Mac that runs all this. It can keep Ollama alive (it relaunches apps you mark, after a crash or a restart), alerts your iPhone when the Mac goes silent, and unlocks FileVault after a power cut with one tap and Face ID.
The short version
- Install Ollama with Homebrew and run
ollama servefrom a launchd plist withRunAtLoadandKeepAlive. - Set
OLLAMA_HOST=0.0.0.0:11434in the plist to serve your network; never expose it to the internet. - Use a LaunchDaemon if Ollama must run before anyone logs in.
- Turn off system sleep and turn on start up after a power failure.
- Keep FileVault on; unlock over SSH after cuts on macOS 26 and Apple silicon.
- Reach it from your iPhone through your router’s VPN.
- Size models to your memory and check
ollama ps.
If you’d like your Ollama box to look after itself, download Macaron for Mac, it’s free. The homepage shows what the iPhone app adds.