If you've built a website with Lovable's AI platform and want to deploy it to Vercel's lightning-fast edge network, this guide walks you through every step. Many Lovable users migrate to Vercel for better reliability, instant rollbacks, and superior developer experience. Whether you're moving due to Lovable 2.0 issues or simply want more hosting options, this guide shows you exactly how to transfer your Lovable project to Vercel's platform.
Why Deploy Lovable Projects to Vercel?
Vercel is the platform built by the creators of Next.js, offering:
Free Tier Includes:
- Unlimited deployments
- 100GB bandwidth per month
- Automatic HTTPS and SSL
- Global edge network (70+ regions)
- Automatic Git integration
- Preview deployments for every branch
- Serverless functions (12 seconds execution)
- Zero-config deployments for most frameworks
What Makes Vercel Great for Lovable:
- Auto-detects React, Vite, and most frameworks
- Instant rollbacks to previous deployments
- Built-in performance analytics
- Edge functions for dynamic content
- No cold starts on the free tier
New to Vercel? Start with our Getting Started with Vercel guide for a beginner-friendly introduction to the platform before diving into Lovable-specific deployment.
Step 1: Export Your Lovable Project
First, get your code out of Lovable:
- Open your Lovable project in the Lovable dashboard
- Click the menu icon (three dots or hamburger menu)
- Select "Export" or "Download"
- Choose "Download as ZIP"
- Save the ZIP file to your computer
- Extract the ZIP to a folder on your machine
Your project should contain:
package.json- Dependencies and scriptssrc/- Your source codepublic/- Static assetsindex.html- Entry pointvite.config.jsor similar - Build configuration
Step 2: Set Up a Git Repository
Vercel deploys from Git repositories. Let's push your code to GitHub:
# Navigate to your extracted project folder
cd path/to/your-lovable-project
# Initialize a Git repository
git init
# Add all files to Git
git add .
# Create your first commit
git commit -m "Initial commit: Lovable project export"Create a GitHub Repository
- Go to GitHub and log in
- Click the "+" icon in the top right corner
- Select "New repository"
- Name your repository (e.g., "my-lovable-site")
- Choose Public or Private (both work with Vercel)
- Don't initialize with README, .gitignore, or license
- Click "Create repository"
Push Your Code to GitHub
# Add your GitHub repository as the remote origin
git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git
# Push your code to GitHub
git branch -M main
git push -u origin mainYour code is now on GitHub and ready to deploy!
Step 3: Create a Vercel Account
If you don't have one already:
- Go to Vercel
- Click "Sign up with GitHub" (easiest option)
- Authorize Vercel to access your GitHub account
- Complete your profile setup
Vercel will automatically detect your GitHub repositories.
Step 4: Import Your Project to Vercel
Now for the deployment:
- Click "Add New..." in the Vercel dashboard
- Select "Project"
- You'll see a list of your GitHub repositories
- Find your Lovable project repository
- Click "Import"
Vercel will analyze your repository and detect your framework.
Step 5: Configure Build Settings
Vercel is smart and usually auto-detects everything. For typical Lovable projects (React + Vite):
Framework Preset: Vite (auto-detected)
Build Command:
npm run buildOutput Directory:
distInstall Command:
npm installRoot Directory: Leave blank (unless your code is in a subdirectory)
Environment Variables
If your Lovable project needs environment variables (API keys, backend URLs):
- Click "Environment Variables" section
- Click "Add"
- Enter your variable name (e.g.,
VITE_API_URL) - Enter the value
- Select environments: Production, Preview, Development
Common Lovable environment variables:
VITE_API_URL=https://api.example.com
VITE_SUPABASE_URL=https://yourproject.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-keyNote: Vite uses
VITE_prefix for environment variables that should be exposed to the browser.
Step 6: Deploy!
Click "Deploy"
Vercel will:
- Clone your repository
- Install dependencies with
npm install - Run your build command
- Deploy to their global edge network
- Give you a
.vercel.appURL
First deployment typically takes 30-90 seconds.
You can watch the build logs in real-time. If everything succeeds, you'll see:
✓ Build Completed
✓ Deployment ReadyYour site is now live at https://your-project.vercel.app!
Step 7: Set Up a Custom Domain
Once deployed, you can add your own domain:
- In your Vercel project, click "Settings"
- Click "Domains" in the sidebar
- Enter your domain (e.g.,
example.comorwww.example.com) - Click "Add"
If Your Domain is at Another Registrar
Vercel will show you DNS records to add:
For apex domain (example.com):
- Type:
A - Name:
@ - Value:
76.76.21.21
For www subdomain (www.example.com):
- Type:
CNAME - Name:
www - Value:
cname.vercel-dns.com
Add these records at your domain registrar:
- Log in to your registrar (GoDaddy, Namecheap, etc.)
- Find DNS settings
- Add the A and/or CNAME records
- Save changes
- Wait for DNS propagation (usually 5-30 minutes, can take up to 24 hours)
Automatic HTTPS
Vercel automatically provisions and renews SSL certificates for all domains. No configuration needed—it just works.
Step 8: Enable Automatic Deployments
This is already enabled by default! Every time you push to your Git repository, Vercel automatically rebuilds and deploys:
# Make changes to your code
# Then commit and push
git add .
git commit -m "Update homepage design"
git push origin main
# Vercel automatically detects the push and rebuildsYou'll get a notification email when deployments complete.
Preview Deployments
Every branch and pull request gets its own preview URL:
- Create a new branch:
git checkout -b feature/new-design - Make changes and push:
git push origin feature/new-design - Vercel automatically creates a preview deployment
- Share the preview URL with your team before merging
This is ideal for testing changes before going live.
Advanced: Using Vercel CLI
For more control, install the Vercel CLI:
# Install Vercel CLI globally
npm install -g vercel
# Log in to your Vercel account
vercel login
# Deploy from your local machine
vercel
# Deploy to production
vercel --prodDeploy Without Git
If you don't want to use Git:
# Navigate to your project folder
cd your-lovable-project
# Build locally
npm run build
# Deploy directly
vercel --prodThis uploads your built files directly to Vercel.
Troubleshooting Common Issues
Build Fails: "Command not found: npm"
Problem: Vercel can't find npm
Solution: Ensure you have a package.json in your project root. Vercel auto-detects it and installs dependencies.
Build Fails: "dist directory not found"
Problem: Build output directory doesn't match configuration
Solutions:
- Check your
vite.config.js(or similar) for the output directory name - Common alternatives:
build,out,public,.output - Update Vercel settings: Project Settings > Build & Development Settings > Output Directory
404 Errors on Client-Side Routes
Problem: Direct navigation to /about or other routes returns 404
Solution: Create a vercel.json in your project root:
{
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
}This tells Vercel to serve index.html for all routes, allowing your React Router (or similar) to handle routing.
Or use public/_redirects (for Vite projects):
/* /index.html 200Environment Variables Not Working
Problem: import.meta.env.VITE_API_URL is undefined
Solutions:
- Ensure variables are prefixed with
VITE_for Vite projects - Add them in Project Settings > Environment Variables
- Redeploy after adding variables (or push a new commit)
- Check you selected the correct environment (Production/Preview/Development)
Build Exceeds Free Tier Time Limit
Problem: Build takes longer than 45 minutes (Hobby plan limit)
Solutions:
- Optimize your build process
- Reduce dependencies
- Use
npm ciinstead ofnpm install(faster) - Upgrade to Vercel Pro ($20/month, 6-hour build limit)
API Calls Failing After Deployment
Problem: API requests that worked in Lovable now fail
Common causes:
- CORS issues: Your API doesn't allow requests from your Vercel domain
- Environment variables missing: Add them in Vercel dashboard
- HTTPS/HTTP mismatch: Vercel forces HTTPS; ensure your API supports it
- Hardcoded localhost URLs: Replace with environment variables
Solution:
// Use environment variables
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000'
fetch(`${API_URL}/api/data`)
.then(response => response.json())
.then(data => console.log(data))Add VITE_API_URL in Vercel's environment variables.
Deployment Shows Old Version
Problem: Changes aren't visible after deployment
Solutions:
- Hard refresh your browser:
Ctrl+Shift+R(Windows) orCmd+Shift+R(Mac) - Check deployment status in Vercel dashboard—it might still be building
- Verify you pushed to the correct branch
- Check the deployment URL matches where you're looking
Custom Domain Not Working
Problem: Domain doesn't resolve or shows errors
Solutions:
- Check DNS propagation: Use whatsmydns.net
- Verify DNS records are correct (A record to
76.76.21.21or CNAME tocname.vercel-dns.com) - Wait—DNS can take up to 24 hours (usually 5-30 minutes)
- Check domain is verified in Vercel dashboard (green checkmark)
- Ensure you removed conflicting DNS records (old CNAME or A records)
Comparing Vercel to Other Hosting Options
| Feature | Vercel | Cloudflare Pages | Netlify |
|---|---|---|---|
| Free Bandwidth | 100GB/month | Unlimited | 100GB/month |
| Free Build Minutes | 6,000/month | Unlimited builds (500/month) | 300/month |
| Deployment Speed | Fast | Very Fast | Fast |
| Custom Domains | ✅ Free SSL | ✅ Free SSL | ✅ Free SSL |
| Preview Deployments | ✅ Every PR | ✅ Every PR | ✅ Every PR |
| Serverless Functions | ✅ 100GB-hours | ❌ (use Workers) | ✅ 125k invocations |
| Edge Network | 70+ regions | 300+ regions | 50+ regions |
| Best For | React/Next.js projects | Static sites | Jamstack sites |
For Lovable projects, Vercel is excellent because it auto-detects React/Vite setups and has generous free tier limits.
Optimizing Your Lovable Site on Vercel
Enable Edge Caching
Vercel automatically caches static assets at the edge. For more control, add headers:
Create vercel.json:
{
"headers": [
{
"source": "/assets/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}Use Vercel Analytics
Enable free analytics:
- Go to Project Settings > Analytics
- Click "Enable"
- Add the analytics script to your project (Vercel provides instructions)
Track Core Web Vitals and user interactions automatically.
Add Security Headers
Improve security with headers in vercel.json:
{
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Referrer-Policy",
"value": "strict-origin-when-cross-origin"
},
{
"key": "Permissions-Policy",
"value": "geolocation=(), microphone=(), camera=()"
}
]
}
]
}Use Serverless Functions (Optional)
If you need backend functionality, create API routes:
- Create
api/folder in your project root - Add a file like
api/hello.js:
export default function handler(req, res) {
res.status(200).json({ message: 'Hello from Vercel!' })
}Access it at: https://your-project.vercel.app/api/hello
This is ideal for:
- Form submissions
- Database queries
- Third-party API calls (hiding API keys)
- Authentication
Migrating from Lovable Hosting to Vercel
If you're currently using Lovable's hosting:
- Export your project (as described in Step 1)
- Deploy to Vercel (follow Steps 2-6)
- Test thoroughly at your
.vercel.appURL - Update DNS to point to Vercel (Step 7)
- Monitor for any issues in the first 24 hours
- Cancel Lovable hosting once confirmed working
Next Steps After Deployment
- Set up monitoring: Enable Vercel Analytics for performance tracking
- Configure error tracking: Integrate with Sentry or LogRocket
- Optimize images: Use Vercel's built-in Image Optimization
- Add serverless functions: Create API routes for dynamic functionality
- Set up staging: Create a
developbranch for preview deployments
Vercel vs Cloudflare: Which Should You Choose?
Choose Vercel if:
- You want the easiest setup (literally one-click import)
- You need serverless functions without extra configuration
- You're building with React, Next.js, or Vite
- You want preview deployments for every PR
- You value developer experience and speed
Choose Cloudflare if:
- You want unlimited bandwidth (Vercel caps at 100GB free)
- You need edge computing with Workers
- You prefer unlimited builds (Vercel has 6,000/month limit)
- Your site has very high traffic
- You want the absolute fastest global performance (300+ regions)
For most Lovable projects, Vercel is the better choice due to its simplicity and generous free tier. Both are excellent platforms—you can't go wrong with either.
Conclusion
Deploying your Lovable project to Vercel is straightforward:
- Export from Lovable
- Push to Git
- Import to Vercel
- Deploy
You get:
- Automatic deployments on every Git push
- Global CDN with 70+ edge locations
- Free SSL certificates
- Preview deployments for testing
- 100GB bandwidth per month (free)
Vercel makes hosting your Lovable AI-built websites effortless. The entire process from export to live site takes less than 10 minutes.
Have questions about deploying your Lovable project to Vercel? Leave a comment below!
Frequently Asked Questions
Will my Lovable app work on Vercel? Yes! Lovable generates React/Vite applications that are fully compatible with Vercel's platform. Vercel auto-detects Vite projects and configures everything automatically.
Can I use my custom domain with Vercel? Absolutely. Vercel provides free SSL certificates and makes custom domain setup simple through their dashboard. You can use both root domains and subdomains.
What happens to my Lovable hosting after migration? Your original Lovable-hosted site continues to work. You can keep both running or unpublish the Lovable version once migration is complete. There's no automatic cancellation—you have full control.
Is Vercel hosting really free? Yes! Vercel's free tier includes unlimited deployments, 100GB bandwidth per month, custom domains with SSL, and automatic Git integration. It's perfect for personal projects and small business sites.
How do I move my Lovable project to Vercel? Export your Lovable project as a ZIP file, push it to GitHub, then connect your GitHub repository to Vercel. The entire process takes about 10-15 minutes with automatic deployments after initial setup.
Related guides:
Fred
AUTHORFull-stack developer with 10+ years building production applications. I've deployed dozens of Next.js apps to Vercel and know all the gotchas.

