Skip to main content
Tabby requires environment variables to be configured across three components: the frontend, Next.js backend, and Python memory backend.

Prerequisites

Before configuring environment variables:
  1. Complete the database setup
  2. Run npx supabase status to get your Supabase credentials
  3. Have your API keys ready (OpenAI, Tavily, etc.)

Create Environment Files

Copy the example files to create your environment configuration:
# Frontend
cp frontend/env.example frontend/.env.local

# Next.js Backend
cp nextjs-backend/env.example nextjs-backend/.env.local

# Memory Backend
cp backend/env.example backend/.env

Frontend Configuration

Edit frontend/.env.local:
# Supabase (local Docker) — get values from `npx supabase status`
NEXT_PUBLIC_SUPABASE_URL="http://127.0.0.1:54321"
NEXT_PUBLIC_SUPABASE_ANON_KEY="<ANON_KEY from supabase status>"

NEXT_PUBLIC_APP_NAME="Tabby"
NEXT_PUBLIC_APP_ICON="/logos/tabby-logo.png"

NEXT_PUBLIC_API_URL="http://localhost:3001"
NEXT_PUBLIC_MEMORY_API_URL="http://localhost:8000"

Frontend Variables Explained

Your local Supabase API URL. For local development, this is http://127.0.0.1:54321.Get this from npx supabase status output.
The anonymous key for client-side Supabase requests.Get this from npx supabase status output.
URL for the Next.js backend API. Default is http://localhost:3001.
URL for the Python memory backend. Default is http://localhost:8000.

Next.js Backend Configuration

Edit nextjs-backend/.env.local:
# Supabase (local Docker) — same keys as frontend
NEXT_PUBLIC_SUPABASE_URL="http://127.0.0.1:54321"
NEXT_PUBLIC_SUPABASE_ANON_KEY="<ANON_KEY from supabase status>"
SUPABASE_ADMIN="<SERVICE_ROLE_KEY from supabase status>"

# Email (optional)
RESEND_API_KEY=""
RESEND_DOMAIN=""

NEXT_PUBLIC_APP_NAME="Tabby"
NEXT_PUBLIC_APP_ICON="/logos/tabby-logo.png"

# AI Providers
OPENAI_API_KEY=""
GOOGLE_GENERATIVE_AI_API_KEY=""
GROQ_API_KEY=""
CEREBRAS_API_KEY=""
OPENROUTER_API_KEY=""

# Tools
TAVILY_API_KEY=""

MEMORY_API_URL="http://localhost:8000"

Backend Variables Explained

  • NEXT_PUBLIC_SUPABASE_URL: Same as frontend
  • NEXT_PUBLIC_SUPABASE_ANON_KEY: Same as frontend
  • SUPABASE_ADMIN: Service role key for admin operations (from npx supabase status)
OPENAI_API_KEY (Required)Optional Providers:
  • GOOGLE_GENERATIVE_AI_API_KEY: Google’s Gemini models
  • GROQ_API_KEY: Fast inference platform
  • CEREBRAS_API_KEY: High-performance inference
  • OPENROUTER_API_KEY: Access to multiple models
TAVILY_API_KEY (Recommended)
  • Required for web search functionality
  • Get from tavily.ai
If you want to enable email notifications:
  • RESEND_API_KEY: API key from resend.com
  • RESEND_DOMAIN: Your verified domain

Memory Backend Configuration

Edit backend/.env:
OPENAI_API_KEY=""

# Local Supabase PostgreSQL — get DB_URL from `npx supabase status`
SUPABASE_CONNECTION_STRING="postgresql://postgres:[email protected]:54322/postgres"

# Neo4j (optional - see Neo4j setup guide)
NEO4J_URL=""
NEO4J_USERNAME=""
NEO4J_PASSWORD=""
NEO4J_DATABASE=""
AURA_INSTANCEID=""
AURA_INSTANCENAME=""

Memory Backend Variables Explained

Same OpenAI API key as the Next.js backend.
PostgreSQL connection string for local Supabase.Format: postgresql://postgres:[email protected]:54322/postgres
Note the port 54322 for direct PostgreSQL connection (different from the API port 54321)
You can verify this with npx supabase status and look for the “DB URL” value.
Only required if you’re using the knowledge graph feature. See the Neo4j setup guide for details.
  • NEO4J_URL: Your Neo4j instance URI
  • NEO4J_USERNAME: Database username (usually “neo4j”)
  • NEO4J_PASSWORD: Database password
  • NEO4J_DATABASE: Database name (usually “neo4j”)
  • AURA_INSTANCEID: Your AuraDB instance ID (if using Neo4j Aura)
  • AURA_INSTANCENAME: Your AuraDB instance name (if using Neo4j Aura)

Getting Supabase Credentials

To get all your Supabase credentials at once:
npx supabase status
This outputs:
  • API URL: Use for NEXT_PUBLIC_SUPABASE_URL
  • anon key: Use for NEXT_PUBLIC_SUPABASE_ANON_KEY
  • service_role key: Use for SUPABASE_ADMIN
  • DB URL: Use for SUPABASE_CONNECTION_STRING

Verification

After configuring all environment files, verify your setup:
1

Check file existence

Make sure all three .env files exist:
ls frontend/.env.local
ls nextjs-backend/.env.local
ls backend/.env
2

Verify required keys

At minimum, you need:
  • Supabase URL and keys in all three files
  • OpenAI API key in backend files
  • Tavily API key (recommended for web search)
Never commit .env files to version control. They are already included in .gitignore.

Next Steps

With environment variables configured, you can:
  1. Run the application and start all services
  2. Optionally set up Neo4j for knowledge graph features
  3. Start developing with Tabby AI Keyboard

Build docs developers (and LLMs) love