How to export Bolt.new code and share it as a page

Bolt.new hands you a project folder, not a page. Build it into one HTML file, guard its browser storage, and you can put it at a link and still fix it later.

In short

Bolt.new exports source code, not a finished page. On desktop, click the project title, then Download, and you get a zip of the project.

Build that folder with Node.js on your computer. A normal build gives an index.html that shows nothing on its own, so add vite-plugin-singlefile and build again to get one self-contained file.

If the app saves data in the browser (our to-do app did), wrap that code in try/catch first. Inside a sandboxed page, like the one NOS uses, our unguarded version showed only a blank screen.

Upload the one file and share the link. You can fix text later on the NOS screen and the link stays the same.

We built a small React and Vite to-do app to stand in for a Bolt download. It is a fictional checklist for a community garden work day. We did not use a Bolt account for this test. We built the project, opened the plain build, saw a blank page, built it again as one file, hit another blank page inside a sandbox, fixed it, and put it on NOS. Then we changed the work-day hours on the NOS screen and reopened the same link.

Can I export code from Bolt.new?

You can, as a zip of the source. Bolt's help center gives one path for the whole project:

  1. Open the project in Bolt on a computer. Download is not available on a phone.
  2. Click the project title in the top left.
  3. Click Download. Your browser saves a zip file.
  4. Unzip it.

Bolt can also connect a GitHub repository and keep your code there. That is a backup and sync, not a page you can send.

Either way you now hold a project folder. Bolt's own next step is to install Node.js and run npm install && npm run dev. That starts a preview on your own computer only. Nobody else can open it.

What is in the Bolt download?

Look for a file named vite.config.js or vite.config.ts at the top of the folder. If it is there, the steps below apply. The index.html in that folder is only a shell. It points at source files in src, and the page does not exist until you build it.

Check the .env file too. Bolt's docs say values your code reads in the browser end up in what visitors receive. A built file carries them inside it. Secrets you added in Bolt's Secrets panel are different: Bolt does not write them into your files.

How do I export a Bolt.new project as one HTML file?

Open a terminal in the unzipped folder and do this:

  1. npm install to fetch the packages.
  2. npm install -D vite-plugin-singlefile to add the plugin.
  3. In the Vite config, import the plugin, add viteSingleFile() after the plugins already listed, and set base: "./".
  4. npm run build.
  5. Open the dist folder. You want one index.html and no assets folder. Double-click it and the app should run.
Our Vite config after the change
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";

export default defineConfig({ base: "./", plugins: [react(), viteSingleFile()], });

Our garden app came out as a single 147 KB file. The plain build had been three files: a 0.4 KB index.html, a 145 KB JavaScript file, and a 1 KB style file.

Why did my exported Bolt app show a blank page?

We hit two different blank pages.

The plain build, opened alone. That 0.4 KB index.html only tells the browser to fetch two files from paths that start at the root of a site. Opened by itself, our page had the right tab title and zero visible text. The single-file build fixes this.

The single file, inside a sandbox. Our first one-file build ran fine when opened directly. Then we loaded it in a sandboxed frame with the same settings NOS uses for shared pages. We saw the background color and nothing else. The app read its saved tasks from browser storage on startup. A sandboxed page without its own origin is not allowed to use that storage, so the read failed and React drew nothing.

The fix was small. We wrapped the two storage calls in try/catch and fell back to the starting list:

The guarded storage code
function load() {
  try {
    const saved = localStorage.getItem("garden-tasks");
    return saved ? JSON.parse(saved) : START;
  } catch {
    return START;
  }
}

We did the same around the save call and rebuilt. The app then loaded in the sandbox. The trade-off: ticks and new tasks last while the tab is open. A fresh visit starts from the original list. NOS flagged this ahead of time, too. Its Code view showed "Browser storage use" in the bar above our file.

We uploaded the one file to NOS. The Code view shows the built file as it is, and View runs it.

NOS Code view showing the single-file to-do app build, with a Running sandboxed notice that lists browser storage use
1. The built file in Code view. The bar above it lists what the page tries to do, including browser storage.
The fictional Maple Street Garden to-do list in NOS View mode, with the work day set for 9 AM to noon
2. View runs the React app. The work day reads 9 AM to noon.

Share makes a read-only link. People who open it do not sign in and cannot change the page.

NOS Share this page panel for the garden to-do list with Anyone with the link selected and search indexing off
3. Sharing the garden list. Search indexing is off unless you tick Public on the web.
The shared garden to-do list opened at phone width with four unchecked tasks
4. The shared link at phone width.

Say the work day moves to 8 AM to 11 AM. You do not need Bolt, a rebuild, or a new upload. In NOS, choose Edit, click the line, type the new text, and choose Done.

NOS Edit mode with the work day line changed to 8 AM to 11 AM and the Done button in the top bar
5. Edit mode: click the text, type, then Done.
NOS View mode after saving, showing the work day as Saturday 8 AM to 11 AM
6. After Done, View shows the new hours.

We opened the same link again. It showed the new hours. Then we ticked a task and added one. Both worked, so the edit did not break the app.

The same shared link reopened, now showing the work day from 8 AM to 11 AM
7. Same link, new hours.
On the shared link, the first task is checked and crossed out, a new task Refill the bird bath is added, and the count reads 4 of 5 tasks left
8. Checking and adding tasks still work after the text change.

This kind of edit works for text that sits in the app as one plain sentence. We did not test text built from several values, or text loaded from a database.

Does Bolt.new host websites?

It does. Bolt's help center says you can publish a project for free at an address ending in bolt.host, from the Publish menu. Custom domains and private sites need a paid Bolt plan. If you are staying in Bolt, that is the simplest route. Exporting makes sense when you want the app outside Bolt: as a file you own, on a host you choose, or next to other pages you already share.

When not to do this

  • The app uses a database or sign-in. A single file cannot carry Bolt's database, user accounts, or server functions. If you came here to export a Bolt database, this is your case. Keep that app on Bolt hosting or another full host.
  • Each person's list must be saved. In a sandboxed share page, browser storage is blocked, so a personal to-do list resets on the next visit. Use a host that serves the page from its own address, or a real backend.
  • The folder has a next.config file instead of a Vite config. That is a Next.js project. The single-file plugin is for Vite.
  • The .env file holds anything private. Anything your code reads in the browser ends up in the file. Move it to Secrets and server code first.

Where NOS fits

NOS gives one HTML file a share link, lets you fix its text on screen, and keeps the same link after each change. It runs shared pages in a sandbox, which is why browser storage needs the guard above. The Free plan includes 3 share links at once; see current pricing for paid plans.

Want to try it first? Download our garden to-do app (the guarded single-file build).

Questions people ask

How do I download code from Bolt.new?

Open the project on a computer, click the project title in the top left, and choose Download. You get a zip of the source code. Bolt does not offer this on a phone.

Is the Bolt download ready to upload as a website?

Not yet. It is a project that still has to be built. Install Node.js, run npm install, then npm run build. For one file you can share anywhere, add vite-plugin-singlefile before the build.

Why is my exported Bolt app blank on a share link?

Two common causes. You uploaded only the plain build's index.html, which needs its separate JavaScript file. Or the app reads browser storage on startup, which a sandboxed page blocks. Build as one file and wrap storage calls in try/catch.

Can I change the app after I share the link?

For plain text, yes. In NOS we changed the work-day hours in Edit mode, chose Done, and the same link showed the new hours with the app still working.

Does the export include my Bolt database?

The zip holds only the project's code. Database data and user accounts live in Bolt Cloud, along with your published Bolt site. An app that needs them should stay on a full host.

Keep reading