open-notebook/docs/5-CONFIGURATION/database.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

1.9 KiB

Database - SurrealDB Configuration

Open Notebook uses SurrealDB for its database needs.


Default Configuration

Open Notebook should work out of the box with SurrealDB as long as the environment variables are correctly setup.

The example above is for when you are running SurrealDB as a separate docker container, which is the method described here (and our recommended method).

SURREAL_URL="ws://surrealdb:8000/rpc"
SURREAL_USER="root"
SURREAL_PASSWORD="root"
SURREAL_NAMESPACE="open_notebook"
SURREAL_DATABASE="open_notebook"

DB running in the host machine and Open Notebook running in Docker

If ON is running in docker and SurrealDB is on your host machine, you need to point to it.

SURREAL_URL="ws://your-machine-ip:8000/rpc" #or host.docker.internal
SURREAL_USER="root"
SURREAL_PASSWORD="root"
SURREAL_NAMESPACE="open_notebook"
SURREAL_DATABASE="open_notebook"

Note: If SurrealDB runs in Docker with its port published on 127.0.0.1 only (the documented default), it won't be reachable at your machine's IP. Re-publish the port deliberately — see docker-compose.override.yml.example in the repo root — behind a firewall or SSH tunnel, with real credentials set.

Open Notebook and Surreal are running on the same machine

If you are running both services locally or if you are using the deprecated single container setup

SURREAL_URL="ws://localhost:8000/rpc"
SURREAL_USER="root"
SURREAL_PASSWORD="root"
SURREAL_NAMESPACE="open_notebook"
SURREAL_DATABASE="open_notebook"

Multiple databases

You can have multiple namespaces in one SurrealDB instance and you can also have multiple databases in one instance. So, if you want to setup multiple open noteobok deployments for different users, you don't need to deploy multiple databases.