🚀 Getting Started
Get OpenCodeHub running locally in under 5 minutes. This guide covers installation, configuration, and creating your first repository.
📋 Prerequisites
📦 Node.js 18+
JavaScript runtime for the application. Download Node.js
🗄️ Database
PostgreSQL 14+ (recommended), MySQL 8+, or SQLite 3.35+
🔀 Git 2.30+
For repository management. Usually pre-installed on Linux/macOS.
📥 Installation
Or use Bun for faster installation:
Edit .env with your database connection and secrets.
This creates all required database tables.
Follow the prompts to set username, email, and password.
Open http://localhost:3000 in your browser!
⚙️ Configuration
Key environment variables to configure:
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
✅ | Database connection string |
JWT_SECRET |
✅ | Secret for JWT tokens (32+ chars) |
SESSION_SECRET |
✅ | Secret for sessions (32+ chars) |
SITE_URL |
✅ | Your site URL (e.g., https://git.example.com) |
INTERNAL_HOOK_SECRET |
✅ | Secret for Git hooks (32+ chars) |
STORAGE_TYPE |
❌ | local, s3, gcs, or azure |
Generate secure secrets with: openssl rand -hex 32
📁 Create Your First Repository
Navigate to http://localhost:3000/login and sign in with your admin
credentials.
Click the + button in the header and select New Repository.
Fill in the repository name, description, and visibility settings.
cd repo-name
echo "# My Project" > README.md
git add .
git commit -m "Initial commit"
git push origin main