Skip to content

Self-hosting Nook

Self-hosting Nook

On this page

What you need

  • Node.js 22.12 or newer, and npm.
  • A PostgreSQL database for production, or the embedded database for trying things out.
  • A LiveKit media server (LiveKit Cloud or your own) for audio and video.
  • A public https address for production — browsers only allow cameras and microphones on secure pages.

Install and configure

  1. Install dependencies with npm install.
  2. Copy .env.example to .env.local. Every variable is described there, and empty values count as not set.
  3. Set APP_URL to your public address and NOOK_SECRET to at least 32 random characters, for example from openssl rand -base64 48. Production refuses to start without it.
  4. Build with npm run build and start with npm run start. For development, npm run dev.

Database

Set DATABASE_URL to a PostgreSQL connection string for production. Leave it empty to use the embedded PGlite database stored in PGLITE_DATA_DIR (default .data/pglite) — fine for a try-out, but only one process may use that folder at a time.

Migrations run automatically on first use. You can also run them yourself with npm run db:migrate. Production deployments must ship the drizzle folder.

Audio and video (LiveKit)

Set LIVEKIT_URL (the wss:// address), LIVEKIT_API_KEY and LIVEKIT_API_SECRET. All three are needed; without them rooms still open and say that audio and video are unavailable.

In LiveKit, add a webhook pointing to /api/livekit/webhook on your address. Nook verifies its signature and uses it to keep attendance accurate.

Preview mode

NOOK_DEMO_MODE is auto by default: preview mode stays on while LiveKit or messaging service isn’t configured. It offers the shared sample account, loads sample data into an empty database and shows a visible “Preview mode” marker. Set it to off for a production server, or on to keep it.

Limits and operator details

NOOK_MAX_PARTICIPANTS, NOOK_MAX_VIDEO_TILES, NOOK_GALLERY_PAGE_SIZE and NOOK_MAX_SIMULATED_PARTICIPANTS set the room limits shown throughout the site.

NOOK_OPERATOR_NAME, NOOK_OPERATOR_ADDRESS, NOOK_CONTACT_EMAIL, NOOK_PRIVACY_EMAIL, NOOK_SECURITY_EMAIL and NOOK_GOVERNING_LAW fill in the legal pages, the contact page and the footer. Until you set them, those pages show highlighted placeholders.

Important

Review the Terms, Privacy Policy and Cookie Policy before you open your server to the public. They describe how Nook works, but you are the operator.