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
| Environment | CPU | RAM | Storage |
|---|---|---|---|
| Development | 2 cores | 4 GB | 20 GB |
| Production | 4+ cores | 8+ GB | 50+ 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/_KEYvariables - 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
| Port | Service | Access |
|---|---|---|
| 3000 | Web app | Public (user-facing) |
| 3001 | Repo worker | Internal (web app calls it) |
| 5432 | PostgreSQL | Internal |
| 6379 | Redis | Internal |
Outbound HTTPS is required for: OpenAI API, GitHub API, integration providers, email service.