Production

Deployment Guide

Complete guide to deploying NotebookLLM to production using Vercel and various backend platforms.

Deployment Options

Vercel (Recommended)

Best for Next.js frontend with zero-config deployments and automatic SSL.

Railway

Great for full-stack deployment with PostgreSQL and Redis support.

Coolify

Self-hosted option for full control over your infrastructure.

Prerequisites

Required Accounts

  • Supabase (database & auth)
  • Qdrant Cloud (vector database)
  • Google AI Studio (Gemini API)

Required Tools

  • Git
  • Node.js 18+
  • pnpm (recommended)

Frontend Deployment (Vercel)

Step 1: Connect Repository

  1. Go to vercel.com and sign up
  2. Click "Add New..." → "Project"
  3. Import your GitHub repository
  4. Select the frontend directory as root

Step 2: Configure Environment Variables

Add these environment variables in the Vercel dashboard:

# Supabase (Required)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

# Backend API
NEXT_PUBLIC_API_URL=https://your-backend.railway.app

# Features
NEXT_PUBLIC_GOOGLE_DRIVE_ENABLED=false
NEXT_PUBLIC_NOTE_TAKING_ENABLED=true
NEXT_PUBLIC_ASK_ENABLED=true
NEXT_PUBLIC_STUDIO_ENABLED=true

# App
NEXT_PUBLIC_APP_NAME=NotebookLLM
NEXT_PUBLIC_APP_URL=https://your-app.vercel.app
NEXT_PUBLIC_LOGIN_PAGE=false

Step 3: Deploy

  1. Click "Deploy" in Vercel dashboard
  2. Wait for build to complete
  3. Your app will be available at https://your-app.vercel.app

Backend Deployment

Railway Deployment (Recommended)

Step 1: Create Railway Project

  1. Go to railway.app and sign up
  2. Click "New Project" → "Deploy from GitHub repo"
  3. Select your repository

Step 2: Configure Environment Variables

# Database
DATABASE_URL=postgresql://user:pass@host:5432/db

# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
SUPABASE_JWT_SECRET=your-jwt-secret

# Vector Database
QDRANT_HOST=https://your-cluster.cloud.qdrant.io
QDRANT_API_KEY=your-qdrant-key

# LLM Providers
GEMINI_API_KEY=your-gemini-key
COHERE_API_KEY=your-cohere-key

# Google OAuth (for Google Drive)
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret

# Security
ENVIRONMENT=production
CORS_ORIGINS=https://your-app.vercel.app

# SMTP (for emails)
SMTP_FROM_EMAIL=noreply@yourdomain.com

Step 3: Deploy

  1. Click "Deploy" in Railway dashboard
  2. Wait for build and startup to complete
  3. Note your Railway app URL (e.g., https://your-app.up.railway.app)

Docker Deployment

Build Image

# Build the backend image
cd backend
docker build -t notebookllm-backend .

Run Container

docker run -d \
  --name notebookllm-backend \
  -p 8000:8000 \
  --env-file .env.production \
  notebookllm-backend

Docker Compose

# docker-compose.yml
version: '3.8'
services:
  api:
    build: ./backend
    ports:
      - "8000:8000"
    env_file:
      - .env.production
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
    restart: unless-stopped

Database Setup

Supabase Setup

  1. Create project at supabase.com
  2. Go to SQL Editor and run the migration files in backend/migrations/versions/
  3. Go to SettingsAPI to get your URL and keys
  4. Configure authentication providers if needed

Qdrant Setup

  1. Create cluster at cloud.qdrant.io
  2. Note your cluster URL and API key
  3. Create a collection named notebookllm with:
    • Vector size: 768
    • Distance metric: Cosine

Health Checks

Verify your deployment is working correctly:

EndpointPurpose
/api/v1/healthFull system health check
/api/v1/health/livenessLiveness probe
/api/v1/health/readinessReadiness probe
# Test health endpoint
curl https://your-backend.railway.app/api/v1/health

Environment-Specific Configuration

Production Checklist

  • Set ENVIRONMENT=production
  • Set DEBUG=false
  • Configure CORS_ORIGINS to your frontend domain
  • Enable ENABLE_RATE_LIMITING=true
  • Configure SMTP for transactional emails
  • Set up custom domain (optional)
  • Enable SSL/HTTPS

Monitoring & Observability

Langfuse (LLM Observability)

Configure Langfuse to monitor LLM calls and RAG performance:

# Environment variables
LANGFUSE_PUBLIC_KEY=pk-xxx
LANGFUSE_SECRET_KEY=sk-xxx
LANGFUSE_HOST=https://cloud.langfuse.com
LANGFUSE_ENABLED=true

Troubleshooting

CORS Errors

Ensure CORS_ORIGINS in backend includes your Vercel frontend URL.

401 Unauthorized

Check that SUPABASE_JWT_SECRET matches your Supabase project settings.

Qdrant Connection Failed

Verify QDRANT_HOST and QDRANT_API_KEY are correct.

Rate Limiting Issues

Check API key limits for Gemini/Cohere. Consider upgrading your plan for higher limits.