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
.nvmrcfor 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
- Automated Setup (Recommended)
- Manual Setup
For a quick and automated setup, use our setup script:This script will automatically:With external integrations (webhooks, etc.):Once everything is running, open http://localhost:3000 in your browser.
- Check all required dependencies (Node.js, pnpm, Docker, OpenSSL)
- Install project dependencies
- Create the
.envfile from.env.example - Generate the security keys
- Create the
kodus-backend-servicesandshared-networkDocker networks - Print the next steps
Database migrations and seeds run automatically on container boot — the dev compose
file defaults
RUN_MIGRATIONS and RUN_SEEDS to true. You don’t need a separate step.If you set them to false to manage them yourself, run pnpm run migration:run and
pnpm run seed from the host.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
- Start services:
pnpm run docker:start(migrations and seeds run automatically) - Open the app: Visit
http://localhost:3000 - Health check:
pnpm run dev:health-check
Development with External Integrations
If you need to test integrations with external services (like Git webhooks):- Start services:
pnpm run docker:start - Create tunnel:
pnpm run tunnel(creates public endpoint) - Update webhook URLs: The tunnel command updates your
.envautomatically - Configure Git provider: Use the tunnel URL in your Git provider webhook settings
- 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
- 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,/healthand basic connectivity
Manual Verification
- Check Web UI: Visit
http://localhost:3000in your browser - Check API health: Visit
http://localhost:3001/health - Check RabbitMQ: Visit
http://localhost:15672(default credentials:dev/devpass, fromRABBITMQ_DEFAULT_USERandRABBITMQ_DEFAULT_PASSin.env) - Verify database connections: Check the logs for successful database connections
- 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/.../webhookto the webhooks service)
Setup Script Issues
If the automated setup script (pnpm run setup) fails:
Missing dependencies:
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
- Verify your
.envfile exists in the project root - Check that there are no trailing spaces in variable assignments
- Ensure all required security keys were generated properly
- Run
pnpm run dev:health-checkto 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:logsfor startup errors
- The API takes time to fully initialize after container startup
- Check if migrations and seed data are loaded
- Verify the
.envfile has all required variables - Run health check to see which specific components are failing
- No model is connected. Open AI providers, or set
API_LLM_PROVIDER_MODELand a key in.env.
SANDBOX_PROVIDER=e2bwith noAPI_E2B_KEYruns reviews without a sandbox. SetSANDBOX_PROVIDER=local.
- Use
pnpm run tunnelto 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