OpenCodeHub is a self-hosted Git platform with stacked PRs, merge queue, CI/CD pipelines, and AI code review. One platform for everything your team needs — no vendor lock-in, no per-seat pricing.
Documentation · Deploy in 5 minutes · CLI Reference
Watch the full walkthrough — deployment, stacked PRs, AI review, and merge queue in action.
| Problem | Solution |
|---|---|
| PRs too large to review | Stacked PRs — break changes into small, dependent branches |
| Merge conflicts on main | Merge Queue — stack-aware ordering with speculative CI builds |
| Slow review cycles | AI Code Review — catches bugs before humans even look |
| Split across 5+ services | All-in-one — Git, PRs, CI/CD, issues, wiki in one place |
| Data leaves your servers | Self-hosted — your code stays on your hardware |
- Git Hosting — HTTP smart protocol + SSH push/pull, forks, mirroring, LFS
- Pull Requests — Inline comments, approvals, suggested changes, draft PRs
- Issues & Projects — Labels, milestones, custom fields, kanban boards
- Wiki — Repository wiki with revision history
- Organizations — Teams, collaborators, role-based access control
- Stacked PRs — Graphite-style stacked branches with web + CLI support
- Merge Queue — Stack-aware queue with speculative builds and priority lanes
- CI/CD Pipelines — GitHub Actions-compatible engine with Docker-based runners
- Webhooks — Outbound webhooks with event filtering and HMAC signing
- Automations — Rule-based workflow automation for PRs and deployments
- AI Code Review — 10+ providers: GPT-4, Claude, Gemini, Groq, Ollama, OpenRouter
- Secret Scanning — Detect secrets in commits before they reach production
- Branch Protection — Required reviews, status checks, push restrictions
- Developer Metrics — PR velocity, review efficiency, time-to-merge tracking
- Authentication — JWT sessions, OAuth (GitHub, Google, GitLab), 2FA/TOTP, SSO/SAML
- Authorization — RBAC with roles, team permissions, collaborator levels
- Rate Limiting — Redis-backed per-endpoint rate limiting
- Audit Logging — Track all administrative actions
- REST API — 175+ endpoints covering all platform features
- GraphQL — Full GraphQL endpoint for flexible queries
- CLI —
ochcommand line tool with 20+ command groups - Storage — Local, S3, MinIO, R2, or any S3-compatible backend
git clone https://github.com/swadhinbiswas/OpencodeHub.git
cd OpenCodeHub
cp .env.example .env
docker compose up -d
docker compose exec app bun run scripts/seed-admin.tsOpen http://localhost:4321 and create your admin account.
Deploy to Render with free PostgreSQL + Upstash Redis:
# 1. Create free Redis at upstash.com (Singapore region)
# 2. Push to GitHub
# 3. Render → New → Blueprint → Select your repo
# 4. Set REDIS_URL and SITE_URL
# 5. DeploySee the Render Deployment Guide for step-by-step instructions.
| Platform | Guide | Cost |
|---|---|---|
| Docker Compose | Deployment Guide | Free |
| Render (Asia) | Render Guide | Free |
| Oracle Cloud | Free Deployment | Free forever |
| NAS (Synology/TrueNAS) | NAS Guide | Free |
| Kubernetes | K8s Guide | Free |
| Cloudflare Tunnel | Cloudflare Guide | Free |
# Install
npm install -g opencodehub-cli
# Login
och auth login --url http://localhost:4321
# Stacked PR workflow
och stack create feature/auth-step-1
och stack submit
och stack sync
# Merge queue
och queue list
och queue add <pr-number>
# Interactive cockpit
och focus# Create a repository
curl -X POST http://localhost:4321/api/repos \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"my-project","visibility":"public"}'
# List pull requests
curl http://localhost:4321/api/repos/owner/repo/pulls \
-H "Authorization: Bearer YOUR_TOKEN"
# GraphQL
curl -X POST http://localhost:4321/api/graphql \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ repositories { name owner { username } } }"}'| Layer | Technology |
|---|---|
| Framework | Astro 4.x (SSR) + React 18 |
| UI | Tailwind CSS + Radix UI |
| Database | PostgreSQL / SQLite / Turso (Drizzle ORM) |
| Auth | JWT + OAuth + 2FA/TOTP + SSO/SAML |
| Git | Native git CLI + simple-git + isomorphic-git |
| SSH | ssh2 library |
| CI/CD | Docker-based runners, GitHub Actions syntax |
| Storage | Local filesystem or S3-compatible (AWS, MinIO, R2) |
| AI | OpenAI, Anthropic, Google, Groq, Ollama, OpenRouter |
| Queue | BullMQ + Redis |
| CLI | Commander.js + Inquirer |
┌─────────────────────────────────────────────────────────────┐
│ CLIENTS │
│ Browser │ Git CLI (HTTP/SSH) │ OpenCodeHub CLI (och) │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────┐
│ OPENCODEHUB PLATFORM │
│ Web UI (Astro+React) │ REST API (175+ routes) │ GraphQL │
│ Git Server (HTTP) │ SSH Server (ssh2) │ │
│ Pipeline Runner (Docker) │ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────┐
│ PostgreSQL/SQLite/Turso │ Redis │ Pluggable Storage │
└─────────────────────────────────────────────────────────────┘
| Topic | Link |
|---|---|
| Installation | docs.opencodehub.space/getting-started/installation |
| Configuration | docs.opencodehub.space/administration/configuration |
| Stacked PRs | docs.opencodehub.space/features/stacked-prs |
| AI Code Review | docs.opencodehub.space/features/ai-review |
| CLI Reference | docs.opencodehub.space/reference/cli-commands |
| API Reference | docs.opencodehub.space/api/rest-api |
| Deployment | docs.opencodehub.space/administration/deployment |
# Clone and setup
git clone https://github.com/swadhinbiswas/OpencodeHub.git
cd OpenCodeHub
cp .env.example .env
npm install
npm run db:push
bun run scripts/seed-admin.ts
# Start development
npm run dev
# Run tests
npm run testSee CONTRIBUTING.md for development workflow and standards.
- GitHub: github.com/swadhinbiswas/OpencodeHub
- Documentation: docs.opencodehub.space
- Issues: GitHub Issues
- Discussions: GitHub Discussions
MIT — Use it however you want.
