CyberPanel & OpenLiteSpeed Native Stack

CyberPanel VPS Deployment (No Docker)

Deploy FineTuneMyAI natively on your CyberPanel VPS using its built-in MariaDB database (port 3306), OpenLiteSpeed web server, and the PM2 process manager.

Native MariaDB & Zero-Docker Architecture

CyberPanel already includes a high-performance MariaDB engine and OpenLiteSpeed web server. FineTuneMyAI connects directly to CyberPanel's MariaDB over TCP on 127.0.0.1:3306 and runs through PM2, eliminating Docker container overhead completely.

1. CyberPanel Dashboard Setup

Step A: Create Website

In CyberPanel → WebsitesCreate Website. Enter your domain (e.g. finetune.yourdomain.com) and make sure to check the SSL box for free automatic Let's Encrypt issuance.

Step B: Create MariaDB Database

In CyberPanel → DatabasesCreate Database. Select your website, specify a DB name, username, and secure password. Note the full names (e.g. admin_finetune).

2. Install Node.js 20 & PM2 via SSH

SSH into your VPS as root and install Node.js 20 LTS and PM2:

# Install Node.js 20 LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Install PM2 globally
sudo npm install -g pm2

3. Configure Environment (.env)

Navigate to your website directory, clone the project, and configure your CyberPanel MariaDB credentials:

# Clone into your website folder
cd /home/finetune.yourdomain.com
git clone https://github.com/kyrondataTech/fineTuneMyAi.git finetunemyai
cd finetunemyai/gemini
# Configure .env with your CyberPanel MariaDB credentials
cp .env.production.example .env
Example .env for CyberPanel:
NODE_ENV=production
PORT=3050
HOSTNAME=0.0.0.0
NEXT_PUBLIC_APP_URL=https://finetune.yourdomain.com

# Connect to native CyberPanel MariaDB on port 3306:
DATABASE_URL="mysql://admin_finetune_user:[email protected]:3306/admin_finetune"
JWT_SECRET=your_random_cryptographic_secret_min_32_chars

4. Build & Initialize MariaDB

Build the production Next.js bundle and initialize database tables and baseline models:

npm ci --prefer-offline
npm run build
npm run db:setup

5. Launch with PM2

FineTuneMyAI includes a pre-configured ecosystem.config.js file designed for Next.js production:

# Start application daemon
pm2 start ecosystem.config.js
# Save process list for auto-start across VPS reboots
pm2 save && pm2 startup

6. OpenLiteSpeed Reverse Proxy

Route public web traffic through OpenLiteSpeed to port 3050. Paste these rules into your website's public_html/.htaccess:

RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# WebSocket Upgrade for Remote Agent Pairing
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:3050/$1 [P,L]
# Pass-through to Next.js on port 3050
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://127.0.0.1:3050/$1 [P,L]

After saving, restart OpenLiteSpeed via SSH: sudo systemctl restart lsws.

7. Automated 1-Click Script Option

You can also run our automated CyberPanel deployment script which prompts for your MariaDB credentials, creates swap space if RAM is low, and configures PM2 automatically:

bash scripts/vps/deploy-cyberpanel.sh

8. Verification & Health Monitoring

Verify that your CyberPanel control plane is running with healthy MariaDB connectivity:

$ curl -s https://finetune.yourdomain.com/api/health
{"status":"healthy","service":"finetunemyai-control-plane","database":{"engine":"mariadb","status":"connected"}}