OrcAI
Self-hosting

Manual setup

Run the Bun app and workers directly against managed services.

Use manual setup when you want to run OrcAI directly on a host instead of using the full Compose stack.

Prerequisites

  • Bun >=1.3.10
  • PostgreSQL
  • Qdrant
  • SpiceDB
  • S3-compatible object storage
  • An OpenAI-compatible endpoint for embeddings
  • Tesseract with eng and deu language packs if workers run on the host
  • An SMTP server (optional)

Install dependencies

Repository root
cp .env.example .env
bun install --frozen-lockfile

Edit .env before starting the app. Configuration lists the required variables.

Initialise data stores

Apply the database migrations and the SpiceDB schema:

Repository root
bun run stack migrate

Package scripts do not read the root .env, so run them through bun run stack, which loads it. bun run stack exec -- <command> does the same for any other command.

Start development processes

Start the app:

Terminal 1
bun run dev

Start background workers in a separate terminal:

Terminal 2
bun run workers:dev

The app is then at http://localhost:3000. On a fresh database, complete the instance setup at http://localhost:3000/init, as described in Initialise the instance.

Production commands

Build and start the app:

App process
bun run build
bun run stack exec -- bun run start

Start workers:

Worker process
bun run stack exec -- bun run workers:start

OCR on the host

OCR-backed asset preparation runs in the worker process. When workers run outside Docker, install Tesseract and the configured language packs. Use KREUZBERG_OCR_LANGUAGE=eng+deu only where both packs are installed.

On this page