Skip to main content
This guide is for local development purposes. For production deployment, please refer to the Deploy Kodus guide.
.env.example is the template shared with Kodus Cloud, so a fresh .env ships API_CLOUD_MODE=true and SANDBOX_PROVIDER=e2b. To run the way a self-hosted instance does, set API_CLOUD_MODE=false and SANDBOX_PROVIDER=local in .env before you start the services. With API_CLOUD_MODE=false the daily anonymous heartbeat to telemetry.kodus.io is enabled by default. If you don’t want your local experiments showing up in the fleet, set KODUS_TELEMETRY_DISABLED=true. See Anonymous Telemetry for what is sent and how to inspect it.

Prerequisites

  • Node.js (see .nvmrc for the pinned version)
  • pnpm
  • Docker
  • OpenSSL
  • An LLM API key
kodus-ai is a pnpm workspace — pnpm-lock.yaml is the only lockfile in the repo. npm and yarn are not supported for local development.

Running the project

Connect a model

Kodus needs a model to run reviews. Pick one way before you start the services:
  • In the app. After you sign in, open AI providers in the sidebar and connect a provider with your key. See BYOK.
  • In .env. One model for the whole instance:
    See LLM Provider Configuration for what each provider needs. A model connected on the AI providers page overrides the one in .env.

Optional services

pnpm run docker:start does not start the MCP Manager or the analytics worker. Add them with KODUS_DEV_EXTRAS:

Development workflow

Basic Local Development

  1. Start services: pnpm run docker:start (migrations and seeds run automatically)
  2. Open the app: Visit http://localhost:3000
  3. Health check: pnpm run dev:health-check

Development with External Integrations

If you need to test integrations with external services (like Git webhooks):
  1. Start services: pnpm run docker:start
  2. Create tunnel: pnpm run tunnel (creates public endpoint)
  3. Update webhook URLs: The tunnel command updates your .env automatically
  4. Configure Git provider: Use the tunnel URL in your Git provider webhook settings
  5. Test integration: Trigger webhooks and monitor logs
Tunnel Benefits:
  • Test real webhook integrations locally
  • Debug external service communications
  • Share your development environment with team members
  • Test mobile apps or other external clients

Troubleshooting

Quick Health Check

This health check validates:
  • Services: the API, worker, webhooks, web, PostgreSQL, MongoDB and RabbitMQ containers
  • Port availability: Web (3000), API (3001), PostgreSQL (5432), MongoDB (27017), RabbitMQ (5672)
  • Database setup: migrations and seed data
  • API endpoints: /health/simple, /health and basic connectivity

Manual Verification

  1. Check Web UI: Visit http://localhost:3000 in your browser
  2. Check API health: Visit http://localhost:3001/health
  3. Check RabbitMQ: Visit http://localhost:15672 (default credentials: dev/devpass, from RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS in .env)
  4. Verify database connections: Check the logs for successful database connections
  5. Test webhook endpoints: Your Git provider webhooks should point to http://localhost:3332/[provider]/webhook (or to your API domain if a reverse proxy routes /.../webhook to the webhooks service)

Setup Script Issues

If the automated setup script (pnpm run setup) fails: Missing dependencies:
Permission issues with Docker:
Network creation errors:

Common Issues

Port conflicts:
  • Ensure ports 3000 (Web), 3001 (API), 3332 (Webhooks), 5432 (PostgreSQL), 27017 (MongoDB), and 5672/15672 (RabbitMQ) are available
  • Stop other services using these ports before starting Kodus
Environment variables not loading:
  • Verify your .env file exists in the project root
  • Check that there are no trailing spaces in variable assignments
  • Ensure all required security keys were generated properly
Health check failures:
  • Run pnpm run dev:health-check to get detailed diagnostics
  • Check if containers are fully started (wait 1-2 minutes after pnpm run docker:start)
  • Verify database migrations and seed data are loaded
  • Check API logs with pnpm run docker:logs for startup errors
API not responding:
  • The API takes time to fully initialize after container startup
  • Check if migrations and seed data are loaded
  • Verify the .env file has all required variables
  • Run health check to see which specific components are failing
Reviews don’t run:
  • No model is connected. Open AI providers, or set API_LLM_PROVIDER_MODEL and a key in .env.
Reviews have no cross-file context:
  • SANDBOX_PROVIDER=e2b with no API_E2B_KEY runs reviews without a sandbox. Set SANDBOX_PROVIDER=local.
Webhook issues with external services:
  • Use pnpm run tunnel to create a public endpoint for external webhooks
  • Update your Git provider webhook URLs to use the tunnel URL
  • Ensure the tunnel is running when testing webhook integrations
  • Check tunnel logs for connection issues