Skip to content

Run the CodeNavi server on a Mac (Apple Silicon)

The server runs on an Apple Silicon Mac (M1 or newer). Your install command installs the Mac build when you run it on a Mac. Request a trial to get one.

No GPU reaches a container on macOS. So the embedding model runs in Ollama on the Mac, which uses the Mac's GPU, and the server sends it text. The Mac build carries the model file and the installer loads it into Ollama for you.

What you need

Minimum
Mac Apple Silicon (M1 or newer), 16 GB memory. Intel Macs are not supported.
Disk 20 GB free
Podman 6.2 or newer (tested), its VM with 8 GB of memory, and podman compose working (step 1)
Ollama from ollama.com, running

The installer checks all four before it downloads anything, and names the fix for each one that is missing. It does not install Podman or Ollama for you.

16 GB runs search and indexing, or search and chat. Chat during a full index makes the Mac swap heavily, so more memory helps if you use chat.

The Wiki screen's compile also uses the chat model, for many minutes: on Laravel's 47 documents it took 16 minutes on 16 GB, and the Mac moved about 9 GB of the Podman VM's memory to swap. Search kept working during it. You cannot start a reindex until the compile ends.

1. Podman and Ollama

Install Podman from podman.io (the macOS installer). Its VM's default memory is too small for the server. Give it 8 GB:

podman machine init --memory 8192 --cpus 8 --disk-size 60
podman machine start

If the VM already exists: podman machine stop, podman machine set --memory 8192 --cpus 8, podman machine start.

podman compose needs a compose tool. Podman Desktop offers to install one. Without Podman Desktop, put Docker's docker-compose in your user folder (no admin rights needed):

mkdir -p ~/.docker/cli-plugins && cd ~/.docker/cli-plugins
B=https://github.com/docker/compose/releases/latest/download/docker-compose-darwin-aarch64
curl -fsSL -o docker-compose "$B" && curl -fsSL -o dc.sha256 "$B.sha256"
echo "$(cut -d' ' -f1 dc.sha256)  docker-compose" | shasum -a 256 -c && rm dc.sha256
chmod +x docker-compose
podman compose version

Install Ollama and open it once. When it asks to install its command-line tool, say yes: the installer uses the ollama command. Ollama then starts at login on its own.

2. Run the install command

Run the install command from your trial email or your install page, in your home folder:

curl -fsSL https://codenavi.com/trial/install/<your-token> -o codenavi-install.sh && sh codenavi-install.sh

On a Mac it installs the Mac build. It asks which repository to index, then:

  • downloads the installer and the image (about 2.4 GB) and checks both,
  • installs your licence into ~/codenavi/data/license.key,
  • loads the image into Podman and the embedding model into Ollama, under the name Buric-E0.6B (keep that name: with it, an index built on another CodeNavi server works on the Mac without a full rebuild),
  • adds a login item that starts CodeNavi each time you log in (macOS does not start the Podman VM by itself after a restart),
  • starts the server and prints your auth token.

Then open http://localhost:8765/ui, start the first index on the Index screen, and open http://localhost:8765/connect to wire your agent (connecting your agent). The auth token is also CODENAVI_AUTH_TOKEN in ~/codenavi/.env.

Set up by hand on 1.3.78? Run the same command once, in your home folder. It installs over ~/codenavi and keeps your index, your auth token, your repository setting and port 8765. It adds the login item and the update settings, so ./update.sh works from then on. No reindex is needed: on the test Mac it took under a minute.

Chat (optional)

The Chat screen uses a chat model in Ollama. Load one:

ollama pull llama3.1

No other setting is needed: the server finds Ollama on the Mac by default.

What to expect

Measured on a Mac mini M6 with 16 GB, on the Laravel framework (3,014 files, 29,950 chunks):

Task Time
Full index 12.5 minutes
Reindex after 10 changed files 23 seconds
Search, VM with 8 CPUs about 1.2 seconds
Chat answer, llama3.1 26 to 30 seconds

Search finds the same first result as a Linux GPU server for 18 of 20 test queries.

Good to know

  • Do not run Python tools inside the container while the server runs. Each one loads its own copy of the models, and the VM can run out of memory and stop the server. The codenavi command-line tool and the web UI go through the server.
  • Search runs on the VM's CPUs. The reranker cannot use the Mac GPU from inside the VM, so search time grows when the VM or the container gets fewer CPUs: on 2 CPUs the reranking step takes about twice as long as on 4. Keep the 8 CPUs from step 1 if you can.
  • A large reindex can make the Mac run hot. The embedding model runs on the Mac GPU at full speed. To slow it down, set CODENAVI_REINDEX_DUTY_PERCENT to 25 in data/settings.json and restart: the reindex then encodes a quarter of the time and takes four times as long. Searches are not slowed. Do not pause the container for this: a paused server answers no searches.
  • Ollama unloads idle models after 5 minutes. The first search after a pause takes a few seconds longer while the model loads again.
  • Updates: run ./update.sh in ~/codenavi, as on Linux. When the new image carries a new embedding model, it loads that into Ollama before the restart, so keep Ollama running. It needs python3 (the Xcode Command Line Tools, below).
  • The agent plugins work on the Mac. They need python3: install the Xcode Command Line Tools once (xcode-select --install). Without them, the Claude and Codex hooks skip their checks, and codenavi connect and the connect scripts stop and name that command.

Remove it

From ~/codenavi, run:

./setup.sh --purge

It lists what it removes and asks you to type purge: the container, the image, the login item, the embedding model it loaded into Ollama, and the index, settings and licence in the folder. Copy data/license.key out first if you may install again. The repository you indexed is not touched. Then delete the folder: cd ~ && rm -rf ~/codenavi. Podman and Ollama stay installed.