Host a site from Lovable or Bolt anywhere
Lovable and Bolt write your site as a React project (usually with Vite). That's source code: a
src folder and a package.json, not the website itself. One command turns it into
plain files that any host can serve. Here's how, and what to check before you move.
1. Get the code
- Lovable: connect the project to GitHub (free on every plan) and download the repository as a ZIP from GitHub, or use Lovable's own download option if your plan includes it.
- Bolt: download the project, or export it to GitHub and download it from there.
Unzip it into a folder on your computer.
2. Build it into a website
- Install Node.js (the LTS version) if you don't have it.
- Open a terminal in the project folder (the one with
package.json) and run:npm install npm run build - A new folder appears, usually
dist(sometimesbuild). Its contents are your website: anindex.htmland anassetsfolder.
If npm run build stops with an error, paste it into Lovable, Bolt or any AI assistant and ask for
the fix. Check package.json if your project names the build script differently.
3. Put it online
- Create a free Pagehaus site, with an address like
https://yoursite.pagehaus.site/. - Upload what's inside
dist, not thedistfolder itself: drag the files onto the site's Files tab, or zip them and drop the .zip. - Or, from the terminal, with the free pagehaus tool:
pagehaus deploy dist --site yoursite
Run the build and upload again whenever you change the site.
4. Check these before you switch
- Pages other than the home page. In these apps, addresses like
/aboutare handled by the app in the browser, not by real files, so the host has to show the app'sindex.htmlat those addresses. Add a file named_redirects(no extension) to the project'spublicfolder, so every build includes it, with this one line:
The/* /index.html 200200means "show this page here", not "send the visitor there". Real files, like the app'sassets, are still served as they are. More in redirects. (Netlify and Cloudflare Pages read the same file, so it may be there already.) - A database or sign-in (often Supabase) keeps working: it runs at Supabase, not on your
host. Its settings are read when you build, so put the
VITE_…values in a.envfile in the project beforenpm run build. Only the publishable ("anon") key belongs in a website; never a secret or service key. - Server functions (edge functions, API routes, payments handled by the app) don't run on a host for plain files. Keep them where they are, or ask whether you need them at all.
- A contact form that sends through a server function can post to
/_form/contactinstead: messages are emailed to you with no code. See contact forms.
Or skip the build
If your site is a few pages of text and pictures, it doesn't need React at all. Ask the AI for "a plain HTML version of this site, one file per page, with no build step", and upload those files as they are. They're easier to change, and every page is found in search.
Something broken once it's online? See why an AI-made website works on your computer but not online.
Your own domain
On a Personal or Pro plan, connect your domain under the Domains tab; HTTPS is set up for you. See custom domains.