No matter how good lovable is, the Lovable cloud is a serious platform lockin and many vibe coders are reporting ‘random’ $$ in subscription for their vibe coded apps hosted in Lovable cloud (which offers no data point on infrastructure cost).
The Platform Lock-in Problem
When you build on Lovable, you’re getting an incredible developer experience. The AI-powered development, instant deployments, and seamless integrations make it feel like magic. But there’s a hidden cost: platform lock-in.
Here’s what happens when you stay on Lovable Cloud:
- Their Supabase, not yours: Your database lives on Lovable’s Supabase instance. If you leave, you lose access to your data.Importantly, it doesn’t support many features like OTP validation (saved you minimum 50 credits and 30 mins of back and forth prompts!)
- Limited customization: You’re constrained by Lovable’s infrastructure decisions.
- Vendor dependency: Pricing changes, feature limitations, or service issues affect your production app.
- Edge function limitations: Your serverless functions are tied to their deployment pipeline.
The good news? You can migrate out. And it’s not as hard as you think.
Why Migrate to Vercel?
Vercel offers several advantages once you’re ready to take control:
- Full ownership: Your database, your functions, your infrastructure
- Flexibility: Deploy however you want, use any services you need
- Scalability: Enterprise-grade infrastructure when you need it
- Cost control: You choose your hosting tier and services
- Independence: No vendor lock-in for your production app
The Migration Architecture
Here’s what we’re moving from and to:
Before (Lovable Cloud):
Lovable → Lovable's Supabase → Lovable's Edge Functions → Lovable's Hosting
After (Self-hosted):
GitHub → Your Supabase → Your Edge Functions → Vercel
You’ll still use Lovable for development (it’s that good!), but your production app runs independently.
Prerequisites
Before you start, make sure you have:
- [ ] A GitHub account (free)
- [ ] A Vercel account (free tier available)
- [ ] A Supabase account (free tier available)
- [ ] Basic command line familiarity (or willingness to learn!)
- [ ] Access to your API keys (Stripe, Google APIs, etc.)
Step 1: Connect Your Lovable Project to GitHub
This is the easiest step and the foundation for everything else.
- In your Lovable project, go to Settings
- Find the GitHub integration option
- Connect your GitHub account
- Authorize Lovable to create/push to a repository
- Lovable will create a new repo with all your code
Why this matters: Once on GitHub, you can deploy anywhere. This breaks the first layer of lock-in.
Step 2: Deploy Your Frontend to Vercel
Now let’s get your app running on Vercel.
Connect GitHub to Vercel
- Go to vercel.com and sign up
- Click “Add New Project”
- Click “Import Git Repository”
- Select your Lovable project from GitHub
- Click “Import”
Configure Build Settings
Vercel is usually smart enough to auto-detect your framework. But if needed:
- Framework Preset: Vite (or whatever you’re using)
- Build Command:
npm run build - Output Directory:
dist - Install Command:
npm install --legacy-peer-deps(if you hit dependency errors)
Deploy
Click “Deploy” and wait 1-3 minutes. You’ll get a live URL like your-app.vercel.app.
Important: Your app won’t work yet – it’s still pointing to Lovable’s Supabase. We’ll fix that next.
Step 3: Set Up Your Own Supabase
This is where you take back control of your data.
Create Your Supabase Project
- Go to supabase.com
- Sign up/log in with GitHub
- Click “New Project”
- Fill in:
- Name: Your project name
- Database Password: Create a strong password and save it securely
- Region: Choose one close to your users
- Click “Create new project”
- Wait 2-3 minutes for provisioning
Migrate Your Database Structure
Your GitHub repo contains migration files in supabase/migrations/. These are SQL files that define your database structure.
Option A: Using Supabase SQL Editor (No CLI needed)
- Go to your Supabase dashboard → SQL Editor
- Click “New query”
- Open each migration file from your GitHub repo (oldest first)
- Copy the SQL content
- Paste into the SQL Editor
- Click “Run”
- Repeat for each migration file in chronological order
Option B: Using Supabase CLI (Faster for many migrations)
First, install the CLI:
# On Mac
brew install supabase/tap/supabase
# On Windows
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase
# Or via npm
npm install supabase --save-dev
Then migrate:
# Navigate to your project
cd your-project-folder
# Login to Supabase
npx supabase login
# Link to your project (get ref ID from Supabase Settings → General)
npx supabase link --project-ref YOUR_PROJECT_REF_ID
# Push all migrations
npx supabase db push
Export Data from Lovable (If Needed)
If you have production data on Lovable’s Supabase:
- Contact Lovable support and request a database export
- They should provide you with a SQL dump or CSV exports
- Import this data into your new Supabase using the SQL Editor or
psql
Note: If you’re just starting out or can recreate your data, you might skip this step.
Step 4: Deploy Your Edge Functions
Your edge functions (serverless functions) need to move to your Supabase too.
Set Up Environment Secrets
Your functions need API keys. Set them using the CLI:
# Example secrets (use your actual keys)
npx supabase secrets set STRIPE_SECRET_KEY=sk_live_...
npx supabase secrets set OPENAI_API_KEY=sk-proj-...
npx supabase secrets set GOOGLE_CLIENT_ID=your_client_id
npx supabase secrets set GOOGLE_CLIENT_SECRET=your_secret
npx supabase secrets set SENDY_URL=https://your-sendy.com
npx supabase secrets set SENDY_API_KEY=your_key
npx supabase secrets set SENDY_LIST_ID=your_list_id
Find your secrets:
- Stripe: dashboard.stripe.com/apikeys
- OpenAI: platform.openai.com/api-keys
- Google: console.cloud.google.com/apis/credentials
Deploy All Functions
npx supabase functions deploy
This deploys all your edge functions at once. You’ll see each function being deployed with a URL.
Step 5: Update Vercel Environment Variables
Now connect your Vercel frontend to your new Supabase backend.
Get Your Supabase Credentials
In Supabase Dashboard:
- Go to Settings → API
- Copy:
- Project URL (your
SUPABASE_URL) - anon public key (your publishable/anon key)
- Project URL (your
Add to Vercel
- Go to your Vercel project → Settings → Environment Variables
- Add these variables (adjust prefix based on your framework):
For Vite:
VITE_SUPABASE_URL = https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY = eyJhbG...
For Next.js:
NEXT_PUBLIC_SUPABASE_URL = https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY = eyJhbG...
For Create React App:
REACT_APP_SUPABASE_URL = https://your-project.supabase.co
REACT_APP_SUPABASE_ANON_KEY = eyJhbG...
- Add any other frontend secrets:
VITE_STRIPE_PUBLISHABLE_KEY = pk_live_...
VITE_GOOGLE_CLIENT_ID = your_google_client_id
- Make sure to check all three environments (Production, Preview, Development)
- Click “Save”
Redeploy
Go to Deployments → Click the “…” menu → “Redeploy”
Your app should now be fully functional on Vercel with your own Supabase! 🎉
Step 6: Test Everything
Before celebrating, test your app thoroughly:
- [ ] User authentication (sign up, log in, log out)
- [ ] Database reads and writes
- [ ] Payment flows (Stripe checkout)
- [ ] Third-party integrations (Google Calendar, etc.)
- [ ] Email sending
- [ ] Any scheduled tasks or webhooks
Step 7: Set Up a Custom Domain (Optional)
Instead of your-app.vercel.app, use your own domain:
- Go to Vercel project → Settings → Domains
- Add your domain (e.g.,
app.yourdomain.com) - Follow the DNS instructions (add CNAME or A records)
- Wait for DNS propagation (5 minutes to 48 hours)
- Vercel automatically provisions SSL certificates
The Ongoing Workflow
Here’s how development works after migration:
Frontend Changes
- Make changes in Lovable
- Lovable pushes to GitHub automatically
- Vercel auto-deploys
- ✅ Fully automatic
Database Changes
- Make schema changes in Lovable
- Lovable generates migration files → pushes to GitHub
- Manually run:
git pull && npx supabase db push - ⚠️ Requires manual step
Edge Function Changes
- Update functions in Lovable
- Lovable pushes to GitHub
- Manually run:
git pull && npx supabase functions deploy - ⚠️ Requires manual step
Pro tip: You can keep using Lovable for rapid development while maintaining full control of your production infrastructure.
Common Issues and Solutions
Issue: “npm install” fails on Vercel
Solution: Override the install command in Vercel settings:
npm install --legacy-peer-deps
Issue: Edge functions can’t access secrets
Solution: Make sure you set the secrets using npx supabase secrets set, not as environment variables.
Issue: Database connection errors
Solution: Double-check your Supabase URL and keys in Vercel. Make sure you’re using the right prefix (VITE_, NEXT_PUBLIC_, etc.).
Issue: CORS errors when calling edge functions
Solution: Your edge functions should already have CORS headers, but if not, add:
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
}
Issue: Git authentication fails
Solution: Use a GitHub Personal Access Token or set up SSH keys instead of password authentication.
Cost Comparison
Let’s talk numbers (as of 2024):
Lovable Cloud:
- Development tier: ~$20-50/month
- Production tier: ~$100-300/month
- Scaling costs can increase significantly
Self-hosted (Vercel + Supabase):
- Vercel: Free tier (generous) or $20/month for Pro
- Supabase: Free tier (up to 500MB DB, 2GB file storage) or $25/month for Pro
- Total: $0-45/month for most projects
For most indie projects and startups, you can run on the free tier indefinitely. You only pay when you scale.
When Should You Migrate?
Migrate now if:
- You’re planning to launch to real users
- You need cost predictability
- You want control over your infrastructure
- You’re worried about vendor lock-in
- You need specific integrations Lovable doesn’t support
Stay on Lovable if:
- You’re still in rapid prototyping phase
- You haven’t launched yet
- You value convenience over control
- You don’t have time for DevOps
Best of both worlds: Use Lovable for development, self-host for production.
Final Thoughts
Migrating from Lovable Cloud to Vercel isn’t just about avoiding lock-in. It’s about taking ownership of your stack while still leveraging the incredible development experience Lovable provides.
You get:
- ✅ Lovable’s AI-powered development speed
- ✅ Full control over your production infrastructure
- ✅ The flexibility to scale and customize as needed
- ✅ Independence from any single vendor
The migration takes a few hours, but it’s an investment in your app’s long-term independence and flexibility.
Resources
Ready to take the leap? Start with Step 1 and work your way through. The freedom is worth it.
Have questions or run into issues? The Vercel and Supabase communities are incredibly helpful – you’re not alone in this migration journey.