Deploying a Lovable App: Custom Domain, Hosting and SSL

By jocapps4 min read

Short answer: A Lovable app can go live on a custom domain either through Lovable's built-in publishing or by exporting the code to GitHub and deploying it to a static host such as Vercel, Netlify or Cloudflare Pages. In both cases you point DNS records at the host, let it issue an SSL certificate, configure SPA fallback routing, and update Supabase redirect URLs to the new domain.

On this page

Two ways to put a Lovable app on your domain

Lovable can publish your project to a hosted URL and lets you connect a custom domain on supported plans. That is the fastest route: you add the domain in the project settings, create the DNS records it shows you, and wait for verification and the certificate. For many early-stage products this is enough.

The second route is to sync the project to GitHub and deploy the repository yourself. Lovable projects typically use React and Vite, so the build output is a static folder that any modern host can serve. This gives you preview deployments per branch, edge caching settings, custom headers, redirects and the ability to keep deploying even if you stop editing in Lovable. Teams usually move to this route once more than one person touches the code or once a coding agent starts making changes outside Lovable.

Which hosting option fits which stage

There is no single right answer, but the trade-offs are predictable.

  • Built-in Lovable publishing: minimal setup, tight loop between prompt and live site, less control over headers, caching and deployment workflow.
  • Vercel or Netlify: automatic builds from GitHub, preview URLs for every pull request, simple rewrites for single-page apps, generous free tiers for small projects.
  • Cloudflare Pages: very fast global CDN, DNS and hosting in one place, good fit if your domain already lives at Cloudflare.
  • Your own server or cloud bucket: maximum control and data residency options, more maintenance, only worth it with specific compliance needs.

DNS setup without downtime

Most problems with custom domains are DNS problems. Follow this order to avoid a weekend of "site not found" messages.

  1. Decide on the canonical address: either the apex domain (example.com) or www.example.com, and redirect the other one to it.
  2. Lower the TTL of existing records to a few minutes a day before you switch, so changes propagate quickly.
  3. Add the records your host specifies, typically an A or ALIAS record for the apex and a CNAME for www. Do not mix records from two hosts.
  4. Remove old conflicting records, including leftover AAAA records that point to a previous server.
  5. Wait for the host to verify the domain and issue the SSL certificate, then test with a private browser window and a mobile network.
  6. Raise the TTL again once everything works.

Need a hand? apprat.io helps with exactly this. Book a call for free and get a clear plan in 15 to 30 minutes.

SSL, HTTPS and security headers

All the hosts above issue free certificates automatically. Your job is to make sure HTTPS is enforced: redirect every HTTP request, and once you are confident, enable HSTS so browsers never try plain HTTP again. Check for mixed content, for example images still loaded over plain HTTP that Lovable generated during early prototyping.

Self-hosting also lets you add security headers that built-in publishing may not expose: a Content Security Policy, X-Content-Type-Options, Referrer-Policy and a sensible Permissions-Policy. Start with a report-only CSP to see what breaks, because Lovable apps often load fonts, analytics and Supabase from several origins.

The single-page app routing trap

Lovable apps are single-page applications with client-side routing. Navigating inside the app works, but reloading a deep URL such as /dashboard/settings on a fresh host returns a 404, because the server looks for a file that does not exist. The fix is a rewrite rule that serves index.html for every path that is not a real file. Vercel, Netlify and Cloudflare Pages each have a short config for this; check that it is in your repository, not only in a dashboard setting someone clicked once.

While you are at it, configure caching correctly: long cache lifetimes for hashed asset files in the assets folder, and no caching or very short caching for index.html. Otherwise users keep loading an old version after every deployment.

Do not forget Supabase and third-party settings

Changing the domain breaks things outside your hosting. In Supabase, update the Site URL and the allowed redirect URLs for authentication, or magic links and OAuth will send users back to the old preview address. Update OAuth app settings at Google, Apple or GitHub, Stripe webhook endpoints and success URLs, email templates that contain links, and any CORS allow-lists on edge functions.

Finally, set up monitoring: an uptime check on the domain, certificate expiry alerts and error tracking in the front end. These cost little and catch the failures that users otherwise report first. If you prefer to hand this over, apprat.io covers deployment, domain and SSL setup as part of its Prototype-to-Production module, with coding agents doing the changes and senior AI Code Engineers reviewing them. apprat.io also keeps the pipeline documented so your team can take over at any time.

Frequently asked questions

Do I need a paid Lovable plan for a custom domain?

Custom domains on Lovable's built-in hosting have generally been tied to paid plans, but plan details change, so check Lovable's current pricing page. Alternatively, sync your project to GitHub and deploy it on a host with a free tier, where custom domains and SSL are usually included at no extra cost.

Why does my Lovable app show 404 after refresh on Netlify or Vercel?

Because the app uses client-side routing and the host looks for a file matching the URL. Add a rewrite that serves index.html for all non-file paths. On Netlify that is a redirects rule, on Vercel a rewrites entry in vercel.json, and Cloudflare Pages handles single-page apps when no 404 page is present.

How long does DNS and SSL setup take?

With low TTL values, DNS changes typically take effect within minutes to an hour, though full global propagation can take longer. Certificate issuance usually follows within minutes once the host verifies the records. Most delays come from conflicting old records or a registrar that still controls nameservers you forgot about.

Talk to an AI Code Engineer, free of charge

Tell us where you are and where you want to go. In a short call we map out the fastest path, whether that is a workshop, a launch in the App Store and Google Play or a full AI-native product.

No obligation. English or German. Run by jocapps, ISO 27001 and ISO 9001 certified. Prefer the phone? 24/7 call support: +49 761 519 751 50

Book a call for free

Related guides

Book a call for free