Security advisory — Malicious litellm versions 1.82.7 and 1.82.8 were removed from PyPI (potential API key exfiltration). Uninstall them, rotate exposed credentials, and upgrade to a safe release (e.g. 1.82.9+). Run pip show litellm to verify. PyPI · README

Local / private deployment (Docker self-host)

For Vercel hosted deployment, see README.md and vercel-env-checklist.md. This document is the fully local path.

Local / private deployment (Docker self-host)

When to use this: Start Postgres/Redis with Docker on your own server or machine, and run web-portal + admin-console + Gateway, without depending on hosted platforms such as Vercel / Supabase.

Audience: Private delivery, intranet deployment, offline evaluation.

Last updated: 2026-06-01

For Vercel hosted deployment, see README.md and vercel-env-checklist.md. This document is the fully local path.


1. Prerequisites

ToolRequirementNotes
Node.js≥ 20Run web-portal / admin-console (Next.js)
pnpmLatest stableMonorepo package manager
Go≥ 1.22Build and run the AI gateway
Docker + Compose v2Any recent versionStart local Postgres / Redis
opensslUsually preinstalledGenerate the RSA JWT key pair

Required free ports: 3000 (portal), 3001 (admin), 8088 (Gateway), 5432 (Postgres), 6379 (Redis).


2. Start from zero (recommended path)

First decide which scenario you are in:

ScenarioRecommended commandNotes
First deploy on this machinebash scripts/bootstrap.shInitializes .env.local, keys, Postgres/Redis, migrations, and seed data
Test environment you want to wipe and start overbash scripts/bootstrap.sh --reset-dbDeletes the local Postgres data volume and rebuilds; development / POC only
External Postgres already existsbash scripts/bootstrap.sh --mode=serverDoes not start Docker middleware; requires DATABASE_URL and keys from the outside

Note: Deleting a Docker image is not the same as wiping the database. Postgres data usually lives in a Docker volume. If the old database still has half-finished migrations, leftover tables, or bad connections, deleting the image and rerunning can still fail. To rebuild a test environment, use --reset-db.

1. First-time initialization

bash
1cd enterprise
2
3# Interactive setup of two login passwords, each ≥14 characters, with upper/lower case, digits, and symbols
4bash scripts/bootstrap.sh

For a test-environment reinstall, when you explicitly allow wiping the database:

bash
1cd enterprise
2bash scripts/bootstrap.sh --reset-db

2. Start the three apps

After bootstrap.sh succeeds, start the applications:

bash
1bash scripts/start-dev-with-infra.sh --ui=stream

--ui=stream prints the three apps' logs directly, which is clearer for live troubleshooting than the Turbo TUI.

3. Success criteria

After startup, visit:

ServiceURL
Employee portal<http://localhost:3000>
Admin console<http://localhost:3001>
Gateway health check<http://localhost:8088/healthz>

The default login is admin@agenticx.local. The password is the value you set in step 2 (written to enterprise/.env.local):

bash
1grep -E 'ADMIN_CONSOLE_LOGIN_PASSWORD|AUTH_DEV_OWNER_PASSWORD' .env.local

staff@agenticx.local is not in the default seed. Create it manually in the admin console after login.

4. If bootstrap.sh fails midway

Do not keep rerunning it. Collect information in this order:

bash
1cd enterprise
2ls -lt .runtime/logs/
3tail -n 120 .runtime/logs/bootstrap-*.log
4tail -n 120 .runtime/logs/db-migrate-*.log 2>/dev/null || true
5docker ps
6docker logs --tail=120 agenticx-postgres-dev

If the terminal only shows something like:

text
1ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @agenticx/db-schema@0.1.0 db:migrate: `drizzle-kit migrate`
2Exit status 1

that is only the pnpm/drizzle summary, not the real cause. The actual PostgreSQL error is usually in .runtime/logs/bootstrap-*.log or the Postgres container logs.


3. What bootstrap.sh does

  1. Preflight: node / pnpm / go / docker / openssl
  2. Generate enterprise/.env.local (chmod 600, already gitignored)
  3. Generate an RSA-2048 JWT key pair under enterprise/.local-secrets/*.pem
  4. pnpm install
  5. Start Postgres + Redis with Docker (deploy/docker-compose/dev.yml)
  6. db:migrate + db:seed (create tables + default tenant / owner)
  7. migrate:legacy-runtime (idempotently import old JSON config into PG)

Common options:

bash
1bash scripts/bootstrap.sh --reset-db # Destroy the PG data volume and rebuild (development only)
2bash scripts/bootstrap.sh --skip-docker # You already have a standalone Postgres; skip compose
3bash scripts/bootstrap.sh --mode=server # Non-interactive; all keys/passwords must come from external env vars

bootstrap.sh is an initialization script, not a long-running service start command. In production / Enterprise delivery test environments, run database migration once as a separate release step. Do not let multiple application replicas migrate at the same time on startup.


4. Day-to-day and maintenance commands

bash
1# Middleware is already running; start apps only
2bash scripts/start-dev.sh --ui=stream
3
4# Stop middleware containers only (does not delete volumes)
5bash scripts/start-dev-with-infra.sh --down
6
7# Old JSON runtime config → PG (machine restore / portal has no models)
8pnpm migrate:legacy-runtime
9
10# Clear development traces (chat / usage / gateway counters) without deleting primary data
11bash scripts/reset-dev-data.sh

Middleware container names are fixed as agenticx-postgres-dev / agenticx-redis-dev. --down does not delete volumes. To wipe PG, use bootstrap.sh --reset-db.


5. Connect a real model (optional)

Recommended (admin GUI): Admin console → Platform configuration → Model services → Add vendor → fill in the API Key → Test → Save → Identity & access → Users → check "visible model assignment".

Alternative (environment variables): Append to enterprise/.env.local, for example:

bash
1DEEPSEEK_API_KEY=sk-...
2LLM_API_KEY=sk-... # generic fallback

Runtime configuration (model services / user-visible models / token quotas) uses Postgres as the single source of truth (enterprise_runtime_* tables). Gateway rereads provider config about every 5 seconds, so admin changes take effect within a few seconds with no restart. Key resolution rules are in ../gateway/runtime-config.md.


6. Enterprise servers (non-interactive / external Postgres)

On a server, stay non-interactive and inject all secrets from the outside:

bash
1export DATABASE_URL='postgresql://user:pass@db-host:5432/agenticx'
2export AUTH_JWT_PRIVATE_KEY="$(cat /secure/path/auth_private.pem)"
3export AUTH_JWT_PUBLIC_KEY="$(cat /secure/path/auth_public.pem)"
4export ADMIN_CONSOLE_LOGIN_PASSWORD='...'
5export ADMIN_CONSOLE_SESSION_SECRET='...'
6bash scripts/bootstrap.sh --mode=server
  • --mode=server does not start Docker and requires a reachable external Postgres (DATABASE_URL).
  • Production builds use pnpm build plus each app's own start. Gateway is go build ./apps/gateway/cmd/gateway, producing a single binary run as its own process.
  • Full environment variable groups are in ../configuration/env-vars.md.

7. Common issues

SymptomAction
start-dev.sh reports missing AUTH_JWT_*Bootstrap was not run, or PEM files were deleted → rerun bootstrap.sh
Portal chat history operation failedPG/Redis is not up → use start-dev-with-infra.sh
Admin login password is wrongEnv was changed after seed → rerun bootstrap or reset-dev-data.sh --with-seed
Portal has no models to selectAdmin has not configured models / has not assigned visible models → configure them, or pnpm migrate:legacy-runtime
db:migrate only shows ERR_PNPM_RECURSIVE_RUN_FIRST_FAILRead .runtime/logs/bootstrap-*.log / db-migrate-*.log first; do not stop at the terminal summary
Migration still fails after deleting imagesImages are not the data; in a test environment use bash scripts/bootstrap.sh --reset-db to wipe the PG volume
Port in use (3000/3001/8088)lsof -i :8088 then kill the old process
Docker CLI hangs with no responseSee ../development/troubleshooting.md

For fuller troubleshooting see ../development/troubleshooting.md and ../../scripts/README.md.

Made-with: Damon Li