LeadPilot Installation Guide (Step-by-Step)

If you want to host LeadPilot on your VPS with a custom domain and SSL, this guide will walk you through the entire setup in two parts:

  1. Installing Node.js, PM2 & LeadPilot
  2. Configuring Domain, Nginx & SSL

By the end, your app will be live on https://yourdomain.com with auto-renewing SSL. πŸ”


Prerequisites

  • A VPS (Ubuntu 22 or 24 works fine).
  • Root access to your server.
  • A domain name pointing to your VPS IP.

πŸ’» Purchase VPS & Get 15% Instant Discount: Claim Offer
🎟️ Coupon Code: Rajeevdaz15


⚑ Step 1: Install Node.js, PM2 & LeadPilot

Run the following script in your VPS terminal. This will:

  • Update system packages
  • Install required libraries
  • Install Node.js v18
  • Install PM2 process manager
  • Clone LeadPilot
  • Start the app with PM2
# Step 2: Update
apt update && apt upgrade -y

# Step 3: System Libraries
apt install -y \
  libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 \
  libcups2t64 libdrm2 libgbm1 libgtk-3-0t64 libnss3 \
  libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 \
  libpangocairo-1.0-0 libpangoft2-1.0-0

# Step 4: Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt install -y nodejs
node -v && npm -v

# Step 5: PM2
npm install -g pm2

# Step 6: Clone LeadPilot
git clone https://github.com/rajeevdaz/leadpilot.git
cd leadpilot

# Step 7: Install Dependencies
npm install

# Step 8: SKIP - No environment variables needed!

# Step 9: Start with PM2
pm2 start server.js --name leadpilot
pm2 save
pm2 startup

⚑ Step 2: Configure Domain & SSL

Now we’ll configure Nginx as a reverse proxy and install a free SSL certificate with Let’s Encrypt.

#!/bin/bash

# === CONFIG ===
DOMAIN="yourdomain.com"            # <-- replace with your domain
EMAIL="your@email.com"             # <-- replace with real email
APP_NAME="leadpilot"
APP_DIR="/root/leadpilot"          # <-- path to Node.js project
APP_PORT=3000                      # <-- port your app listens on
APP_FILE="server.js"               # <-- Node.js entry file

# === Install dependencies ===
echo "πŸ“¦ Installing Nginx & Certbot..."
apt update -y
apt install -y nginx certbot python3-certbot-nginx

# === Setup Nginx reverse proxy ===
NGINX_CONF="/etc/nginx/sites-available/$APP_NAME"
echo "βš™οΈ Creating Nginx config for $DOMAIN ..."
cat > $NGINX_CONF <<EOL
server {
    listen 80;
    server_name $DOMAIN;

    location / {
        proxy_pass http://localhost:$APP_PORT;
        proxy_http_version 1.1;
        proxy_set_header Upgrade \$http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host \$host;
        proxy_cache_bypass \$http_upgrade;
    }
}
EOL

ln -sf $NGINX_CONF /etc/nginx/sites-enabled/$APP_NAME
nginx -t && systemctl reload nginx

# === Issue SSL Certificate ===
echo "πŸ” Requesting SSL certificate from Let's Encrypt ..."
certbot --nginx -d $DOMAIN --non-interactive --agree-tos -m $EMAIL || true

# === Setup PM2 App ===
echo "πŸš€ Configuring PM2..."
cd $APP_DIR
pm2 restart $APP_FILE --name $APP_NAME || pm2 start $APP_FILE --name $APP_NAME
pm2 save
pm2 startup systemd -u root --hp /root

# === Enable SSL Auto-Renew (systemd timer) ===
echo "⏳ Enabling SSL auto-renew..."
systemctl enable certbot.timer
systemctl start certbot.timer

# === Finish ===
echo "βœ… Setup complete!"
echo "Your app should be live at: https://$DOMAIN"
echo "SSL auto-renew is handled by certbot.timer (runs twice daily)."

πŸŽ‰ Final Result

  • Your LeadPilot app is now available at https://yourdomain.com
  • SSL certificates auto-renew automatically.
  • PM2 ensures your app stays alive even after reboot.

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Reading

Category Business Posted on

LeadPilot Installation Guide (Step-by-Step)

If you want to host LeadPilot on your VPS with a custom domain and SSL, this guide will walk you through the entire setup in two parts: Installing Node.js, PM2 & LeadPilot Configuring Domain, Nginx & SSL By the end, your app will be live on https://yourdomain.com with auto-renewing SSL. πŸ” Prerequisites A VPS (Ubuntu 22 or 24 works fine). Root access to your server. A domain na…
Continue reading
Category AI Posted on

How to Build a WhatsApp RAG AI Agent with n8n (Free Template)

Automating WhatsApp replies with AI can save hours of manual work for businesses. In this tutorial, we’ll build a WhatsApp RAG (Retrieval Augmented Generation) AI Agent using n8n and WhatsApp Business Cloud API. This agent will: βœ… Read incoming WhatsApp messages βœ… Use RAG (Retrieval Augmented Generation) for smarter, context-based replies βœ… Connect to your own knowledge base (Google Sheets, product da…
Continue reading