Expose your local Ollama to Cursor via a simple ngrok tunnel.
-
Make the launcher executable (one-time):
chmod +x scripts/start-tunnel.sh app/CursorOllamaLauncher.command
-
Start the bridge:
- Double‑click
app/CursorOllamaLauncher.command, or - Run
./scripts/start-tunnel.sh
The script prints a URL like
https://<random>.ngrok-free.app/v1and lists your local Ollama models. - Double‑click
-
Configure Cursor:
- Settings → Models → API Keys → Override OpenAI Base URL: paste the printed URL (when auth is enabled, use the variant that includes
user:password@) - Settings → Models → API Keys → OpenAI API Key: any dummy value (e.g.
123) — or leave blank if you pasted a URL with embedded credentials - Settings → Models → Models: add any of the listed local models
- Settings → Models → API Keys → Override OpenAI Base URL: paste the printed URL (when auth is enabled, use the variant that includes
Set NGROK_BASIC_AUTH=user:password in your .env to require HTTP Basic Auth before requests reach Ollama. The launcher already loads .env, and the tunnel script forwards the credential to ngrok:
NGROK_BASIC_AUTH=cursor:supersecret ./scripts/start-tunnel.sh- Cursor → Settings → Models → API Keys → Override OpenAI Base URL: use the printed URL containing
user:password@…. - Cursor → Settings → Models → API Keys → OpenAI API Key: leave empty (Cursor will send the embedded credentials).
- Copy
env.exampleto.envfor a ready-to-edit template. - ngrok must run with its local API enabled (default) so the script can obtain the public URL.
- To confirm protection, curl the printed URL with
-u user:passwordand expect a 200; try without credentials to see a 401. - If you skip this, the launcher prints a warning because the tunnel remains public.
- Security: Basic Auth is optional; without
NGROK_BASIC_AUTHthe tunnel remains unauthenticated (the script warns you in that case). Stop the script to close access when you’re done. - Free ngrok URLs change each run; repeat the copy step when you restart.
- Optional env:
NGROK_AUTHTOKEN,OLLAMA_PORT,NGROK_REGION,NGROK_BASIC_AUTHare supported by the script.