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 Configuration

Edit frontend/.env.local:

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:

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:

Memory Backend Variables Explained

Same OpenAI API key as the Next.js backend.
PostgreSQL connection string for local Supabase.Format: postgresql://postgres:postgres@127.0.0.1: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:
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:
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