open-notebook/docs/0-START-HERE/quick-start-openai.md
Luis Novo 7df4acdb7d
docs: stop teaching 0.0.0.0 SurrealDB port exposure in setup snippets (#1060)
* docs: stop teaching 0.0.0.0 SurrealDB port exposure in setup snippets

Bind port 8000 to 127.0.0.1 in every compose and docker run snippet
(README, quick starts, installation, configuration and development docs,
and the examples/docker-compose-*.yml files), matching the shipped
docker-compose.yml from #1025. Drop the redundant --bind 0.0.0.0:8000
from containerized surreal start commands (it is the in-container
default) and add !override to docker-compose.override.yml.example so the
opt-in re-publish actually replaces the base port binding instead of
colliding with it. Docs that discuss reaching the database from another
machine now point at the override example plus a firewall/SSH-tunnel
note.

Closes #1034

* docs: parameterize creds in manual compose example, note Compose version for !override
2026-07-12 08:42:52 -03:00

4.4 KiB

Quick Start - OpenAI (5 minutes)

Get Open Notebook running with OpenAI's GPT models. Fast, powerful, and simple.

Prerequisites

  1. Docker Desktop installed

  2. OpenAI API Key (required)

Step 1: Create Configuration (1 min)

Create a new folder open-notebook and add this file:

docker-compose.yml:

services:
  surrealdb:
    image: surrealdb/surrealdb:v2
    command: start --user root --pass password rocksdb:/mydata/mydatabase.db
    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
      - "5055:5055"  # API
    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

Edit the file:

  • Replace change-me-to-a-secret-string with your own secret (any string works)

Step 2: Start Services (1 min)

Open terminal in your open-notebook folder:

docker compose up -d

Wait 15-20 seconds for services to start.


Step 3: Access Open Notebook (instant)

Open your browser:

http://localhost:8502

You should see the Open Notebook interface!


Step 4: Configure Your OpenAI Provider (1 min)

  1. Go to Settings → API Keys
  2. Click Add Credential
  3. Select provider: OpenAI
  4. Give it a name (e.g., "My OpenAI Key")
  5. Paste your OpenAI API key
  6. Click Save
  7. Click Test Connection — should show success
  8. Click Discover Models → Register Models

Your OpenAI models are now available!


Step 5: Create Your First Notebook (1 min)

  1. Click New Notebook
  2. Name: "My Research"
  3. Click Create

Step 6: Add a Source (1 min)

  1. Click Add Source
  2. Choose Web Link
  3. Paste: https://en.wikipedia.org/wiki/Artificial_intelligence
  4. Click Add
  5. Wait for processing (30-60 seconds)

Step 7: Chat With Your Content (1 min)

  1. Go to Chat
  2. Type: "What is artificial intelligence?"
  3. Click Send
  4. Watch as GPT responds with information from your source!

Verification Checklist

  • Docker is running
  • You can access http://localhost:8502
  • OpenAI credential is configured and tested
  • You created a notebook
  • You added a source
  • Chat works

All checked? You have a fully working AI research assistant!


Using Different Models

In your notebook, go to Settings → Models to choose:

  • gpt-4o - Best quality (recommended)
  • gpt-4o-mini - Fast and cheap (good for testing)

Troubleshooting

"Port 8502 already in use"

Change the port in docker-compose.yml:

ports:
  - "8503:8502"  # Use 8503 instead

Then access at http://localhost:8503

"API key not working"

  1. Go to Settings → API Keys
  2. Click Test Connection on your OpenAI credential
  3. If it fails, verify your key at https://platform.openai.com
  4. Delete the credential and create a new one with the correct key

"Cannot connect to server"

docker ps  # Check all services running
docker compose logs  # View logs
docker compose restart  # Restart everything

Next Steps

  1. Add Your Own Content: PDFs, web links, documents
  2. Explore Features: Podcasts, transformations, search
  3. Full Documentation: See all features

Cost Estimate

OpenAI pricing (approximate):

  • Conversation: $0.01-0.10 per 1K tokens
  • Embeddings: $0.02 per 1M tokens
  • Typical usage: $1-5/month for light use, $20-50/month for heavy use

Check https://openai.com/pricing for current rates.


Need help? Join our Discord community!