This guide covers production builds, system requirements, deployment, and troubleshooting.
cd backend
# Build JAR
mvn clean package
# Build native executable (requires GraalVM)
mvn clean package -PnativeOutput:
- JAR:
backend/target/megabrain-1.0.0-SNAPSHOT.jar - Native:
backend/target/megabrain-1.0.0-SNAPSHOT
cd frontend
# Build for production
npm run buildOutput: backend/src/main/resources/META-INF/resources/
The frontend is served by Quarkus in production (no separate web server needed).
Minimum:
- CPU: 2 cores
- RAM: 4 GB
- Disk: 10 GB
Recommended:
- CPU: 4+ cores
- RAM: 8+ GB
- Disk: 50+ GB (for indexes and graph database)
| Service | Default Port | Required |
|---|---|---|
| MegaBrain Backend | 8080 | Yes |
| Angular Dev Server | 4200 | Development only |
| PostgreSQL | 5432 | Optional (for vector search) |
| Neo4j | 7687 (Bolt) | Optional (for graph queries) |
| Ollama | 11434 | Optional (for local LLM) |
Docker configuration will be added in future versions.
- Set environment variables for all sensitive data (tokens, API keys, passwords)
- Configure database connections (PostgreSQL for vector search, Neo4j for graph)
- Set up SSL/TLS certificates and enforce HTTPS
- Configure logging levels (set
quarkus.log.level=WARNfor production) - Set up monitoring and alerts
- Limit exposure of
/q/*management endpoints - Never log tokens -- verify with
quarkus.log.category."io.megabrain".level=INFO
- Backend port is configurable via
quarkus.http.port - Health check:
GET /q/healthreturns service status - Bitbucket Server: ensure
bitbucket-server-api/mp-rest/urlpoints to the server root (no/restsuffix); clone URL is derived as<base>/scm/<project>/<repo>.git - LLM providers: prefer Ollama for on-premises deployments; cloud providers require API keys
- Datastores: configure PostgreSQL, Neo4j, Lucene index path, and optional vector store before production use
Issue: Port 8080 already in use
Solution:
lsof -i :8080
# Kill the process or change port:
# quarkus.http.port=8081Issue: Dependency resolution failed
Solution:
cd backend
mvn clean install -UIssue: Angular CLI not found
Solution:
npm install -g @angular/cli@20Issue: Port 4200 already in use
Solution:
ng serve --port 4201Issue: Ollama connection failed
Solution:
- Verify Ollama is running:
ollama serve - Check base URL in
application.properties(megabrain.llm.ollama.base-url) - Verify model is available:
ollama list
Issue: OpenAI/Anthropic API key invalid
Solution:
- Verify API key in environment variables
- Check API key has correct permissions
- Verify billing is active (for paid providers)
Issue: PostgreSQL connection refused
Solution:
- Verify PostgreSQL is running:
pg_isready - Check connection URL in
application.properties - Ensure
quarkus.datasource.jdbc=true(disabled by default)
Issue: pgvector extension not found
Solution:
CREATE EXTENSION IF NOT EXISTS vector;Enable Debug Logging:
# Backend
quarkus.log.level=DEBUG
quarkus.log.category."io.megabrain".level=TRACEFrontend:
- Open browser DevTools (F12)
- Check Console and Network tabs
Common Log Locations:
- Backend logs: Console output (Quarkus dev mode)
- Frontend logs: Browser console