Deploying a Bolt site from GitHub to a host
By Yash Garg · · 6 min read
To deploy a Bolt site to an external host, you disconnect from Bolt's internal publishing tools and use GitHub as your single source of truth. Connecting your Bolt workspace to a GitHub repository lets your external host build and deploy your site automatically every time code changes. This workflow gives you full ownership of your code, access to custom domains without recurring builder fees, and automated deployment pipelines that finish in under 2 minutes per push.
Why disconnect Bolt hosting and deploy through GitHub
Bolt allows quick one-click publishing to a temporary bolt.host subdomain, but serious production projects require an independent continuous deployment pipeline. Bolt projects are standard framework projects, such as Vite or Next.js, rather than proprietary formats, according to Vercel's Bolt guide.
Relying purely on Bolt for production hosting carries practical limits. Direct publishing to custom domains on Bolt requires being on a paid plan, as detailed in Bolt's publishing documentation. Decoupling your site via GitHub lets you use free hobby tiers or existing agency accounts on specialized platforms like Vercel, Netlify, or Cloudflare Pages. These hosts deploy your application across global edge networks, provide instant preview environments for pull requests, and keep your production infrastructure completely independent of your AI tooling.
Step 1: Connect Bolt to GitHub and export your repository
Before moving your project to an external host, export your codebase to a clean Git repository:
- Locate the GitHub icon in Bolt's top toolbar to begin the export process, as outlined in Bolt's version control guide.
- Authorize the StackBlitz and Bolt GitHub App, choosing either global account access or granular access to specific repositories.
- Select "Create repository." Bolt defaults to generating a private repository on a main branch, as documented in Bolt's version control guide.
- Review the initial commit in GitHub to ensure all files were transferred cleanly.
Bolt monitors changes closely. According to Bolt's version control guide, Bolt creates a commit automatically whenever you make a change that doesn't break the project, and it checks GitHub every 30 seconds for remote updates.
While two-way sync is technically supported, treat this initial export as a permanent graduation step or establish strict rules with your team. Version control tools like GitHub help resolve conflicts when two people edit the same spot, as noted in Bolt's version history reference. If you plan to coordinate continuous synchronization across both environments, read our guide on Bolt project GitHub sync before proceeding.
Step 2: Connect your external host and configure build settings
Once your repository exists on GitHub, link it to your chosen hosting provider. Sign in to your dashboard on Vercel, Netlify, or Cloudflare Pages, import the new repository, and verify the build configuration.
Most modern platforms auto-detect the framework generated by Bolt.
Using Git integration provides three core operational benefits:
- Automated production builds: Vercel's Git documentation explains that production deployments trigger automatically from the production branch, while preview deployments are created for every push on other branches.
- Edge Workers automation: Cloudflare Workers build documentation highlights how its Git integration connects directly to repositories to automate builds and deployments on push.
- Rapid rollbacks: According to Netlify's deploy management documentation, rollbacks are instantaneous because publishing an earlier deploy does not trigger a new deploy but publishes a previous atomic deploy that is still available.
Trigger an initial test build in your hosting dashboard. Once the build completes, your site will be live on the host's default domain.
Step 3: Fix routing and migrate environment secrets
Two common issues often cause initial production builds to fail or behave unexpectedly: missing environment secrets and broken Single-Page Application (SPA) routing.
First, Bolt stores integration secrets (such as Supabase keys, Stripe credentials, or custom database URLs) inside its internal secrets manager. These values do not export to GitHub for security reasons. You must open your host's project settings and manually add those keys under Environment Variables. Additionally, inspect your codebase for hardcoded localhost URLs and replace them with production environment variables.
Second, Bolt serves apps in-browser using WebContainer memory, where client-side page transitions never touch a traditional server. When exported as a static build to hosts like Netlify or Vercel, reloading deep paths (for example, an about or pricing route) triggers a 404 error because the static server looks for a physical file matching that path. You must tell your host to route all requests back to index.html.
Use this reference table to configure your host settings correctly:
| Host Provider | Framework Preset | Output Directory | SPA Rewrite Rule or Configuration File |
|---|---|---|---|
| Vercel | Vite / React | dist | Add vercel.json with rewrites pointing source /(.*) to /index.html |
| Netlify | Vite / React | dist | Add a _redirects file in public folder: /* /index.html 200 |
| Cloudflare Pages | Vite / React | dist | Add a _redirects file in public folder: /* /index.html 200 |
| Vercel | Next.js (SSR) | .next | Native handling; no custom rewrite rules required |
Commit these redirect configuration files to your repository and push to main. Your host will rebuild and resolve any routing errors immediately.
Step 4: Protect production branches and manage client edits
When using GitHub as your deployment engine, your main branch directly controls what appears on the live website. Leaving this branch unlocked exposes your client to broken deployments if someone commits faulty code or edits files directly through the browser.
To secure your production pipeline, configure GitHub branch protection rules:
- Prevent accidental destruction: GitHub's protected branches documentation states that protection rules disable force pushes and stop protected branches from being deleted by default.
- Require review: Use pull requests to propose changes, which GitHub's pull request guide defines as proposals that let team members review and discuss updates before merging into the main codebase.
- Block raw browser edits: As noted in GitHub's file editing documentation, users cannot edit or upload files directly in a protected branch using GitHub's web interface.
If an invalid change does reach production, use Git's built-in history rather than manual rollbacks. Git's revert documentation explains that git revert undoes the changes introduced by existing commits and records new commits that cleanly document the reversal. Review our complete guide to protecting the main branch on client sites to configure safety rules before handing access over.
Letting clients update content without breaking the build
After moving your Bolt project to an external host, content maintenance becomes the next hurdle. Giving non-technical clients access to edit copy, testimonials, or pricing tables inside Git or Bolt presents serious risks.
A clean alternative is connecting your repository to TurnIntoCMS. It turns your existing GitHub repository into a visual editor without requiring a database migration, complex schemas, or rebuilding your frontend. Clients view a live preview of the site, click directly on text, links, or images to edit them, and publish updates with a single click.
Every publish writes clean changes back to your repository as a single Git commit, triggering your host's automated CI/CD pipeline. Clients do not need GitHub accounts, and branch protection remains intact. For teams managing client handoffs, you can set up visual editing on your Bolt repository in minutes.
TurnIntoCMS is intentionally focused: it costs $1 USD as a one-time payment per additional project after your first free project, with no recurring subscriptions. It works with content stored directly in JSX or imported data files (such as JSON or constants files) across React, Vite, and Next.js projects. It is not a page builder for creating entirely new page layouts, and it cannot edit dynamic records stored inside external databases like Supabase. For static and code-driven Bolt sites, it keeps the deployment pipeline clean while protecting the live build.
FAQ
Can I deploy a Bolt project to Vercel or Netlify without paid Bolt hosting?
Yes. You can export your Bolt project directly to a private GitHub repository using the free GitHub App integration. Once the code is on GitHub, import it into Vercel, Netlify, or Cloudflare Pages to use their free or team tiers.
Why does my deployed Bolt app return a 404 when refreshing subpages?
Bolt projects built with Vite generate Single-Page Applications that route via JavaScript in the browser. When you refresh a subpage on static hosting, the server looks for a physical HTML file that does not exist; you must add a rewrite rule routing all paths back to index.html.
What happens to my environment variables when pushing Bolt to GitHub?
Secrets, API keys, and environment variables stored in Bolt's dashboard do not export to GitHub. You must manually copy your secrets from Bolt into the Environment Variables panel of your production host before triggering your first build.
Will edits made inside Bolt still deploy to my external host after connecting GitHub?
Yes, if you keep Git sync active. When Bolt pushes automatic commits to your linked GitHub branch, GitHub sends a webhook event to your external host, which triggers an automated production build.
Sources
- GitHub for version control (support.bolt.new, checked November 24, 2026)
- Version history, version control, and GitHub (support.bolt.new, checked November 24, 2026)
- Publish your project to a live website (support.bolt.new, checked November 24, 2026)
- Deploy a Bolt.new app with Vercel Drop (vercel.com, checked November 24, 2026)
- About protected branches (docs.github.com, checked November 24, 2026)
- Pull requests (docs.github.com, checked November 24, 2026)
- Editing files (docs.github.com, checked November 24, 2026)
- Deploying Git Repositories with Vercel (vercel.com, checked November 24, 2026)
- Manage deploys (docs.netlify.com, checked November 24, 2026)
- Builds · Cloudflare Workers docs (developers.cloudflare.com, checked November 24, 2026)
- Git - git-revert Documentation (git-scm.com, checked November 24, 2026)