Run Open Notebook with a separately installed Ollama (not via Docker). This avoids Docker running the Ollama service while you use your own local Ollama installation.
-
Docker Desktop installed (for SurrealDB and Open Notebook)
-
Ollama installed separately
- Download here
- Verify: run
ollama --version
-
Models downloaded in Ollama:
ollama pull mistral ollama pull nomic-embed-text
Start the Ollama server:
# Default: runs on http://localhost:11434
ollama serveKeep this terminal open. Ollama will run in the background.
Optional: Start Ollama on a custom port or network interface:
OLLAMA_HOST=0.0.0.0:11434 ollama serveCreate a new folder open-notebook-external-ollama and add these files:
docker-compose.yml:
services:
surrealdb:
image: surrealdb/surrealdb:v2
command: start --user root --pass password rocksdb:/mydata/mydatabase.db
user: root
ports:
# Localhost only — the database uses default credentials, so never
# publish this port on 0.0.0.0
- "127.0.0.1:8000:8000"
volumes:
- ./surreal_data:/mydata
open_notebook:
image: lfnovo/open_notebook:v1-latest
pull_policy: always
ports:
- "8502:8502" # Web UI (React frontend)
- "5055:5055" # API (required!)
environment:
# Encryption key for credential storage (required)
- OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string
# Database (required)
- SURREAL_URL=ws://surrealdb:8000/rpc
- SURREAL_USER=root
- SURREAL_PASSWORD=password
- SURREAL_NAMESPACE=open_notebook
- SURREAL_DATABASE=open_notebook
volumes:
- ./notebook_data:/app/data
depends_on:
- surrealdb
restart: always
Note: No Ollama service in Docker — we use the host's Ollama.
When Open Notebook runs inside Docker, it cannot reach localhost:11434 on your host directly. Use the special hostname:
| Host OS | Ollama URL in Open Notebook |
|---|---|
| Linux | http://host.containers.internal:11434 |
| macOS | http://host.docker.internal:11434 |
| Windows | http://host.docker.internal:11434 |
Open terminal in your open-notebook-external-ollama folder:
docker compose up -dWait 10-15 seconds for services to start.
- Go to Manage → Models
- Click Add Credential
- Select provider: Ollama
- Give it a name (e.g., "Local Ollama")
- Enter the base URL:
- Windows/macOS:
http://host.docker.internal:11434 - Linux:
http://host.containers.internal:11434
- Windows/macOS:
- Click Save
- Click Test Connection — should show success
- Click Discover Models → Register Models
- Go to Manage → Models
- Set:
- Language Model:
ollama/mistral(or whichever model you downloaded) - Embedding Model:
ollama/nomic-embed-text
- Language Model:
- Click Save
Open your browser:
http://localhost:8502
- Ollama is running (
ollama servein terminal) - Docker is running
- You can access
http://localhost:8502 - Ollama credential is configured with host URL and tested
- Models are registered
- Chat works
-
Verify Ollama is running:
curl http://localhost:11434/api/version
-
Check firewall allows local connections on port 11434
-
For Windows/macOS, ensure
host.docker.internalis reachable from inside the container:docker exec <open_notebook_container> curl http://host.docker.internal:11434/api/version
# Check Ollama logs
ollama list
# Pull a model again
ollama pull mistraldocker compose down
docker compose up -d| Approach | Ollama in Docker | Ollama External |
|---|---|---|
| Resource isolation | Separated | Shares with host |
| GPU access | Requires Docker GPU setup | Native GPU access |
| Model management | Via docker exec |
Via terminal directly |
| Memory usage | Isolated from host | Shared with host apps |
External Ollama is recommended if you:
- Already have Ollama installed and configured
- Want GPU access without Docker GPU passthrough complexity
- Prefer managing models via command line directly
- Add more models: Run
ollama pull <model>, then re-discover from Open Notebook - Check Ollama status:
ollama listshows downloaded models - Customize Ollama: Edit
~/.ollama/config.yamlfor advanced settings
Need Help? Join our Discord community