How to Create a Lovable Website and Deploy It to cPanel via FTP
This guide explains how to build a website using Lovable (Vite + React) and upload the finished static site to your cPanel hosting account using FTP.
Step 1 - Install Node.js
Lovable requires Node.js for building your website. Download and install the current LTS version from:
After installation, verify Node.js and npm:
node -v
npm -vStep 2 - Set Up Your Lovable Project
Clone or create your Lovable project:
git clone https://github.com/your-username/your-lovable-project.git
cd your-lovable-projectInstall dependencies:
npm installStep 3 - Build the Website
Create a production-ready build:
npm run buildThis creates a dist/ directory containing your static site files.
Step 4 - Connect to cPanel via FTP
Use an FTP client such as FileZilla, WinSCP, or Cyberduck and connect using:
- Host: yourdomain.com
- Username: your cPanel username
- Password: your cPanel password
- Port: 21
Step 5 - Upload Your Website Files
- Open the
dist/folder on your computer. - On the server, navigate to
public_html/(or the folder for your subdomain). - Upload all contents of the
dist/folder, includingindex.htmland theassetsdirectory.
Important: Do not upload the
dist folder itself. Upload only its contents.Step 6 - Test Your Website
Visit your website in a browser:
https://yourdomain.comYour Lovable website should now be live.
Optional - Subdomains or Subfolders
- Subdomain: Upload files to the subdomain document root.
- Subfolder: Upload files to
public_html/app/.
Summary
- Install Node.js.
- Run
npm install. - Build with
npm run build. - Upload
distcontents to cPanel. - Visit your domain.