Turns an Apple silicon Mac into a headless model server: Ollama as a service that starts at boot, plus optional llama.cpp, DwarfStar (ds4) or MLX-Serve servers (one running, the others on standby), a memory guard, and firewalled LAN access.
curl -fsSL https://raw.githubusercontent.com/anurmatov/mac-studio-server/v1.7.2/bootstrap.sh | shOr clone it yourself: git clone https://github.com/anurmatov/mac-studio-server.git && cd mac-studio-server && ./scripts/install.sh.
Every question has a default; press Enter to take it. Installs and downloads happen only after a y.
- Xcode Command Line Tools, if missing (needed for git).
- Your password, once for the whole run.
- Which backends (several numbers, e.g.
1,3), whether to remove one you left out, and which runs now. - Missing Homebrew, Ollama,
llama-server,ds4-serverormlx-serve: install or build it? (default no) - A model: the starter (the default; MLX asks y/N first), another one, one found on disk (MLX), your own file or URL, or later.
- LAN access for llama.cpp, ds4 or MLX (default no; yes asks for an address and allowed clients).
- Headless macOS tweaks: no sleep, Spotlight, Time Machine or auto-updates (default no).
- GPU memory percent for every backend (1-100 or system), restart after a power failure (default off), installing Colima and the Docker CLI, and starting Colima at boot.
- A summary to confirm, then an Ollama starter model once the service is up.
./scripts/status.sh # health of every backend; exit 0 when all are healthy
./scripts/model.sh # add or switch the llama.cpp / ds4 model later
./scripts/install.sh --configure # choose again (re-running without a flag reuses the answers)
./scripts/backend.sh activate mlx # switch to a standby backend; also stop|start <backend>
sudo ./scripts/uninstall.sh --all # remove every service; models and logs are keptLogs: ~/mac-studio-server/logs/ (Ollama, install) and /var/log/mac-studio-server/ (llama.cpp, ds4, mlx, guard).
Ollama listens on all interfaces (0.0.0.0) by default and has no password; set OLLAMA_BIND=127.0.0.1 to keep it on this Mac.
- LAN access for llama.cpp, ds4 or MLX: answer yes in the installer. A macOS firewall (pf) allowlist guards the port; llama.cpp can use an API key file instead. See docs/backends.md.
- MLX-Serve: exactly
mlx-serve26.10.1 with a native MLX model directory; needs macOS 26.2 or later. See docs/backends.md. - GPU memory: set
MSS_GPU_PERCENT=80inbackends.envto let Metal use 80% of RAM for every backend. See docs/options.md. - Docker via Colima:
MSS_DOCKER_AUTOSTART=yes ./scripts/install.shstarts Colima at boot;MSS_DOCKER_INSTALL=yesinstalls what is missing. Power loss?MSS_POWER_AUTORESTART=yes. See docs/options.md. - Saved answers:
backends.envin the repository holds them, oneKEY=valueper line; config/backends.env.example lists every key. - Scripted installs: set
MSS_BACKENDSand the backend variables; nothing is asked. See docs/backends.md.
- A Mac with Apple silicon on macOS Sonoma or later, and an administrator account.
- Remote Login (SSH) on for headless use: System Settings → General → Sharing.
- Disk space for models: 2.5 GB for the starter; ds4 needs macOS 15 and 137 GiB or more.
- 1.7.0-1.7.2 MLX-Serve (LAN access in 1.7.1, a model chooser in 1.7.2), several backends at once,
backend.sh. - 1.6.0 GPU memory, Docker and restart-after-power-failure choices in the installer.
- 1.5.0 One-line install, guided downloads and builds, and
model.sh. - 1.3.0, 1.4.0 Optional llama.cpp and DwarfStar backends; the interactive picker and saved answers.
Current version: 1.7.2 (semver). History: CHANGELOG.md.
Issues and pull requests are welcome.
MIT, see LICENSE.