Env vars rescue

Bolt.new env vars work in preview but break on production

Bolt.new injects environment variables automatically. When you export the code, those variables disappear and the app fails until you recreate them correctly on the server.

What is probably broken

The app ran fine in Bolt.new. After export, nothing works because every secret, API key, and callback URL is missing.

What production should look like

A clean environment variable map for the production server with secrets rotated where needed.

STEP 01

Audit every variable the app needs

Search the codebase for `process.env` references and list each one.

  • Separate public frontend variables from server-only secrets.
  • Identify which variables must be available at build time vs runtime.
  • Note which URLs and keys still point to preview or test values.

STEP 02

Set variables on the production server

Load env vars from the deploy panel or server environment, not from files.

  • Add each variable to your deploy panel environment store.
  • Update all callback URLs, auth redirects, and webhook endpoints to the production domain.
  • Rotate any key that was ever visible in Bolt.new preview or a public repo.

STEP 03

Rebuild and verify

After setting env vars, rebuild the app and test every integration.

  • Run a clean production build with the new environment.
  • Test database connections, auth flows, payment webhooks, and email.
  • Confirm no preview URLs remain in the running app.

Quick check

Is your app production-ready?

If you cannot tick all five, we can fix it. Send us the repo and we handle the rest.

  • ?Custom domain with HTTPS
  • ?Environment variables configured
  • ?Database wired and backed up
  • ?Auto-deploy on push
  • ?Smoke tested and live

Free checklist

Deploying this yourself?

Get the exact 5-step checklist we run before every deploy. No fluff, just the things that actually break.

No spam. Your email is only used to send the checklist.

Done-for-you deploy

RepoAssistant cleans up Bolt.new environment variables during production deploy so nothing breaks on launch.

Fixed price per repo. 24h delivery or full refund. No hourly billing.

Deploy my app

Related guides