Skip to content

Deploy with CyberPanel

CyberPanel is a hosting control panel that uses OpenLiteSpeed (OLS) as its web server. This guide covers deploying OpenCodeHub on a CyberPanel server.

  • CyberPanel installed on a VPS
  • Root SSH access
  • Domain pointed to your server
  • PostgreSQL or MySQL available

  1. Login to CyberPanel admin panel
  2. Go to Websites → Create Website
  3. Configure:
    • Domain: git.yourdomain.com
    • Email: your email
    • PHP: None (we’ll use Node.js)
    • SSL: Issue SSL via Let’s Encrypt

CyberPanel doesn’t include Node.js by default. Install via SSH:

Terminal window
# Connect via SSH as root
ssh root@your-server-ip
# Install Node.js 20.x
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
# Verify
node --version # Should be 20.x
npm --version

Terminal window
# Install PostgreSQL
apt install -y postgresql postgresql-contrib
# Create database and user
sudo -u postgres psql << EOF
CREATE DATABASE opencodehub;
CREATE USER opencodehub WITH ENCRYPTED PASSWORD 'your-secure-password';
GRANT ALL PRIVILEGES ON DATABASE opencodehub TO opencodehub;
\c opencodehub
GRANT ALL ON SCHEMA public TO opencodehub;
EOF

Terminal window
# Create app directory
mkdir -p /home/git.yourdomain.com/app
cd /home/git.yourdomain.com/app
# Clone repository
git clone https://github.com/swadhinbiswas/OpencodeHub.git .
# Install dependencies
npm install
# Create environment file
cat > .env << 'EOF'
NODE_ENV=production
PORT=3000
SITE_URL=https://git.yourdomain.com
# Database
DATABASE_DRIVER=postgres
DATABASE_URL=postgresql://opencodehub:your-secure-password@localhost:5432/opencodehub
# Security (generate with: openssl rand -hex 32)
JWT_SECRET=your-64-char-jwt-secret
SESSION_SECRET=your-64-char-session-secret
INTERNAL_HOOK_SECRET=your-64-char-hook-secret
# Storage
STORAGE_TYPE=local
STORAGE_PATH=./data/repos
EOF
# Build
npm run build
# Initialize database
npm run db:push
# Create admin user
npm run scripts/seed-admin.ts

CyberPanel uses OpenLiteSpeed. We need to set up reverse proxy.

  1. SSH into server
  2. Edit the vhost config:
Terminal window
nano /usr/local/lsws/conf/vhosts/git.yourdomain.com/vhconf.conf
  1. Add or modify the config:
docRoot $VH_ROOT/public_html
enableGzip 1
context / {
type proxy
handler localhost:3000
addDefaultCharset off
}
rewrite {
enable 1
autoLoadHtaccess 1
}
  1. Go to Websites → List Websites
  2. Click on your website → vHost Conf
  3. Add the proxy context as shown above
  4. Click Save
Terminal window
systemctl restart lsws

Terminal window
# Install PM2
npm install -g pm2
# Start OpenCodeHub
cd /home/git.yourdomain.com/app
pm2 start dist/server/entry.mjs --name opencodehub
# Save process list
pm2 save
# Setup startup script
pm2 startup systemd
# Run the command it outputs

CyberPanel uses firewalld:

Terminal window
# Allow necessary ports (if not already open)
firewall-cmd --permanent --add-port=3000/tcp
firewall-cmd --reload

CyberPanel can automatically issue SSL via Let’s Encrypt:

  1. Go to SSL → Manage SSL
  2. Select your website
  3. Click Issue SSL

The SSL will be automatically configured for OpenLiteSpeed.


Edit /usr/local/lsws/conf/vhosts/git.yourdomain.com/vhconf.conf:

context / {
type proxy
handler localhost:3000
addDefaultCharset off
# Extended timeouts for git operations
extraparam {
ProxyTimeout 600
}
}
context /ws {
type proxy
handler localhost:3000
addDefaultCharset off
extraparam {
WebSocket 1
}
}

  1. Go to Logs → Access Logs or Error Logs
  2. Select your website
Terminal window
# View status
pm2 status
# View logs
pm2 logs opencodehub
# Monitor resources
pm2 monit

  1. Check if Node.js app is running: pm2 status
  2. Verify port 3000 is listening: netstat -tlnp | grep 3000
  3. Check LiteSpeed error logs: /usr/local/lsws/logs/error.log
Terminal window
# Check PM2 logs
pm2 logs opencodehub --lines 100
# Restart application
pm2 restart opencodehub
Terminal window
# Test PostgreSQL connection
psql -U opencodehub -h localhost -d opencodehub

Terminal window
cd /home/git.yourdomain.com/app
# Pull latest changes
git pull origin main
# Install dependencies
npm install
# Rebuild
npm run build
# Run migrations
npm run db:push
# Restart
pm2 restart opencodehub

FeatureOpenLiteSpeedNginx
PerformanceExcellentExcellent
.htaccess support
WebSocket
ConfigurationGUI + filesFiles only
Resource usageLowVery low

Both work well for OpenCodeHub.