Self-hosted Git platform with stacked PRs, merge queue, CI/CD, and AI code review
2.6K
The self-hosted Git platform built for speed, control, and modern software engineering workflows.
OpenCodeHub is an open-source alternative to GitHub/GitLab featuring native Graphite-style Stacked PRs, a Merge Queue with speculative builds, a GitHub Actions-compatible CI/CD engine, and multi-provider AI Code Review.
och stack create/submit/sync)opencodehub-cli (och) with interactive terminal cockpit (och focus) and stack visualizationāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā CLIENTS ā
ā Browser ā Git CLI (HTTP/SSH) ā OpenCodeHub CLI (och) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā OPENCODEHUB PLATFORM ā
ā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā ā
ā ā Web UI ā ā REST API ā ā GraphQL Endpoint ā ā
ā ā (Astro+React)āā (140+ routes)āā (src/pages/api/) ā ā
ā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā ā
ā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā ā
ā ā Git Server ā ā SSH Server ā ā Pipeline Runner ā ā
ā ā (HTTP RPC) ā ā (ssh2) ā ā (Docker executor) ā ā
ā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā PERSISTENCE & INFRASTRUCTURE ā
ā PostgreSQL / SQLite ā Redis ā S3 / MinIO / Local ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
docker run -d \
--name opencodehub \
-p 4321:4321 \
-p 2222:2222 \
-v opencodehub-data:/data \
-e JWT_SECRET=$(openssl rand -hex 32) \
-e SESSION_SECRET=$(openssl rand -hex 32) \
-e INTERNAL_HOOK_SECRET=$(openssl rand -hex 32) \
-e SITE_URL=http://localhost:4321 \
opencodehub/opencodehub:latest
Open http://localhost:4321ā in your browser to get started.
version: "3.8"
services:
app:
image: opencodehub/opencodehub:latest
container_name: opencodehub-app
restart: always
ports:
- "4321:4321" # Web UI & API
- "2222:2222" # Git SSH Server
environment:
- NODE_ENV=production
- SITE_URL=https://git.yourdomain.com
- DATABASE_DRIVER=postgres
- DATABASE_URL=postgresql://opencodehub:secretpass@postgres:5432/opencodehub?sslmode=disable
- REDIS_URL=redis://redis:6379
- JWT_SECRET=${JWT_SECRET}
- SESSION_SECRET=${SESSION_SECRET}
- INTERNAL_HOOK_SECRET=${INTERNAL_HOOK_SECRET}
- RUNNER_SECRET=${RUNNER_SECRET}
- WORKFLOW_SECRET_ENCRYPTION_KEY=${WORKFLOW_SECRET_ENCRYPTION_KEY}
volumes:
- app-data:/data
depends_on:
- postgres
- redis
worker:
image: opencodehub/opencodehub-worker:latest
container_name: opencodehub-worker
restart: always
environment:
- NODE_ENV=production
- DATABASE_DRIVER=postgres
- DATABASE_URL=postgresql://opencodehub:secretpass@postgres:5432/opencodehub?sslmode=disable
- REDIS_URL=redis://redis:6379
volumes:
- app-data:/data
depends_on:
- postgres
- redis
runner:
image: opencodehub/opencodehub-runner:latest
container_name: opencodehub-runner
restart: always
privileged: true
environment:
- OPENCODEHUB_URL=http://app:4321
- RUNNER_SECRET=${RUNNER_SECRET}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- app
postgres:
image: postgres:16-alpine
container_name: opencodehub-postgres
restart: always
environment:
POSTGRES_USER: opencodehub
POSTGRES_PASSWORD: secretpass
POSTGRES_DB: opencodehub
volumes:
- pg-data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
container_name: opencodehub-redis
restart: always
volumes:
- redis-data:/data
volumes:
app-data:
pg-data:
redis-data:
Start the stack:
docker compose up -d
docker compose exec app bun run scripts/seed-admin.ts
| Variable | Required | Default | Description |
|---|---|---|---|
SITE_URL | Yes | http://localhost:4321 | Base URL of your platform (e.g. https://git.company.com) |
DATABASE_DRIVER | No | postgres | Database driver (postgres, sqlite, turso) |
DATABASE_URL | Yes | ā | Connection string (PostgreSQL/SQLite) |
REDIS_URL | Yes | ā | Redis connection URI for sessions & locks |
JWT_SECRET | Yes | ā | 32+ char secret for JWT token signing |
SESSION_SECRET | Yes | ā | 32+ char secret for cookie encryption |
INTERNAL_HOOK_SECRET | Yes | ā | Shared secret for Git hook callbacks |
STORAGE_TYPE | No | local | Storage backend (local or s3) |
STORAGE_BUCKET | If STORAGE_TYPE=s3 | ā | S3 bucket name |
STORAGE_REGION | If STORAGE_TYPE=s3 | us-east-1 | S3 region |
STORAGE_ENDPOINT | Optional | ā | S3-compatible custom endpoint (MinIO / R2 / Garage) |
STORAGE_ACCESS_KEY_ID | If STORAGE_TYPE=s3 | ā | Access Key ID |
STORAGE_SECRET_ACCESS_KEY | If STORAGE_TYPE=s3 | ā | Secret Access Key |
METRICS_TOKEN | Optional | ā | Bearer token for GET /api/metrics |
och)Install the official CLI to manage stacks, merge queues, and reviews:
npm install -g opencodehub-cli
# Authenticate with your self-hosted instance
och auth login --url https://git.yourdomain.com
# Create stacked PR branches
och stack create feature/part-1
och stack submit
Content type
Image
Digest
sha256:9aeaebf5dā¦
Size
239.8 MB
Last updated
3 months ago
docker pull opencodehub/opencodehub