Enhance
Reference

Self-Hosting

Run Enhance on your own infrastructure with Docker.

Enhance can be self-hosted on your own infrastructure. This guide covers requirements, Docker setup, and production deployment.

Requirements

  • Node.js 20+
  • pnpm package manager
  • PostgreSQL 16+ with pgvector extension
  • Redis 7+
  • OpenAI API key (or Google Gemini key)

Hardware recommendations

EnvironmentCPURAMStorage
Development2 cores4 GB20 GB
Production4+ cores8+ GB50+ GB

Quick start with Docker

1. Start infrastructure services

cd bin
docker-compose up -d

This starts PostgreSQL (with pgvector) and Redis. Default credentials:

  • PostgreSQL: prisma:prisma@localhost:5432/byggdrasil
  • Redis: localhost:6379

2. Install dependencies

pnpm install

3. Configure environment

Create .env files for each service. See Environment Variables for the full reference.

Minimum required:

# packages/prisma/.env
DATABASE_URL="postgresql://prisma:prisma@localhost:5432/byggdrasil"

# apps/repo-worker/.env
DATABASE_URL="postgresql://prisma:prisma@localhost:5432/byggdrasil"
REDIS_URL="redis://localhost:6379"
OPENAI_API_KEY="sk-..."
INTERNAL_API_SECRET="<generate with: openssl rand -hex 32>"

# apps/web/.env
DATABASE_URL="postgresql://prisma:prisma@localhost:5432/byggdrasil"
BETTER_AUTH_SECRET="<generate with: openssl rand -hex 32>"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_REPO_WORKER_URL="http://localhost:3001"
OPENAI_API_KEY="sk-..."
INTERNAL_API_SECRET="<same value as repo-worker>"
ENCRYPTION_KEY="<generate with: openssl rand -hex 32>"

4. Run database migrations

cd packages/prisma
pnpm db:migrate    # Creates tables and pgvector setup
pnpm db:seed       # Seeds workflows and default data

5. Start services

# Terminal 1: Repo worker (API + job processor)
cd apps/repo-worker && pnpm dev:all

# Terminal 2: Web app
cd apps/web && pnpm dev

Open http://localhost:3000 to access Enhance.

Production deployment

Key differences from local

  • Set NODE_ENV=production (disables password auth, uses secure cookies)
  • Use managed PostgreSQL (AWS RDS, Neon, Supabase, etc.) with automated backups
  • Use managed Redis (Upstash, AWS ElastiCache, etc.)
  • Use strong, unique secrets for all _SECRET / _KEY variables
  • Deploy the web app to Vercel, Netlify, or a container platform
  • Deploy the repo worker as a container (Docker on EC2/ECS/Kubernetes)

Database migrations in production

cd packages/prisma
npx prisma migrate deploy    # Applies pending migrations (safe for production)

Network requirements

PortServiceAccess
3000Web appPublic (user-facing)
3001Repo workerInternal (web app calls it)
5432PostgreSQLInternal
6379RedisInternal

Outbound HTTPS is required for: OpenAI API, GitHub API, integration providers, email service.