How to Create a Lovable Website and Deploy via FTP to cPanel
This guide explains step-by-step how to create a website using Lovable (built with Vite + React) and upload the finished site to your cPanel hosting via FTP.
Step 1: Install Node.js on Your Computer
Lovable uses Node.js to build your website. Download and install Node.js LTS from the official website:
- Website: https://nodejs.org
After installation, verify Node.js and npm are installed by running in Command Prompt or PowerShell:
node -v
npm -v
Step 2: Set Up Your Lovable Project
Clone or create your Lovable project folder on your computer:
git clone https://github.com/your-username/your-lovable-project.git
cd your-lovable-project
Install the project dependencies:
npm install
Step 3: Build the Website
To create the production-ready version of your website, run:
npm run build
This generates a folder called dist/ containing all the files needed for deployment (HTML, CSS, JS, assets).
Step 4: Connect to cPanel via FTP
Use an FTP client like FileZilla, WinSCP, or Cyberduck. Enter your FTP credentials:
- Host: yourdomain.com
- Username: your cPanel username
- Password: your cPanel password
- Port: 21
Step 5: Upload Your Website Files
1. In your FTP client, navigate to the dist/ folder on your computer.
2. On the server side, open the public_html/ folder (or the folder for your subdomain).
3. Upload all contents of the dist/ folder — including index.html and the assets/ folder. Do not upload the dist/ folder itself.
⚠️ Tip: Remove old files from
public_html first if you are replacing an existing site to avoid conflicts.
Step 6: Test Your Website
Open your web browser and visit your domain:
https://yourdomain.com
Your Lovable website should now be live!
Optional: Deploy to a Subdomain or Subfolder
- Subdomain (e.g.,
app.example.com): Upload thedist/contents to/home/username/app.example.com/
- Subfolder (e.g.,
example.com/app): Upload the contents to/home/username/public_html/app/
Summary
- Install Node.js on your computer.
- Install dependencies:
npm install - Build the production site:
npm run build - Upload
dist/contents via FTP topublic_html - Visit your domain and enjoy your website!
This method works entirely on Windows, Mac, or Linux, and does not require running Node.js on your server.
Happy coding!