Installation
This page covers the full installation process in detail, including all environment variables, database setup, and Docker self-hosting.
System Requirements
| Requirement | Minimum | Recommended | |-------------|---------|-------------| | Node.js | 18.0.0 | 20+ LTS | | npm | 9.0.0 | 10+ | | PostgreSQL | 14 | 16 (with pgvector extension) | | Redis | 6 | 7 | | RAM | 512 MB | 2 GB | | Disk | 500 MB | 2 GB |
Managed services recommended
For development, use Neon (PostgreSQL) and Upstash (Redis). Both have free tiers that cover development workloads. For production self-hosting, see the Docker section below.
Installation Methods
Method 1: Local Development (npm)
git clone https://github.com/SingularityAI-Dev/modular9.git
cd modular9
npm install
Method 2: Docker Self-Host (Coming Soon)
A full Docker Compose stack is included for production self-hosting. This is the recommended path for regulated industries (HIPAA, GDPR) that cannot send data to third-party infrastructure.
cp .env.example .env
# Configure your environment variables
docker compose up -d
The Docker stack includes: app, worker, postgres, redis, and caddy (reverse proxy with automatic TLS).
Docker is in beta
The Docker self-host path is functional but not yet documented end-to-end. For production use, contact the team for a guided setup.
Environment Variables
Create .env.local (for local dev) or .env (for Docker) from .env.example:
cp .env.example .env.local
Required Variables
| Variable | Description | Where to get it |
|----------|-------------|-----------------|
| DATABASE_URL | PostgreSQL connection string | neon.tech or your postgres instance |
| REDIS_KV_REST_API_URL | Upstash Redis REST URL | upstash.com |
| REDIS_KV_REST_API_TOKEN | Upstash Redis REST token | upstash.com |
| NVIDIA_API_KEY | NVIDIA NIM API key | build.nvidia.com |
| AUTH_SECRET | Auth.js session secret | openssl rand -base64 32 |
| NVIDIA_DEMO_API_KEY | API key for /demo route | Same as NVIDIA_API_KEY |
Optional Variables
| Variable | Description |
|----------|-------------|
| GOOGLE_CLIENT_ID | Google OAuth client ID |
| GOOGLE_CLIENT_SECRET | Google OAuth client secret |
| GITHUB_CLIENT_ID | GitHub OAuth client ID |
| GITHUB_CLIENT_SECRET | GitHub OAuth client secret |
| ENCRYPTION_KEY | AES-256-GCM key for BYOK secrets (auto-generated if unset) |
Full Example
# === Database ===
DATABASE_URL="postgresql://user:pass@host/modular9?sslmode=require"
# === Redis (Upstash) ===
REDIS_KV_REST_API_URL="https://your-region.upstash.io"
REDIS_KV_REST_API_TOKEN="AXXXabc..."
# === AI ===
NVIDIA_API_KEY="nvapi-xxxxxxxxxxxxxxxx"
NVIDIA_DEMO_API_KEY="nvapi-xxxxxxxxxxxxxxxx"
# === Auth ===
AUTH_SECRET="your-64-char-base64-secret"
AUTH_URL="http://localhost:3000" # or your production URL
# === OAuth (optional) ===
GOOGLE_CLIENT_ID="123456789-xxx.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="GOCSPX-xxx"
GITHUB_CLIENT_ID="Iv1.xxx"
GITHUB_CLIENT_SECRET="xxx"
Database Setup
Modular9 uses Drizzle ORM with PostgreSQL. The schema includes:
users— Auth.js user recordsaccounts/sessions— Auth.js session managementworkflows— saved workflow canvas states (nodes + edges as JSON)workflow_runs— execution history and statustriggers— cron, webhook, and chat trigger configurationsuser_settings— per-user LLM defaults and API key storage (encrypted)knowledge_bases+knowledge_chunks— RAG document storage with pgvector
Run Migrations
Push the schema to your PostgreSQL instance:
npx drizzle-kit push
pgvector Extension
The Knowledge Base feature requires the pgvector extension. If you're using Neon, it's enabled by default. For a self-hosted PostgreSQL instance:
CREATE EXTENSION IF NOT EXISTS vector;
pgvector is required for Knowledge Base nodes
If pgvector is not installed, the Knowledge Base node will fail at execution time. All other features work without it.
Verifying Your Installation
Start the development server:
npm run dev
Then check each layer:
1. Application Health
Visit http://localhost:3000. You should see the Modular9 canvas or onboarding modal.
2. Database Connectivity
Visit http://localhost:3000/api/health. The response should include:
{
"status": "ok",
"db": "ok",
"redis": "ok"
}
3. Plugin Registry
Visit http://localhost:3000/api/plugins. This returns the list of loaded plugins. You should see 120+ plugins.
Common Installation Issues
Common problems and solutions
DATABASE_URL connection refused
Verify your PostgreSQL connection string. Neon requires ?sslmode=require appended.
Could not find a declaration file for module 'next-mdx-remote'
Run npm install again — this is a post-install type declaration issue.
relation "workflows" does not exist
The migrations haven't run. Execute npx drizzle-kit push.
Redis ENOTFOUND
Check your REDIS_KV_REST_API_URL — it should be a full HTTPS URL, not just a hostname.
Plugin registry returns 0 plugins
This usually means the src/plugins/ directory is missing or the process.cwd() is wrong. Ensure you're running from the project root.
Next Steps
- Quick Start — build your first workflow
- LLM Configuration — configure your AI providers
- Building Workflows — workflow composition guide