Tutorials August 27, 2026 17 min read

How to Deploy a Vibe-Coded App: Step-by-Step

Turn an AI-builder preview into a live, secure, maintainable app—with the right host, production secrets, database rules, domain, tests, and rollback path.

By Vibe Coding Editorial Team · Reviewed against official platform documentation

How To Deploy A Vibe-Coded App cover with a cobalt path crossing architectural deployment stages
A cobalt path passes through carefully staged paper, glass, and metal architecture to represent a vibe-coded app moving into production.

The shortest reliable deployment path

  1. Export or sync the generated code to a GitHub repository.
  2. Run the production build locally and remove any secrets from the code.
  3. Import the repository into a host that supports the project’s framework.
  4. Add separate Preview and Production environment variables.
  5. Deploy a preview; test authentication, database writes, uploads, emails, and errors.
  6. Connect a custom domain, update callback URLs, then promote the tested build.

For a typical Next.js app with Supabase, GitHub → Vercel → production variables → database policies → preview test → domain is the clearest default. If you only need a demo link, the builder’s own Publish button is faster.

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.

RouteBest fitMain advantageCheck before choosing
Builder PublishLovable or Replit projectFastest shareable URLPlatform defaults and less infrastructure control
VercelNext.js or serverless web appGit previews and framework-aware deploymentPersistent servers and local disk are not the model
NetlifyStatic, SPA, or common frontend appSimple Git-based frontend deliveryCheck redirects and function compatibility
RenderNode, Python, Docker, API, or workerExplicit build/start commands and long-running servicesYou 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 tests

AI-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

  1. Push the Next.js repository and lockfile to GitHub.
  2. Import it into Vercel; verify the framework and root directory.
  3. Add Supabase’s public URL/browser key and all server-only secrets to the correct Vercel environments.
  4. Apply migrations and RLS policies in the production Supabase project.
  5. Test a Vercel Preview deployment, then merge to the production branch.
  6. Connect the domain and update Supabase auth URLs and OAuth callbacks.

React or Vite SPA: GitHub and Netlify

  1. Confirm the app builds into the expected static output directory.
  2. Import the repository and set the build and publish-directory values.
  3. Add environment variables, remembering that browser-bundled values are public.
  4. Add an SPA fallback if client-side routes return 404 after a refresh.
  5. Test the deploy preview, connect the domain, and retest direct route visits.

Node, Python, or Docker backend: Render

  1. Create a web service from the repository or Docker image.
  2. Set the build and start commands, runtime, region, and secrets.
  3. Make the server listen on 0.0.0.0 and the provided PORT.
  4. Run migrations as a controlled pre-deploy step and configure a health endpoint.
  5. 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.

SymptomLikely causeFix
Build passes locally but fails in cloudDifferent Node version, missing lockfile, case-sensitive import, wrong root directoryPin the runtime, commit one lockfile, fix filename case, and verify root/build settings.
Blank page or assets return 404Wrong output directory or base pathCheck the framework adapter, publish directory, asset URLs, and build log.
A route works until the browser refreshesThe host is not rewriting SPA routes to the entry fileAdd the host’s SPA fallback rule, or deploy with the framework’s server adapter.
Database works locally but not liveMissing production URL/key, unapplied migration, or blocked policyCheck the Production variables, migration history, network rules, and RLS policies.
Login returns to localhost or errorsOld OAuth or auth callback URLAdd the production origin and exact callback path at every auth provider.
API key appears in browser toolsSecret was bundled into client-side JavaScriptRotate it, move the call behind a server route, and remove the public environment prefix.
Uploads disappear after a redeployFiles were written to an ephemeral filesystemUse durable object storage or a persistent disk instead of the app container’s local directory.
Server starts but the host cannot reach itWrong host or port bindingBind 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.

Build the app you want to deploy

Generate and refine an editable web project in the AI workspace, then use this checklist to take it live.