Skip to content

Installation (development)

This guide gets Orimora running on your computer for development and evaluation. You do not need prior Docker experience for the recommended path.

For production on your own server see Deployment. For Coolify see Coolify Setup.

PathBest forWhat you install
A — Docker Compose (recommended)Beginners, quick startDocker Desktop only — Postgres, Redis, and Mailpit start automatically
B — Native YarnActive development on the codebaseNode.js 22+, Yarn, PostgreSQL 16+, Redis 7+ on your machine

Both paths use the same .env file. The variable reference at the bottom applies to both.


Path A — Docker Compose (recommended)

  1. Install Docker Desktop (Mac/Windows) or Docker Engine + Compose on Linux. Verify:

    Terminal window
    docker compose version
  2. Clone the repository and install Node dependencies:

    Terminal window
    git clone https://github.com/defcon1702/orimora.git orimora
    cd orimora
    yarn install
  3. Start infrastructure (PostgreSQL, Redis, Mailpit):

    Terminal window
    docker compose up -d

    This reads docker-compose.yml in the repo root. Services:

    ServicePurposeHost port
    postgresDatabase5433 → container 5432
    redisSessions, queues, rate limits6379
    mailpitCatches outgoing email (magic links)SMTP 1026, Web UI 9025

    Optional Redis GUI (profile tools): docker compose --profile tools up -dhttp://localhost:8081

  4. Create your .env file:

    Terminal window
    cp .env.example .env

    Paste this minimum working dev configuration (secrets are examples — generate your own for anything shared):

    Terminal window
    # ── Required ─────────────────────────────────────────────
    DATABASE_URL=postgresql://kb:kb_dev_password@localhost:5433/knowledgebase
    REDIS_URL=redis://localhost:6379
    APP_URL=http://localhost:5173
    SESSION_SECRET=PASTE_64_HEX_CHARS_HERE
    MAGIC_LINK_SECRET=PASTE_ANOTHER_64_HEX_CHARS_HERE
    LLM_ENCRYPTION_KEY=PASTE_THIRD_64_HEX_CHARS_HERE
    PUBLISHING_ENCRYPTION_KEY=PASTE_FOURTH_64_HEX_CHARS_HERE
    # ── Email via Mailpit (optional but useful) ──────────────
    SMTP_HOST=localhost
    SMTP_PORT=1026
    SMTP_FROM=noreply@orimora.local
    # ── Dev defaults ─────────────────────────────────────────
    NODE_ENV=development
    ALLOW_REGISTRATION=true

    Generate four independent secrets (run four times):

    Terminal window
    node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
  5. Run database migrations:

    Terminal window
    yarn db:migrate

    Repeat after every git pull that adds files under src/lib/server/db/migrations/.

  6. Start the dev server:

    Terminal window
    yarn dev
  7. Open the app at http://localhost:5173 and complete onboarding (creates your workspace admin).

  8. Verify health:

    Terminal window
    curl -s http://localhost:5173/api/health

    Magic-link emails appear in the Mailpit UI: http://localhost:9025


Path B — Native Yarn (without Docker)

  1. Install prerequisites:

    ToolVersion
    Node.js22 LTS or 24
    Yarnas used in repo scripts
    PostgreSQL16+
    Redis7+
  2. Clone and install (same as Path A steps 2).

  3. Create PostgreSQL database:

    Terminal window
    createdb knowledgebase
    redis-cli ping # must return PONG
  4. Configure .env — adjust DATABASE_URL to your local Postgres user/password/port (default port 5432, not 5433):

    Terminal window
    DATABASE_URL=postgresql://YOUR_USER:YOUR_PASSWORD@localhost:5432/knowledgebase
    REDIS_URL=redis://localhost:6379
    APP_URL=http://localhost:5173
    # … same secrets as Path A
  5. Migrate, dev server, verify — same as Path A steps 5–8.


Environment variables — complete reference

Section titled “Environment variables — complete reference”

The canonical list lives in .env.example. Below: every variable in plain language.

Required for local dev — 7 variables

Minimum to boot the dev server.

VariableWhat it doesExample / how to set
DATABASE_URLPostgreSQL connection stringPath A: postgresql://kb:kb_dev_password@localhost:5433/knowledgebase
REDIS_URLRedis for sessions, queues, rate limitsredis://localhost:6379
APP_URLPublic URL of the app (magic links, OAuth redirects)http://localhost:5173 in Vite dev
SESSION_SECRETSigns HTTP-only session cookies (min 32 bytes)64 hex chars via randomBytes(32)
MAGIC_LINK_SECRETSigns passwordless login tokensSeparate 64 hex value
LLM_ENCRYPTION_KEYEncrypts stored LLM API keys at rest64 hex chars — required even if AI is unused
PUBLISHING_ENCRYPTION_KEYEncrypts webhook secrets and publishing credentials64 hex chars
Docker Compose helper
VariableWhat it doesDefault
COMPOSE_FILEWhich compose file docker compose uses locallydocker-compose.yml (set in .env.example)
Optional auth hardening
VariableWhat it doesDefault if unset
API_KEY_SECRETHashes API keys at restMAGIC_LINK_SECRET
EMAIL_CHANGE_SECRETSigns email-change tokensMAGIC_LINK_SECRET
ACCOUNT_DELETION_SECRETSigns account-deletion tokensSESSION_SECRET
SESSION_IDLE_TIMEOUT_DAYSLog out idle sessions after N days; 0 = disabled7
OAuth (optional)

Register redirect URIs in each provider console as {APP_URL}/auth/google/callback, /auth/microsoft/callback, /auth/oidc/callback.

VariableWhat it does
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETGoogle sign-in
MICROSOFT_TENANT_IDAzure tenant ID or common
MICROSOFT_CLIENT_ID / MICROSOFT_CLIENT_SECRETMicrosoft sign-in
OIDC_ISSUER / OIDC_CLIENT_ID / OIDC_CLIENT_SECRETGeneric OpenID Connect
OIDC_SCOPESpace-separated scopes (default: openid email profile)
Email / SMTP

Leave empty to skip email (use OAuth instead). With Mailpit (Path A): SMTP_HOST=localhost, SMTP_PORT=1026.

VariableWhat it does
SMTP_HOSTMail server hostname
SMTP_PORTUsually 587 (STARTTLS) or 465
SMTP_USER / SMTP_PASSWORDCredentials (empty for Mailpit)
SMTP_FROMSender address
App behaviour
VariableWhat it doesDefault
NODE_ENVdevelopment or productiondevelopment
ALLOW_REGISTRATIONAllow open sign-upfalse in .env.example; use true locally
DOCS_URLRedirect target for /docs in the apphttps://docs.orimora.com
EXTRA_ALLOWED_ORIGINSExtra allowed origins for WebSocket /collab (comma-separated)
Collaboration (real-time editing)
VariableWhat it doesDefault
COLLAB_SECRETOptional shared secret for collab WebSocketunset in dev
COLLAB_MAX_CONNECTIONSMax simultaneous collab connections50
COLLAB_MAX_YJS_STATE_BYTESMax persisted Yjs document size (DoS guard)8388608 (8 MB)

Real-time editing uses WebSocket path /collab on the same origin as the app. Vite handles the upgrade in dev.

Operations (mostly production)
VariableWhat it does
CRON_SECRETProtects POST /api/admin/cron.cleanup (trash purge, invite reminders)
ORIMORA_API_KEYFor local MCP CLI (yarn mcp) — create in Settings → Developers
AI, S3, backups, push, quotas
GroupVariables
AI & publishingLLM_ENCRYPTION_KEY, PUBLISHING_ENCRYPTION_KEY, GIT_MIRROR_ALLOWED_HOSTS
Upload storage (opt-in: STORAGE_DRIVER=s3)STORAGE_DRIVER, S3_BUCKET, S3_REGION, S3_ACCESS_KEY, S3_SECRET_KEY, S3_ENDPOINT, S3_FORCE_PATH_STYLE, S3_PRESIGN_TTL_SECONDS
BackupsBACKUP_ENABLED, BACKUP_PATH, BACKUP_RETENTION_DAILY, BACKUP_RETENTION_WEEKLY, BACKUP_SCHEDULE, BACKUP_S3_BUCKET, BACKUP_PG_DUMP_TIMEOUT_MS
Web PushVAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT — generate with node scripts/generate-vapid-keys.mjs
Webhook/publishing tuningWEBHOOK_*, PUBLISHING_* — see Configuration
Storage quotaDEFAULT_TEAM_STORAGE_QUOTA_BYTES, STORAGE_QUOTA_WARN_PERCENT

SymptomFix
DATABASE_URL connection refusedPath A: run docker compose up -d; use port 5433 not 5432
Redis errorsCheck REDIS_URL; redis-cli ping
Migrations failSame DATABASE_URL as running app; DB user needs DDL rights
Magic link never arrivesConfigure SMTP or open Mailpit at http://localhost:9025
WebSocket / collab failsFirewall must allow WS to APP_URL; check EXTRA_ALLOWED_ORIGINS
Boot error about encryption keysSet both LLM_ENCRYPTION_KEY and PUBLISHING_ENCRYPTION_KEY
401 on /api/v1/*Use Authorization: Bearer kb_… from Settings → Developers