Guide · 7 min read
How to Host a Lovable, Bolt or v0 Project on Your Own Domain
To host a Lovable, Bolt or v0 project on your own domain, export the source code (through GitHub or a ZIP download), run npm install and npm run build on your computer, and upload the contents of the build folder (dist, build or out) to your hosting. Set Vite's base path, add a routing fallback, keep secret keys out of front-end code, and leave Supabase where it is.
Lovable, Bolt.new and v0 are very good at producing a working app quickly. What they hand you, though, is the source code of a JavaScript project, not a finished website. To put it on your own domain with ordinary hosting you need one extra step, the build, and a few settings that trip up almost everyone the first time. This guide covers all of them.
Key takeaways
- These tools produce React source code, usually built with Vite and sometimes with Next.js. Hosting needs the built output, not the source.
- Run
npm installandnpm run build, then upload the contents ofdist/(orbuild/orout/). - Set
base: './'in Vite and add a fallback so that refreshing a page does not show a 404. - Never ship secret API keys in front-end code. A Supabase backend stays on Supabase.
What Lovable, Bolt and v0 actually export
All three export a JavaScript project with a package.json file, which a browser cannot run directly. It has to be compiled ("built") into plain HTML, CSS and JavaScript first.
| Tool | How to get the code | Usual stack | Build output folder |
|---|---|---|---|
| Lovable | Connect GitHub, then clone the repository or download it as a ZIP from GitHub | React, Vite and TypeScript, often with Supabase | dist/ |
| Bolt.new | Download the project as a ZIP, or push it to GitHub | Usually React and Vite; sometimes other frameworks | dist/ for Vite projects |
| v0 | Download the code, or add it to a project with the shadcn CLI | Next.js and React | out/ with static export |
| Older Create React App projects | Usually already on your computer | React | build/ |
Menu names in these tools change often, so look for Export, Download or GitHub. If the project has a vite.config.ts file, it is a Vite project. If it has next.config.js (or .mjs or .ts) and an app folder full of page.tsx files, it is Next.js.
Step 1: Install Node.js and build the project
You build the project once on your own computer using Node.js; the hosting server only receives the finished files. Install the current LTS version of Node.js from nodejs.org, open a terminal in the project folder and run:
npm install
npm run build
npm install downloads the libraries listed in package.json into a node_modules folder, which is often hundreds of MB and must never be uploaded. npm run build creates the output folder. For a Vite project, run npm run preview afterwards to check the built site locally before you upload anything.
If the build fails, read the first error rather than the last. Common causes are TypeScript errors the AI tool ignored during development, or a missing environment variable. Paste the error back into the tool that made the project; it can often fix it.
Step 2: Set the Vite base path
For a Vite project, set base: './' in vite.config.ts so that asset links are relative. The same build then works on a preview link, in a subfolder, or at the root of your domain.
export default defineConfig({
plugins: [react()],
base: './',
})
Without this, Vite writes links such as /assets/index-abc123.js, which only work when the site sits at the very root of a domain. One honest exception: if your app uses normal URL routes several levels deep (for example /products/shoes) and you host it at the domain root, base: '/' is safer, because relative paths are resolved from the deeper URL when someone refreshes that page. Using a hash router, described below, avoids the problem entirely.
Step 3: Fix page refreshes with an SPA fallback
These apps are single-page applications: there is one index.html, and JavaScript draws each "page". If a visitor refreshes /about, the server looks for a file called about, finds nothing and returns a 404, unless you tell it to fall back to index.html.
Option A: an .htaccess fallback on cPanel hosting
cPanel hosting reads .htaccess files. Create one next to index.html containing:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
If the app lives in a subfolder rather than at the domain root, change both slashes to that folder's path, such as /app/.
Option B: use a hash router
Switch React Router's BrowserRouter to HashRouter. URLs become yoursite.in/#/about, which is less tidy but works on any static host, including preview links, with no server configuration. For a small internal tool or a demo, this is the least fuss.
Step 4: Keep API keys out of the front end
Anything in a front-end build can be read by any visitor, so secret keys must never be in it. In Vite, every variable starting with VITE_ is copied into the public JavaScript at build time.
- Safe to ship: keys designed for browsers, such as a Supabase anon or publishable key used with row-level security switched on, or a Razorpay key ID.
- Never ship: a Supabase service_role or secret key, OpenAI, Anthropic or Gemini API keys, a Razorpay key secret, SMTP passwords or database passwords.
- Where secrets belong: in a server-side function, such as a Supabase Edge Function or a small PHP script on your hosting, which the front end calls.
Check before you upload: search the files in dist/assets for sk-, service_role and secret. If a secret was ever in a public build, rotate it by creating a new key and deleting the old one. Removing it from the code is not enough, because the old build may already have been copied.
Step 5: Leave Supabase where it is
Moving the front end to your own hosting does not move your backend, and it does not need to. Your database, authentication and storage stay on Supabase, and the built app keeps calling the same Supabase project.
Two settings do need updating when the domain changes:
- In Supabase, open the authentication URL settings, set the Site URL to your new domain and add it to the allowed redirect URLs. Otherwise sign-up confirmations and password-reset emails link back to the old preview address.
- If you use Google or another social login, add the new domain to the allowed origins and redirect URIs in that provider's console.
If your project uses the tool's own built-in backend rather than a Supabase account you control, check that tool's documentation on using it from an outside domain before you move.
Step 6: Upload the build to your hosting
Upload the contents of dist/ (or build/ or out/) into public_html, not the whole project folder. What you upload should have index.html at the top level with an assets folder beside it.
- To test first, zip the contents of the build folder and drop it on our free upload tool (up to 20 MB) for a preview link that lasts 4 hours, or 24 hours once you confirm your email. Previews are noindex, and password or login forms are blocked on free previews, so test sign-in on your real domain.
- For the permanent site, log in to cPanel, open File Manager, go to
public_html, upload the ZIP and extract it there. Add the.htaccessfallback if you use normal routes. - Point your domain at the hosting and switch on the free SSL certificate. Many browser features, such as location access and service workers, only work over https://.
Never upload node_modules, src, package.json or .env. They are not needed to run the site, and .env may contain secrets.
What hosting does a Lovable, Bolt or v0 app need?
A built Vite app is just static files, so basic cPanel hosting, or our upload tool for a preview, is enough; you do not need a server running Node.js. Builds are usually only a few MB, which fits comfortably on the 500 MB plan at ₹1,800 per year with room left for images.
- Vite React app with Supabase: static cPanel hosting is enough.
- Next.js with static export (
output: 'export'in the Next config, plusimages: { unoptimized: true }if it uses the Image component): static hosting is enough. Uploadout/. - Next.js using server features such as API routes, server actions or server-side rendering: it needs Node.js running on a server. We do not offer VPS or app hosting, so leave it on a platform built for Next.js or move it to a specialised provider, such as a managed Node platform like Render or Railway, or a cloud VPS provider.
Be sure which one you have before paying for a server. Many v0 landing pages and dashboards export statically; ones that call AI APIs from the server usually cannot.
Updating the site after more changes
Each time you change the app in Lovable, Bolt or v0, pull the new code, build again and upload the new build, replacing the old files. Delete the old assets folder first, because file names change with every build and stale files pile up.
If a build will not cooperate, contact us or WhatsApp +91-95851-60363. We will tell you plainly whether it runs as static files on our hosting, needs a Node host elsewhere, or just needs a configuration change.