How Do You Deploy an AI-Built App and Add a Domain?
If you built in Lovable, Replit or v0, use its Publish button, then connect your domain in that tool's settings. If you have your own repository, connect it to a managed host such as Vercel, add your environment variables, and deploy. Then copy the DNS records your host shows into your domain registrar's settings.
Prepare this app for its first production deployment on [Vercel / my builder's hosting]. Don't deploy yet. 1. Run a production build and fix any errors. For Next.js, use `next build`, then `next start`, and check the main pages. 2. List every environment variable the app needs in production, without showing values. For each one: what it's for, whether it's public or secret, and where I get the production value. 3. Flag anything pointing at localhost, a test database, sandbox keys or sample data. 4. Tell me which settings must change at outside services once the real domain exists: sign-in redirect URLs, webhook endpoints, allowed origins, email sender. 5. Tell me whether this app needs a server or can deploy as static files. 6. Give me a step-by-step checklist for the dashboard, in order, using the actual button names where you know them. Mark what I must do by hand. My domain is [example.com], and I want [www.example.com or example.com] to be the main address.
- 1Connect your repositoryPick it on the New Project page
- 2Add variablesChanges reach new deployments only
- 3DeployEach push then deploys again
- 4Add your domainUnder Settings, then Domains
- 5Copy the DNS recordsUse your host's values, and keep MX records
Try it now
- 1Paste the prompt above and work through its list. Add each variable in your host's settings. On Vercel, choose Secret for private values and select the Production environment.
- 2Deploy, then add your domain and copy the records into your registrar's DNS settings. On Vercel, add both
example.comandwww.example.com, and redirect one to the other. - 3Open your domain in a private window and sign up as a new user. It worked if the address shows HTTPS and your confirmation email links back to the real domain instead of localhost.
Use it when
Once your app works in preview and you've run the security checks. Also deploy early if you need to test something that only works on a real address, such as a payment webhook or a login redirect.
Skip it when
Don't launch a public link while the app still uses sample logins or open database rules. Use a protected preview, or a builder's limited sharing option, instead. A managed host may also be wrong for long-running background work, so ask before committing if your app needs it.
Why it works
A managed host runs your code without you running a server, and these are the routes:
- Lovable: Publish gives you a
lovable.appaddress with HTTPS. Custom domains need a paid plan: Project → Settings → Domains, then Connect. You add anArecord and aTXTrecord at_lovablewith the values it shows. - Replit: open Tools, then Publishing. The published app is a snapshot, separate from your editor, so you publish again to push changes.
- v0: Publish in the chat header creates a Vercel project and starts a production deployment. Domains are under Project menu → Settings → Domains.
- Vercel directly: on the New Project page, connect your Git account, pick a repository and click Deploy. Each push then deploys. Domains are under Settings → Domains. A root domain uses an
Arecord, and a subdomain uses aCNAMEthat's unique to your project.
Use the record values your host shows. Vercel's troubleshooting table says not to copy values from another project.
Example
A Next.js app on GitHub goes to Vercel. The first deployment fails because a variable is missing, and adding it in the dashboard doesn't help, since Vercel applies variable changes only to new deployments. A redeploy fixes it.
Next comes the domain. The registrar already handles email for the business, so the owner adds only the website's A record and CNAME rather than switching nameservers. Vercel's docs warn that changing nameservers means copying your existing records first, including MX records for email. Skipping that step is how a website launch breaks a company's email.
Going further
Check whether your plan allows your use. Vercel's Hobby plan is restricted to personal, non-commercial use, so a business app needs Pro. Replit's free Starter app goes down after 30 days, and Lovable's Free plan has no custom domains.
Understand what's live and what isn't. On Vercel, the first deployment of a new project is always production, even from another branch, and it builds with Production variables. After that, pushes to other branches create previews. To check a build with production settings before anyone sees it, turn off Auto-assign Custom Production Domains, then promote it manually. Vercel warns that this kind of test can reach production services and data.
On Replit, the published app can fail the final step if your home page takes more than five seconds to respond, because the health check times out. Move slow work behind a user action.
Common mistakes
- Changing nameservers without copying
MXrecords first, which stops your email. - Forgetting to redeploy after changing a variable. The running deployment keeps its old values.
- Running a business on Vercel's Hobby plan, which its rules limit to non-commercial use.
- Assuming DNS failed after a few minutes. Vercel notes that changes can take time to spread, so check the status in Settings → Domains before changing anything.
Sources
- FAQ, Lovable docs
- Custom domains, Lovable docs
- Publishing, Replit docs
- Starter plan, Replit docs
- Troubleshoot publishing, Replit docs
- Deployments, v0 docs
- Getting started with Vercel, Vercel docs
- Adding a custom domain, Vercel docs
- Environment variables, Vercel docs
- Environments, Vercel docs
- Hobby plan, Vercel docs
- Production checklist, Next.js docs
- Subscription plans, Lovable docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.