Installation
Set up CodePilot locally with step-by-step instructions for cloning, installing dependencies, configuring Docker, and starting all services.
This guide walks you through setting up CodePilot on your local machine. By the end, you will have the full stack running — frontend, API, worker, PostgreSQL, Redis, and Ollama.
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js ≥ 20 (download)
- pnpm ≥ 10 (install guide)
- Docker & Docker Compose (download)
- Ollama (download)
- Git
Why Ollama?
CodePilot uses Ollama to run AI models locally. No external API keys or cloud services are required — everything runs on your machine.
Step-by-Step Setup
Clone the Repository
git clone https://github.com/lovesinghal31/codepilot.git
cd codepilotInstall Dependencies
CodePilot uses pnpm workspaces to manage the monorepo. Install all dependencies from the root:
pnpm installnpm installyarn installbun installUse pnpm
CodePilot is configured as a pnpm workspace. Using npm or yarn may cause dependency resolution issues. We strongly recommend pnpm.
Start Infrastructure Services
Start PostgreSQL (with pgvector) and Redis using Docker Compose:
docker compose up -dThis starts:
- PostgreSQL (
pgvector/pgvector:pg18) on port5432 - Redis Stack on port
6379(with RedisInsight on port8001)
Start Ollama and Pull Models
Start Ollama, then pull the required AI models:
ollama pull nomic-embed-text
ollama pull qwen2.5-coder:3b
ollama pull qwen2.5:7b| Model | Purpose | Size |
|---|---|---|
nomic-embed-text | Generating 768-dimensional vector embeddings | ~274 MB |
qwen2.5-coder:3b | Code chat and PR review responses | ~1.9 GB |
qwen2.5:7b | Repository overview and health analysis | ~4.4 GB |
Configure Environment Variables
Copy the environment files and update them with your configuration:
cp .env.example .env
cp .env.api.example .env.api
cp .env.worker.example .env.worker
cp .env.web.example .env.webSee the Environment Variables page for a complete reference of all required variables.
GitHub App Required
For GitHub OAuth and webhook functionality, you need to create a GitHub App. See Authentication for setup instructions.
Run Database Migrations
Generate the Prisma client and apply migrations:
pnpm --filter @repo/db run db:generate
pnpm --filter @repo/db run db:migrateStart All Services
Start the entire development stack with a single command:
pnpm devThis starts all services concurrently via Turborepo:
- Web — Next.js frontend on http://localhost:3000
- API — Express server on http://localhost:8080
- Worker — BullMQ job processor
- Docs — Documentation on http://localhost:3001
Verify Installation
Once everything is running, verify the setup:
- Open http://localhost:3000 — you should see the CodePilot dashboard
- Open http://localhost:8080/api/health — the API health check should return
200 OK - Open http://localhost:8001 — RedisInsight should show the connected Redis instance