What it means to deploy a vibe-coded app
A vibe-coded app is still software. AI may have generated the interface, routes, database calls, and configuration, but deployment has the same goal as any other project: produce a repeatable build, run it in a public environment, connect the services it needs, and make failures observable.
The preview inside Lovable, Replit, Bolt, v0, or another builder is a development environment. It may include temporary credentials, a platform-only proxy, hot reloading, or a database connection that does not match production. A successful preview proves that one environment worked; it does not prove the public app is secure or recoverable.
Publish
Create a public version through the builder’s managed workflow.
Deploy
Build and run a specific version in a configured environment.
Launch
Make the tested deployment the version real users should use.
Choose the deployment route before choosing the brand
Start with the generated project, not a list of popular hosts. Open package.json, the builder’s project settings, or its README. Identify the framework, build command, output directory, server entry point, database, authentication provider, and any background process. Those facts determine which host fits.
| Route | Best fit | Main advantage | Check before choosing |
|---|---|---|---|
| Builder Publish | Lovable or Replit project | Fastest shareable URL | Platform defaults and less infrastructure control |
| Vercel | Next.js or serverless web app | Git previews and framework-aware deployment | Persistent servers and local disk are not the model |
| Netlify | Static, SPA, or common frontend app | Simple Git-based frontend delivery | Check redirects and function compatibility |
| Render | Node, Python, Docker, API, or worker | Explicit build/start commands and long-running services | You own more runtime configuration |
Do not deploy a screenshot of the architecture
Ask the builder to explain the runtime, then verify that explanation in the files. A React frontend that calls Supabase directly can use static hosting. A Node API, Python process, queue worker, or WebSocket server needs a compatible runtime. A native mobile app needs an app-store build pipeline, not only a web host.
Before deploying: the six things to inventory
Source and build
Repository, branch, package manager, lockfile, runtime version, build command, output directory, and start command.
Environment variables
Every required variable, whether it is public or secret, and which value belongs to Preview versus Production.
Data
Production database, migrations, seed data, backups, access policies, storage buckets, and retention needs.
Identity
Auth provider, site URL, OAuth callback URLs, email templates, test users, roles, and authorization rules.
External services
AI model APIs, email, payments, maps, analytics, webhooks, quotas, billing alerts, and failure behavior.
Operations
Logs, error tracking, health checks, owner alerts, rollback procedure, and who can change production.
If you are not sure what the app contains, ask your coding agent to produce this inventory without editing anything. Then compare its answer with the repository and service dashboards. This is one of the best uses of AI in deployment: turning hidden assumptions into a checklist you can verify.
How to deploy a vibe-coded app in 8 steps
1. Put the generated code in a Git repository
Use the builder’s GitHub integration or export the project and create a repository. Git gives you a versioned source of truth, a reviewable diff, and a route out of the original builder. Commit the package-manager lockfile so the cloud build installs the same dependency versions you tested.
Before the first push, search for credentials and local files. A .env file belongs in .gitignore; a safe .env.example can list variable names without values. If a real secret has already entered Git history, deleting the visible line is not enough—revoke or rotate the credential.
2. Run the production build locally
Install dependencies using the project’s package manager, then run its production build. For many JavaScript projects that means npm ci followed by npm run build, but use the commands declared by the project. Run its type checker, tests, and linter when available.
npm ci
npm run build
npm run test # when the project defines testsAI-generated code often hides warnings behind the development server. A production build catches unresolved imports, server-only code used in the browser, invalid routes, and environment assumptions earlier and more cheaply than a cloud deployment.
3. Choose a host that matches the app’s runtime
Import the Git repository and let the host detect the framework, but review its answer. Confirm the repository root, install command, build command, output directory, runtime version, and production branch. A monorepo may need a subdirectory as its root.
Vercel documents a Git workflow that creates Preview deployments for non-production changes and a Production deployment from the configured production branch. Render asks for explicit build and start commands for a web service. Both patterns work; they solve different runtime shapes.
4. Add production environment variables without exposing secrets
Add values through the host’s environment-variable settings, not by pasting them into the repository. Keep Preview and Production separate. A preview can use a test database and sandbox payment account; production should use controlled production resources.
Usually safe to expose
A public site URL, a publishable analytics ID, or a provider’s explicitly public/anonymous browser key—subject to server-side authorization.
Keep server-side only
Database passwords, service-role keys, payment secrets, AI API keys, signing secrets, and private tokens.
Prefixes such as NEXT_PUBLIC_ and VITE_ tell the framework to include a value in browser JavaScript. They do not make a secret safe. If the browser must not know it, call the third-party API from a server route or function.
5. Prepare the database, storage, and authentication
Create or select the production project, apply schema migrations, configure storage, and verify backups appropriate to your risk. Do not assume a generated table is private. Supabase’s production guidance calls for Row Level Security on exposed tables and recommends reviewing the Security Advisor before launch.
Test authorization with at least two accounts. Confirm that one user cannot read, edit, or delete another user’s data by changing a URL or request body. Test anonymous access as well. Then replace localhost in the auth site URL, redirect allowlist, OAuth provider, email links, CORS rules, and webhook endpoints.
6. Deploy a preview and test it like a stranger would
Deploy a branch or preview environment before sending production traffic. Open the URL in a private browser window and on a phone. A useful smoke test covers account creation, sign-in/out, password reset, the main create/edit/delete flow, invalid input, refresh on a nested route, file upload, email, and any payment or AI action.
Watch browser-console errors, network requests, function logs, and database logs while testing. The public build may behave differently because production optimization, server rendering, regions, cookies, or missing environment variables are not identical to the builder preview.
7. Connect the custom domain and update every origin-dependent service
Add the DNS records shown by the host and wait until the domain is verified and HTTPS is active. Pick either the apex domain or www as the primary hostname and redirect the other to it. Configure the page title, description, favicon, social image, canonical URL, robots.txt, and sitemap for the final domain.
A domain change also affects authentication callbacks, allowed origins, CORS, payment return URLs, webhooks, email links, analytics, and third-party API restrictions. Update each service before the final smoke test. DNS may take time to propagate, so do not delete the working platform URL during the change.
8. Launch with monitoring and a rollback plan
Merge or promote the exact commit tested in Preview. Immediately repeat the highest-value user journey on the production domain. Check error logs, response times, authentication, database writes, email delivery, and third-party usage. Set billing or quota alerts for services that can stop or become expensive under traffic.
Record how to restore the previous working deployment and how to reverse a database migration. Application rollback is easy when the database remains compatible; it becomes dangerous when the new release destructively changes stored data. Prefer backward-compatible migrations and remove old fields in a later release.
Deployment recipes by stack
Next.js + Supabase: GitHub and Vercel
- Push the Next.js repository and lockfile to GitHub.
- Import it into Vercel; verify the framework and root directory.
- Add Supabase’s public URL/browser key and all server-only secrets to the correct Vercel environments.
- Apply migrations and RLS policies in the production Supabase project.
- Test a Vercel Preview deployment, then merge to the production branch.
- Connect the domain and update Supabase auth URLs and OAuth callbacks.
React or Vite SPA: GitHub and Netlify
- Confirm the app builds into the expected static output directory.
- Import the repository and set the build and publish-directory values.
- Add environment variables, remembering that browser-bundled values are public.
- Add an SPA fallback if client-side routes return 404 after a refresh.
- Test the deploy preview, connect the domain, and retest direct route visits.
Node, Python, or Docker backend: Render
- Create a web service from the repository or Docker image.
- Set the build and start commands, runtime, region, and secrets.
- Make the server listen on
0.0.0.0and the providedPORT. - Run migrations as a controlled pre-deploy step and configure a health endpoint.
- Use durable storage for uploads; the default service filesystem is ephemeral.
Lovable or Replit: use Publish for the first live URL
Test the project in its preview, run the available security review, open Publish, choose the public URL and access settings, and then retest the published URL outside the editor. Use GitHub sync when you want external deployment, branch review, local work, or a portable copy of the source.
Why vibe-coded deployments fail—and how to fix them
Start with the first real error in the build or runtime log. Do not repeatedly ask an agent to “fix deployment” without the command, exact message, environment, and expected behavior. Give it evidence and ask for the smallest change that explains the failure.
| Symptom | Likely cause | Fix |
|---|---|---|
| Build passes locally but fails in cloud | Different Node version, missing lockfile, case-sensitive import, wrong root directory | Pin the runtime, commit one lockfile, fix filename case, and verify root/build settings. |
| Blank page or assets return 404 | Wrong output directory or base path | Check the framework adapter, publish directory, asset URLs, and build log. |
| A route works until the browser refreshes | The host is not rewriting SPA routes to the entry file | Add the host’s SPA fallback rule, or deploy with the framework’s server adapter. |
| Database works locally but not live | Missing production URL/key, unapplied migration, or blocked policy | Check the Production variables, migration history, network rules, and RLS policies. |
| Login returns to localhost or errors | Old OAuth or auth callback URL | Add the production origin and exact callback path at every auth provider. |
| API key appears in browser tools | Secret was bundled into client-side JavaScript | Rotate it, move the call behind a server route, and remove the public environment prefix. |
| Uploads disappear after a redeploy | Files were written to an ephemeral filesystem | Use durable object storage or a persistent disk instead of the app container’s local directory. |
| Server starts but the host cannot reach it | Wrong host or port binding | Bind to 0.0.0.0 and the platform-provided PORT value. |
Production launch checklist for an AI-built app
- The exact production commit passed its build and checks
- No private key is present in Git or browser JavaScript
- Preview and Production use separate, intentional values
- Database migrations and authorization rules are applied
- Two-user and anonymous-access tests passed
- OAuth callbacks, CORS, webhooks, and emails use the live domain
- The primary workflow passed on desktop and mobile
- Refreshes and direct visits to nested routes work
- Error logs, health checks, and owner alerts are available
- Backups, quota alerts, and third-party billing are understood
- HTTPS, canonical URL, metadata, robots, and sitemap are correct
- The previous release and database recovery path are documented
Deployment is not the last click in a builder. It is the first repeatable release. From here, use a branch → preview → test → merge → monitor loop for every meaningful change.
Official deployment references
Platform interfaces and limits change. These primary sources were reviewed on August 27, 2026; use them to verify the current buttons, supported runtimes, and plan limits before launch.
Frequently asked questions
Can I deploy a vibe-coded app for free?
Often, yes for a prototype or low-traffic project. Many builders and hosts offer a limited free allowance, but databases, bandwidth, background jobs, email, AI APIs and custom-domain features may create costs. Check current limits before relying on a free plan for production.
What is the easiest way to deploy a vibe-coded app?
Use the builder’s Publish button when the goal is a fast shareable URL. For a maintainable web app, sync the code to GitHub, import it into a compatible host such as Vercel or Netlify, add production environment variables, test the preview, and then attach a domain.
Should I use Vercel or Netlify for a vibe-coded app?
Vercel is the natural first choice for a Next.js project. Netlify is a strong choice for static sites and common frontend frameworks. The correct decision depends on the generated framework, server-side functions, build output, regions, limits and any backend process the app needs.
Do I need GitHub to deploy an AI-generated app?
Not for a builder’s one-click publishing flow. Git is still recommended when the app matters because it provides ownership, history, reviewable changes, preview deployments and an easier path to a different host.
How do I keep API keys secret when deploying?
Store secrets in the hosting platform’s environment-variable or secret manager and call sensitive services from server-side code. Never place a private key in browser code or use a public-prefix convention such as NEXT_PUBLIC_ or VITE_ unless the value is explicitly designed to be public. Rotate any key that has already been committed or shipped to a browser.
Why does my vibe-coded app work in preview but fail after deployment?
The usual causes are a missing production environment variable, the wrong build or start command, a mismatched Node version, case-sensitive file imports, unapplied database migrations, blocked database policies, incorrect OAuth callback URLs, SPA routing rules, or a server that is listening on the wrong port.
Is one-click publishing production-ready?
It can be appropriate for a simple site or prototype, but the button does not prove production readiness. You still need to validate authorization, secrets, backups, error handling, accessibility, performance, monitoring, custom domains and the behavior of every third-party service.
Can I use this guide for a mobile vibe-coded app?
The backend, secrets and database guidance still applies, but publishing a native iOS or Android app is a separate workflow. It requires signed builds, app identifiers, store assets, platform permissions and review through the relevant app store rather than only deploying a web URL.
From generated code to a release you control
The safest default is simple: own the code in Git, make the production build repeatable, keep secrets on the server, test authorization with real accounts, and launch the same commit you tested. The hosting logo matters less than matching the app’s runtime and preserving a way back.
If you are still choosing a stack, start with our free vibe coding stack. You can also compare vibe coding tools, browse the AI coding tools directory, or learn what vibe coding means before committing to a workflow.
