---
title: "Deploy Open Notebook | (Just Updated) NotebookLM Alternative With REST API, Password and Encryption Key Generated"
description: "Open Notebook NotebookLM alternative: AI research notebooks, REST API"
category: "AI/ML"
url: https://railway.com/deploy/open-notebook-or-just-updated-notebooklm
---

# Deploy Open Notebook | (Just Updated) NotebookLM Alternative With REST API, Password and Encryption Key Generated

Open Notebook NotebookLM alternative: AI research notebooks, REST API

**[Deploy Open Notebook | (Just Updated) NotebookLM Alternative With REST API, Password and Encryption Key Generated on Railway](https://railway.com/template/open-notebook-or-just-updated-notebooklm)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/open-notebook-or-just-updated-notebooklm/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** AI/ML

## Template content

### surrealdb

- **Image:** surrealdb/surrealdb:v2.7.0@sha256:e5d7387e3727bbe2f7cd6d869e48cd34777272258572ead37c9656b25f745723
- **Start command:** `/surreal start --log info --user root --bind [::]:8000 rocksdb:/data/mydatabase.db`

### open-notebook

- **Image:** ghcr.io/bon5co/open-notebook-railway:1.15.1@sha256:56e36572f2b0148794c3f39d2b92dfcf673bc6ec0782a305925d36a2dab97239
- **Health check:** /api/config
- **Public domain:** Yes

## Documentation

# Deploy and Host Open Notebook on Railway

**Built for an LLM agent to deploy and use.** The deploy form has no fields to fill: the password, the encryption key and the database password are generated, SurrealDB is wired in, and uploads, podcasts and the database sit on volumes. Open Notebook is an open-source, self-hosted alternative to Google NotebookLM: notebooks of sources (PDF, web pages, audio, video, text), chat and search over them with the LLM provider of your choice, notes, and podcast generation, behind a web UI and a REST API.

## About Hosting Open Notebook

This template runs two services: **open-notebook** (the web UI and REST API on one public domain, with a volume at `/app/data` holding uploads, podcasts and caches) and **surrealdb** (SurrealDB 2 on the private network with a volume at `/data`). Notebooks, sources, notes and chat history survive redeploys.

**Never open, never half configured.** Upstream starts with authentication off unless you set a password, and ships an example encryption key for the provider credentials it stores. This template generates `OPEN_NOTEBOOK_PASSWORD` (32 characters) and `OPEN_NOTEBOOK_ENCRYPTION_KEY` (48 characters), and the wrapper refuses to start with a password under 12 characters or a key under 16. Keep the encryption key: provider API keys saved in Settings are encrypted with it, so changing it makes them unreadable.

**What the wrapper fixes for Railway.** Upstream's supervisor starts the Next.js frontend on a hard-coded port 8502; the wrapper moves it onto Railway's injected `PORT`, because Railway's healthcheck dials that port and not the domain's target port. It waits for SurrealDB before the API starts, since the two services boot in any order. The database user, namespace and name are baked into the image, so they are not form fields. Upstream is Open Notebook 1.15.1, pinned by digest.

**Using it.** Open `https://YOUR_DOMAIN`, sign in with `OPEN_NOTEBOOK_PASSWORD`, then add an LLM provider under Settings (OpenAI, Anthropic, Google, Ollama and others) before chatting or generating podcasts. The REST API is under `/api` with interactive docs at `/docs`. The template needs no provider key to deploy; it needs one to answer questions.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `open-notebook` service; the REST API is under `/api`)
- Private URL: `http://open-notebook.railway.internal:8080`
- Credentials: the variable `OPEN_NOTEBOOK_PASSWORD` on the `open-notebook` service (the web UI takes the same value as its password)
- Auth: `Authorization: Bearer $OPEN_NOTEBOOK_PASSWORD` on every `/api` route. A request with no credentials, or with a wrong password, answers `401`, for reads and for writes alike. `/api/config` is open on purpose, it is the health endpoint.
- Health: `GET /api/config` returns 200 once the frontend and the API are both up (the first boot migrates the database, a minute or two)

```bash
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, OPEN_NOTEBOOK_PASSWORD (variables of the open-notebook service); also curl. Creates one throwaway notebook and deletes it.
R="https://$RAILWAY_PUBLIC_DOMAIN"; A="Authorization: Bearer $OPEN_NOTEBOOK_PASSWORD"
# first boot migrates the database (a minute or two); wait for the health endpoint
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/api/config")" = 200 ]; do n=$((n+1)); [ "$n" -le 90 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/config"
curl -s -o /dev/null -w "read with key: %{http_code}\n" -H "$A" "$R/api/notebooks"
curl -s -o /dev/null -w "read without key: %{http_code}\n" "$R/api/notebooks"
N="agent-$(date +%s)"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X POST "$R/api/notebooks" -H "Content-Type: application/json" -d "{\"name\":\"$N\",\"description\":\"\"}"
curl -s -o /dev/null -w "write with wrong key: %{http_code}\n" -X POST "$R/api/notebooks" -H "Authorization: Bearer ${OPEN_NOTEBOOK_PASSWORD}x" -H "Content-Type: application/json" -d "{\"name\":\"$N\",\"description\":\"\"}"
T=$(mktemp); curl -s -o "$T" -w "write with key: %{http_code}\n" -X POST "$R/api/notebooks" -H "$A" -H "Content-Type: application/json" -d "{\"name\":\"$N\",\"description\":\"agent smoke test\"}"
ID=$(sed -n 's/.*"id":"\([^"]*\)".*/\1/p' "$T")
curl -s -H "$A" "$R/api/notebooks" | grep -c "$N" | sed 's/^/notebook found after write: /'
curl -s -o /dev/null -w "cleanup: %{http_code}\n" -X DELETE -H "$A" "$R/api/notebooks/$ID"
```

A fresh deploy prints `health: 200`, `read with key: 200`, `read without key: 401`, `write without key: 401`, `write with wrong key: 401`, `write with key: 200`, `notebook found after write: 1` and `cleanup: 200`.

## Why Deploy Open Notebook on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Open Notebook on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **Agent-ready** - no deployer fields, a contract block and one script that proves health, an authenticated read and write over the REST API, and the refusal of a write with no key or a wrong one.
- **Never open** - the password and the encryption key are generated, and the wrapper refuses weak ones.
- **Data survives redeploys** - the database and the data directory sit on volumes.
- **Pinned** - the upstream image is pinned by digest and the wrapper by tag and digest.
- **Your research on your domain** - sources, notes and chats stay on infrastructure you control, and you pick the model provider.

## Common Use Cases

- **A private NotebookLM** - upload papers, web pages, audio and video, then ask questions with citations from your own sources.
- **Research notebooks for a team** - one shared instance behind one password, with notes and sources kept per notebook.
- **Podcast generation from documents** - turn a notebook into a multi-speaker podcast with the text-to-speech provider you choose.
- **Agent-driven research** - give an agent the REST API to create notebooks, add sources, search and read notes.

## Dependencies for Open Notebook Hosting

- The open-notebook service and the surrealdb service with their volumes, created by the template. An API key for at least one LLM provider (or a reachable Ollama) is needed to chat and generate, and is added in the app after deploy.

### Deployment Dependencies

- [Open Notebook repository](https://github.com/lfnovo/open_notebook)
- [Open Notebook documentation](https://github.com/lfnovo/open_notebook/tree/main/docs)
- [Wrapper image source](https://github.com/bon5co/open-notebook-railway)


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/open-notebook-or-just-updated-notebooklm
