Deploy a Bolt.new export

Move the app you built in Bolt.new out of the browser sandbox and onto a real, always-on URL.

Bolt.new can build a few different kinds of app, so the first step is to know which one you have. Most Bolt projects are Vite + React; some are Next.js or a plain Node server. Once you know, the deploy is short. This recipe is the whole path.

1. Get the code on GitHub

Export your Bolt project to GitHub (or download it and push it to a new repository). Dockhold deploys from that repo.

2. Identify the stack and set the start command

Open package.json and look at the dependencies and scripts:

  • Has vite: it's a Vite single-page app. Add a static server and a start script:
npm install --save-dev serve
// package.json
"scripts": {
  "build": "vite build",
  "start": "serve -s dist -l $PORT"
}

A Vite SPA also needs the Dockerfile from the Vite recipe (build, then serve dist/) at the repo root — without it the build system can serve raw source and you get a blank page.

  • Has next: follow the Next.js recipe"start": "next start -H 0.0.0.0 -p $PORT".
  • A plain Node/Express server: follow the Node / Express recipe — listen with app.listen(process.env.PORT, "0.0.0.0").

Your app must listen on 0.0.0.0 and read its port from the PORT environment variable — never localhost, never a hardcoded port. Dockhold assigns PORT at runtime; an app that ignores it can't receive traffic.

3. Set configuration

Bolt apps often hardcode an API base URL or key while running in the sandbox. Move those out of the code and set them in the dashboard. A Node or Next.js server reads them from process.env at runtime. A Vite SPA has no server, so it can't read dashboard variables directly — use runtime config instead: write the values into the page when the container starts and read window.__APP_CONFIG__ (the full-stack recipe shows it). Either way, don't bake config into the build, and keep real secrets out of the browser bundle — anything shipped to the browser is public.

4. Connect the repo and deploy

  1. Open the dashboard, connect GitHub, and pick the repo.
  2. Dockhold builds and runs your app — from your Dockerfile if you added one (required for the Vite SPA path), otherwise auto-detected for a Node or Next.js server.

Your app goes live at https://<your-app>.dockhold.app with HTTPS handled for you. Every later push to your main branch redeploys.

Troubleshooting

  • "No start script": Bolt sandboxes run a dev script; production needs a start script like the ones above.
  • Requests go to localhost: replace any hardcoded http://localhost URL with an environment variable.
  • Blank page on a Vite app: add the Dockerfile so the app is built before it's served, and keep the -s flag on serve so client-side routing works.

Next