docs/1-INSTALLATION/docker-compose.md
Multi-container setup with separate services. Best for most users.
Alternative Registry: All images are available on both Docker Hub (
lfnovo/open_notebook) and GitHub Container Registry (ghcr.io/lfnovo/open-notebook). Use GHCR if Docker Hub is blocked or you prefer GitHub-native workflows.
Option A: Download from repository
curl -o docker-compose.yml https://raw.githubusercontent.com/lfnovo/open-notebook/main/docker-compose.yml
Option B: Use the official file from the repo
The official docker-compose.yml is in the root of our repository: View on GitHub
Copy that file to your project folder.
Option C: Create manually
Create a file called docker-compose.yml with this content:
services:
surrealdb:
image: surrealdb/surrealdb:v2
command: start --log info --user root --pass root rocksdb:/mydata/mydatabase.db
user: root # Required for bind mounts on Linux
ports:
- "8000:8000"
volumes:
- ./surreal_data:/mydata
environment:
- SURREAL_EXPERIMENTAL_GRAPHQL=true
restart: always
pull_policy: always
open_notebook:
image: lfnovo/open_notebook:v1-latest
ports:
- "8502:8502" # Web UI
- "5055:5055" # REST API
environment:
# REQUIRED: Change this to your own secret string
- OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string
# Database connection (default values - no need to change)
- SURREAL_URL=ws://surrealdb:8000/rpc
- SURREAL_USER=root
- SURREAL_PASSWORD=root
- SURREAL_NAMESPACE=open_notebook
- SURREAL_DATABASE=open_notebook
volumes:
- ./notebook_data:/app/data
depends_on:
- surrealdb
restart: always
pull_policy: always
Edit the file:
change-me-to-a-secret-string with your own secret (any string works, e.g., my-super-secret-key-123)Open terminal in the open-notebook folder:
docker compose up -d
Wait 15-20 seconds for all services to start:
✅ surrealdb running on :8000
✅ open_notebook running on :8502 (UI) and :5055 (API)
Check status:
docker compose ps
API Health:
curl http://localhost:5055/health
# Should return: {"status": "healthy"}
Frontend Access: Open browser to:
http://localhost:8502
You should see the Open Notebook interface!
Your models are now available!
Need an API key? Get one from your chosen provider:
- OpenAI: https://platform.openai.com/api-keys
- Anthropic: https://console.anthropic.com/
- Google: https://aistudio.google.com/
- Groq: https://console.groq.com/
Done! You now have a fully working Open Notebook instance.
Instead of manually editing, use our ready-made example:
# Download the Ollama example
curl -o docker-compose.yml https://raw.githubusercontent.com/lfnovo/open-notebook/main/examples/docker-compose-ollama.yml
# Or copy from repo
cp examples/docker-compose-ollama.yml docker-compose.yml
See examples/docker-compose-ollama.yml for the complete setup.
Manual setup: Add this to your existing docker-compose.yml:
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_models:/root/.ollama
restart: always
volumes:
ollama_models:
Then restart and pull a model:
docker compose restart
docker exec open-notebook-local-ollama-1 ollama pull mistral
Configure Ollama in the Settings UI:
http://ollama:11434| Variable | Purpose | Example |
|---|---|---|
OPEN_NOTEBOOK_ENCRYPTION_KEY | Encryption key for credentials | my-secret-key |
SURREAL_URL | Database connection | ws://surrealdb:8000/rpc |
SURREAL_USER | Database user | root |
SURREAL_PASSWORD | Database password | root |
SURREAL_NAMESPACE | Database namespace | open_notebook |
SURREAL_DATABASE | Database name | open_notebook |
API_URL | API external URL | http://localhost:5055 |
See Environment Reference for complete list.
docker compose down
# All services
docker compose logs -f
# Specific service
docker compose logs -f api
docker compose restart
docker compose down
docker compose pull
docker compose up -d
docker compose down -v
docker ps
docker compose ps
docker compose logs api
If you get "Port 8502 already in use", change the port:
ports:
- "8503:8502" # Use 8503 instead
- "5055:5055" # Keep API port same
Then access at http://localhost:8503
Check SurrealDB is running:
docker compose logs surrealdb
Reset database:
docker compose down -v
docker compose up -d
If you see Permission denied or Failed to create RocksDB directory in SurrealDB logs:
docker compose logs surrealdb | grep -i permission
This happens because SurrealDB runs as a non-root user but Docker creates bind mount directories as root. Add user: root to the surrealdb service:
surrealdb:
image: surrealdb/surrealdb:v2
user: root # Fix for Linux bind mount permissions
# ... rest of config
Then restart:
docker compose down -v
docker compose up -d
Looking for different configurations? Check out our examples/ folder:
Each example includes detailed comments and usage instructions.
For production use, see: