Self-Hosting
Self-hosting gives you full control over your data and billing while matching the hosted experience.
What you'll need
- Convex CLI (
npm i -g convex) - Access to secrets for the features you want: Groq (AI), Kernel (screenshots), Resend (email), Polar (billing)
Quickstart (local)
- Clone the repo and install dependencies:
bun install- Provision Convex + Better Auth defaults:
bun run predevThis creates a dev deployment and prints the CONVEX_SITE_URL you will reuse in client env files.
-
Create env files using the values below:
./.env.local(web + backend)mobile/.env.localextension/.env.local
-
Start the stack:
bun run devProduction basics
- Point
SITE_URLandCONVEX_SITE_URLto your public domain. - Add email (
RESEND_API_KEY) and billing (Polar) keys if you need those features. - Build and serve:
bun run build
bun run startEnvironment settings
Add these to your env files before running locally or deploying.
Backend (.env.local)
SITE_URL=http://localhost:3000
BETTER_AUTH_SECRET=your-secret # Better Auth security
KERNEL_API_KEY=token # Kernel Browser
GROQ_API_KEY=gsk_... # AI processing
POLAR_ACCESS_TOKEN=token # Billing
POLAR_ORGANIZATION_TOKEN=token # Polar organization
POLAR_SERVER=sandbox # sandbox|production
POLAR_WEBHOOK_SECRET=secret # Polar webhooks
RESEND_API_KEY=token # Email serviceWeb (./.env.local)
CONVEX_DEPLOY_KEY=
NEXT_PUBLIC_CONVEX_URL=https://deployment.convex.cloud
NEXT_PUBLIC_CONVEX_SITE_URL=https://deployment.convex.siteMobile (mobile/.env.local)
EXPO_PUBLIC_CONVEX_URL=https://deployment.convex.cloud
EXPO_PUBLIC_CONVEX_SITE_URL=https://deployment.convex.siteExtension (extension/.env.local)
VITE_PUBLIC_CONVEX_URL=https://deployment.convex.cloud
VITE_PUBLIC_CONVEX_SITE_URL=https://deployment.convex.siteWhere to get the values
- Convex: run
bun run predev; it creates the deployment and prints both URLs. Update them when you promote to production. - Better Auth: generate a secret once with
npx convex env set BETTER_AUTH_SECRET $(openssl rand -base64 32). KeepSITE_URL(Next.js + Convex) andCONVEX_SITE_URL(Convex site endpoint) in sync with your domain. - Optional features: set
GROQ_API_KEYfor AI,KERNEL_API_KEYfor link previews, Polar keys for billing, andRESEND_API_KEYfor email.