Installation Guide
OpenCodeHub is a self-hosted Git platform. You can run it via Docker (recommended) or Node.js (for development).
System Requirements
Section titled “System Requirements”| Component | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 512MB | 2GB |
| Disk | 10GB | 50GB SSD |
| OS | Linux (Ubuntu/Debian) | Linux |
1-Click Installation (Recommended)
Section titled “1-Click Installation (Recommended)”curl -sSL https://raw.githubusercontent.com/swadhinbiswas/OpencodeHub/main/install.sh | bashThe script will:
- Ensure Docker and Docker Compose are installed
- Clone the latest stable release
- Configure a unified
DATA_DIRfor databases, git repos, and storage - Prompt you to create an initial admin user
Manual Docker Setup
Section titled “Manual Docker Setup”# Clonegit clone https://github.com/swadhinbiswas/OpencodeHub.gitcd OpencodeHub
# Configurecp .env.example .env# Edit .env — at minimum, change all secrets!
# Startdocker-compose up -d
# Create admin userdocker-compose exec app bun run scripts/seed-admin.tsThe app runs on port 4321 (HTTP) and port 2222 (SSH git).
Docker Compose Services
Section titled “Docker Compose Services”| Service | Port | Purpose |
|---|---|---|
app | 4321, 2222 | Main application + SSH git |
postgres | 5432 | PostgreSQL database |
redis | 6379 | Redis cache/queues |
runner | — | CI/CD Docker runner |
Nginx Reverse Proxy (SSL)
Section titled “Nginx Reverse Proxy (SSL)”In production, use HTTPS. Standard Nginx config:
server { listen 80; server_name git.yourcompany.com; return 301 https://$host$request_uri;}
server { listen 443 ssl http2; server_name git.yourcompany.com;
ssl_certificate /etc/letsencrypt/live/git.yourcompany.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/git.yourcompany.com/privkey.pem;
# Important for Git operations client_max_body_size 500M;
location / { proxy_pass http://localhost:4321; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }}See Nginx Deployment for the full config with WebSocket support and Git optimizations.
SSH Git Access
Section titled “SSH Git Access”The SSH git server starts automatically on port 2222. Clone with:
git clone ssh://git@your-server:2222/owner/repo.gitThe host key is auto-generated at GIT_SSH_HOST_KEY on first start.
Node.js Setup (Development)
Section titled “Node.js Setup (Development)”# Install dependenciesnpm install
# Configurecp .env.example .env
# Push schema to databasenpm run db:push
# Create admin userbun run scripts/seed-admin.ts
# Start dev servernpm run devSee Local Dev Setup for details.
Production Checklist
Section titled “Production Checklist”Before going live:
- All secrets rotated (JWT_SECRET, SESSION_SECRET, INTERNAL_HOOK_SECRET, etc.)
- HTTPS enabled via Nginx/Caddy
- PostgreSQL used (not SQLite)
- Redis configured for distributed locking
- Rate limiting enabled (
RATE_LIMIT_ENABLED=true) - Email configured (SMTP) for notifications
- Storage backend configured (S3 recommended for multi-node)
- Backup strategy configured
- Monitoring set up (see Monitoring)
Next Steps
Section titled “Next Steps”- Quick Start Guide — Navigate the dashboard and create your first repo
- Configuration Reference — All environment variables
- Docker Deployment — Production Docker setup