Self-Hosting
Self-Hosting
You don’t have to use Kernova Cloud. The framework runs anywhere Node.js runs.
Option 1: Docker (Recommended)
Generate a Dockerfile:
kernova deploy dockerThis creates:
# Multi-stage: build frontend + run agentsFROM node:24-alpine AS frontend-buildWORKDIR /appCOPY package*.json ./RUN npm ciCOPY . .RUN npx next build
FROM node:24-alpine AS productionWORKDIR /appCOPY package*.json ./RUN npm ci --productionCOPY --from=frontend-build /app/.next ./.nextCOPY --from=frontend-build /app/public ./publicCOPY agents/ ./agents/COPY memory/ ./memory/COPY kernova.config.ts ./
ENV NODE_ENV=productionENV PORT=3000EXPOSE 3000
CMD ["node", "node_modules/.bin/kernova", "start"]Build and run:
docker build -t my-agent-app .docker run -p 3000:3000 --env-file .env.production my-agent-appOption 2: Node.js Direct
kernova buildkernova start --port 3000Or generate a standalone entry:
kernova deploy nodeThen run:
NODE_ENV=production npx tsx start.tsOption 3: Docker Compose
For a complete setup with a database:
version: '3.8'
services: app: build: . ports: - "3000:3000" environment: - NODE_ENV=production - OPENAI_API_KEY=${OPENAI_API_KEY} - DATABASE_URL=postgresql://postgres:postgres@db:5432/kernova depends_on: - db
db: image: postgres:16-alpine environment: - POSTGRES_DB=kernova - POSTGRES_PASSWORD=postgres volumes: - pgdata:/var/lib/postgresql/data
volumes: pgdata:docker compose up -dDeploying to Popular Platforms
Railway
# Push your repo to GitHub, then:# 1. Connect Railway to your GitHub repo# 2. Set environment variables in Railway dashboard# 3. Railway auto-detects the Dockerfile and deploysFly.io
fly launchfly secrets set OPENAI_API_KEY=sk-xxxfly deployDigitalOcean App Platform
# 1. Connect your GitHub repo# 2. Select "Dockerfile" as the build method# 3. Set env vars in the dashboard# 4. DeployAWS (ECS / Fargate)
# Build and push to ECRaws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URLdocker build -t my-app .docker tag my-app:latest $ECR_URL/my-app:latestdocker push $ECR_URL/my-app:latest
# Deploy via ECS task definitionHealth Check
All platforms need to know your app is healthy. The agent server exposes:
GET /health → 200 OKResponse:
{ "status": "healthy", "name": "my-app", "agents": [{"route": "support", "name": "Support Agent"}], "uptime": 3600}Configure your platform’s health check to hit this endpoint.
Data Persistence
By default, memory and events are stored in SQLite at ./kernova-data/. For self-hosted deployments:
- Docker: Mount a volume at
/app/kernova-data - Kubernetes: Use a PersistentVolumeClaim
- Serverless: Won’t work (data lost on restart) — use an external database
Scaling
The framework server is stateful (it holds conversation memory in SQLite). For horizontal scaling:
- Use an external database (PostgreSQL) for memory instead of local SQLite
- Use sticky sessions (route same user to same instance)
- Or run a single instance with vertical scaling (bigger machine)
For most agent workloads, a single instance handles thousands of concurrent conversations.