This guide explains how to set up and run Ollama (a local LLM framework) on a Mac Mini, and access it from another laptop via SSH.
- A Mac Mini running macOS
- A laptop (Linux/macOS) to access it remotely
- SSH access to the Mac Mini
-
Open Terminal on your Mac Mini.
-
Download and install Ollama:
curl -fsSL https://ollama.com/install.sh | sh -
Verify installation:
ollama --version
-
Download LLM (mistral)
ollama pull mistral
To avoid entering passwords every time you connect via SSH, set up key-based authentication.
- Generate an SSH key (if not already created):
ssh-keygen -t ed25519 -f ~/.ssh/ssh_key_mac_mini -C "Mac Mini Access"
- Copy the public key to your Mac Mini:
(Replace
ssh-copy-id -i ~/.ssh/ssh_key_mac_mini.pub user@MAC_IP_ADDRESSuserwith your Mac Mini username andMAC_IP_ADDRESSwith its IP.)
Ensure SSH key authentication is enabled:
sudo nano /etc/ssh/sshd_configCheck for these lines:
PubkeyAuthentication yes
PasswordAuthentication no
Restart SSH:
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshdRun Ollama in the background:
ollama serve &To check if it's running:
ps aux | grep ollama- SSH into your Mac Mini:
ssh -i ~/.ssh/ssh_key_mac_mini user@MAC_IP_ADDRESS - Send a request to Ollama (example with
mistralmodel):curl http://localhost:11434/api/generate -d '{"model": "mistral", "prompt": "Hello!"}'
- List LLM:
ollama list
- Remove LLM:
ollama rm mistral
ipconfig getifaddr en0sudo log stream --process sshdssh-add ~/.ssh/ssh_key_mac_mini- Installed Ollama on Mac Mini
- Set up SSH key authentication
- Started Ollama server and accessed it via SSH from another laptop
Now you can use your Mac Mini as a remote local LLM server! 🚀