Lovable deployment rescue

Lovable app works in preview but will not deploy

Lovable preview runs on their infrastructure. Production needs a real build, environment variables, a server process, and a domain. When any of those is missing, the deploy fails.

Published February 6, 2026·by RepoAssistant Team

What is probably broken in your Lovable app

The app looks finished in Lovable preview, but exporting the code and running it on a real server fails with missing env vars, build errors, or a dead process.

What production should look like for Lovable

A working production build on your own server, with correct environment variables, HTTPS on your domain, and a repeatable deploy path.

STEP 01

Export the real code, not just the preview

Lovable preview hides a lot of infra complexity. The first step is getting a complete, buildable repo. The preview environment auto-configures database connections, auth redirects, and environment variables. None of that transfers when you export the code. You need to recreate each piece manually on your server or deploy panel.

  • Sync or export the Lovable project to a GitHub repository using the built-in Lovable export feature or git push from the CLI.
  • Confirm the build command and Node version match what Lovable uses by inspecting the package.json and any .nvmrc or .tool-versions file in the export.
  • List every external service the app calls: Supabase project URL and anon key, Stripe publishable key, email provider API key, analytics script IDs, and any third-party OAuth client IDs.
  • Check for hardcoded preview URLs in the codebase. Replace lovable.app or lovable.dev references with your production domain.
  • Verify the app builds locally before attempting a server deploy. Run npm install and npm run build in the exported directory.

STEP 02

Recreate the environment on the server

Most deploy failures come from missing or wrong environment variables. Lovable injects these through their dashboard UI. On a real server, you must set them in the deploy panel, a .env file, or your Docker Compose config. A single missing variable can break the entire startup sequence without a clear error message.

  • Copy all production env vars from the Lovable dashboard to the server deploy panel or .env file. Include every variable listed in your Lovable project settings.
  • Update callback URLs, auth redirects, and webhook endpoints to point at your new domain instead of the Lovable preview URL.
  • Keep secrets out of git: API keys, database URLs, and auth secrets must be loaded from the server environment, never committed to the repository.
  • Generate new secrets for production: create fresh JWT signing keys, session secrets, and API tokens rather than reusing Lovable-generated defaults.
  • Set NODE_ENV to production explicitly. Many Lovable apps behave differently in development mode and will error without this flag.

STEP 03

Run the build, start the process, test

A successful build does not mean the app works. Lovable apps frequently compile fine but fail at runtime because of missing environment context. Run the full smoke test after deployment to catch these failures before users do.

  • Run the production build on the server and fix any compile errors. Compare the output with the local build to catch environment-specific differences.
  • Start the app as a managed process using PM2, Docker, Docker Compose, or your deploy panel-s built-in process manager so it restarts after crashes or server reboots.
  • Test signup, login, database writes, file uploads, and any payment flows on the live domain. Do not assume because the homepage loads that everything works.
  • Check server logs for unhandled promise rejections and 500 errors that may not surface in the UI. Use journalctl, PM2 logs, or Docker logs depending on your setup.
  • Set up a basic uptime monitor (UptimeRobot, Pulsetic, or HetrixTools) to alert you if the process dies after the initial deploy smoke test passes.

Quick check

Is your Lovable 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 your Lovable 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 moves Lovable apps from broken preview to a live production server with domain, database, and backups.

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

Deploy my app

Related guides