Kanon
Getting started

Self-hosting Kanon

Kanon is a Next.js application backed by Postgres (via Supabase). Here's how to run it yourself.

Requirements

  • Node.js 22
  • pnpm 10+
  • PostgreSQL 15+ (or Supabase)
  • An OpenAI API key

Quick start (local development)

# Clone the repo
git clone https://github.com/KanonAI/kanon.git
cd kanon

# Install dependencies
pnpm install

# Copy environment template
cp .env.example .env
cp .env.example .env.local

# Start local Supabase (Postgres + Auth)
make db-start

# Apply database migrations
make db-migrate

# Start the dev server
pnpm dev

The app runs at http://localhost:3000.

Environment configuration

Required (.env)

DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:54322/postgres"
DIRECT_URL="postgresql://postgres:postgres@127.0.0.1:54322/postgres"

Required (.env.local)

NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=<from supabase status>
SUPABASE_SERVICE_ROLE_KEY=<from supabase status>
OPENAI_API_KEY=sk-...
KANON_API_TOKEN=<openssl rand -hex 32>

Optional (.env.local)

# Linear integration
LINEAR_OAUTH_CLIENT_ID=...
LINEAR_OAUTH_CLIENT_SECRET=...

# GitHub repo source (for private repos)
GITHUB_TOKEN=ghp_...

# Google sign-in
SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID=...
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET=...

# Production
NEXT_PUBLIC_SITE_URL=https://kanon.example.com

Database

Kanon uses Prisma for schema management. Migrations are in prisma/migrations/.

# Apply migrations (production)
npx prisma migrate deploy

# Generate Prisma client
npx prisma generate

# Open Prisma Studio
npx prisma studio

Production deployment

Build

pnpm build

Run

pnpm start

Docker (optional)

The app is a standard Next.js build. Any Node.js 22 container runtime works:

FROM node:20-alpine
WORKDIR /app
COPY . .
RUN corepack enable && pnpm install --frozen-lockfile && pnpm build
EXPOSE 3000
CMD ["pnpm", "start"]

Important production settings

  • Set NEXT_PUBLIC_SITE_URL to your public URL (auth redirects depend on it)
  • Set NODE_ENV=production
  • Use a pooled Postgres connection for DATABASE_URL and a direct connection for DIRECT_URL
  • Supabase's site_url must match the host the app is served from

Makefile commands

make db-start        # Start local Supabase
make db-stop         # Stop local Supabase
make db-migrate      # Run Prisma migrations (dev)
make db-deploy       # Run Prisma migrations (prod)
make discover        # Run discovery from CLI
make scan            # Scan a feature from CLI
make scan-all        # Scan all features from CLI
make seed            # Load demo data
make plugin-build    # Rebuild the plugin's MCP server
make plugin-validate # Validate the plugin bundle

On this page