Skip to main content

Custom Domains, SSL and Email for AI-Built Apps

By the OnlineAppCreator editorial team4 min read

Short answer

To run an AI-built app on your own domain, point DNS at your host with an A record or flattened CNAME for the apex and a CNAME for subdomains, let the host issue a TLS certificate and enforce HTTPS with HSTS. For email, send transactional messages through a dedicated provider on a subdomain with SPF, DKIM and DMARC configured, and replace the builder's or Supabase's default email sender before launch.

On this page
  1. Plan your domain structure first
  2. DNS records for the app
  3. SSL/TLS and HTTPS
  4. Email that actually arrives
  5. Domains and mobile apps
  6. Common mistakes

A product on a builder subdomain signals "prototype" to customers and to spam filters. Moving to your own domain is one of the first steps toward production, and it touches three areas that are easy to get slightly wrong: DNS, TLS certificates and email authentication. Mistakes show up later as certificate warnings, login emails in spam folders or a site that works on www but not without it. This guide covers the setup for apps built with Lovable, Bolt, Base44, Replit, Claude Code or Codex.

Plan your domain structure first

Decide which hostnames serve what before touching DNS. A common structure is the apex domain and www for the marketing site, app. for the application, api. for a backend if it is separate, and a mail subdomain such as mail. or notify. for transactional email. Choose one canonical version of the main site, with or without www, and redirect the other. Separating email onto a subdomain protects the reputation of your main domain if something goes wrong with sending. Keep the domain registrar account protected with multi-factor authentication and owned by the company, not a freelancer's personal account.

DNS records for the app

Hosts give you the exact records to add. Subdomains such as app.example.com use a CNAME record pointing to the host's target. The apex domain, example.com, cannot be a standard CNAME, so you use the A record (and AAAA for IPv6) your host provides, or an ALIAS, ANAME or CNAME flattening feature if your DNS provider supports it. Lower the TTL a day before switching an existing domain, so mistakes can be corrected quickly.

Builders like Lovable offer custom domain connection in their settings, at the time of writing on paid plans, and display the records to create. If you deploy the exported code elsewhere, as described in deploying a Lovable app to production, the host shows the records instead. Add a CAA record listing the certificate authorities your host uses, which prevents other authorities from issuing certificates for your domain.

SSL/TLS and HTTPS

Modern hosts issue and renew certificates automatically, typically via Let's Encrypt or their own authority, once DNS points correctly. Your tasks are to verify both apex and www are covered, to redirect all HTTP traffic to HTTPS and to set the Strict-Transport-Security header, starting with a short max-age and increasing it once everything works. Check that the app has no mixed content, such as images or scripts loaded over HTTP, and that API calls and redirect URLs use the new domain. Update OAuth redirect URLs at Google, Apple, GitHub or other identity providers, and the site URL and allowed redirect list in Supabase or your auth provider, otherwise logins break after the switch.

Email that actually arrives

AI-built apps send sign-up confirmations, password resets, magic links and notifications. Defaults are rarely production-ready. Supabase's built-in email service, for example, is intended for development and is strongly rate limited; production apps should configure custom SMTP. The same applies to many builders. Use a transactional email provider and authenticate your domain.

  1. Choose a transactional email provider with an EU region if you process EU personal data, and sign its DPA.
  2. Add the sending subdomain in the provider and create the DKIM records it generates.
  3. Add or update the SPF record to include the provider, keeping a single SPF record per hostname.
  4. Publish a DMARC record, starting with p=none and a reporting address, then tighten to quarantine or reject after reviewing reports.
  5. Configure custom SMTP or the provider's API in your auth system and app, with a recognisable sender name and reply-to address.
  6. Send test messages to major mailbox providers and check that SPF, DKIM and DMARC pass in the message headers.

Major mailbox providers such as Gmail and Yahoo have tightened requirements for senders, including authentication and DMARC for bulk senders, so this setup is no longer optional for growing apps. Keep marketing email on a separate subdomain or provider from login emails, so a campaign problem cannot block password resets.

Domains and mobile apps

If the web app is also distributed as a mobile app, the domain matters there too. Universal links on iOS and App Links on Android require verification files hosted on your domain, and a wrapper app loads its content from the production URL. With WebViewGold, which turns web apps into native iOS and Android apps, you set the production domain as the start URL and configure deep links to it, so change the domain before publishing, not after. See our guide on turning a Lovable project into native apps.

Common mistakes

Typical problems are two SPF records on the same hostname, which invalidates both; forgetting to redirect the builder subdomain, which leaves duplicate content for search engines as noted in SEO for AI-built web apps; auth emails still linking to the old domain; and certificates failing because a proxy or CDN in front of the host blocks the validation request. If you prefer to have this handled, the neooutput AI development services team sets up domains, certificates and email for AI-built apps as part of deploying and securing them.

Frequently asked questions

Why can't I use a CNAME on my root domain?

DNS standards do not allow a CNAME at the zone apex alongside other required records. Use the host's A record or a provider feature such as ALIAS, ANAME or CNAME flattening.

Do I need to buy an SSL certificate?

Usually not. Most modern hosts issue and renew free certificates automatically once your DNS records point to them.

Why do my app's login emails land in spam?

Typically because the sending domain lacks SPF, DKIM or DMARC, or because a shared default sender is used. Configure a transactional provider on your own authenticated domain.

Do I need to change anything at my login providers after switching domains?

Yes. Update OAuth redirect URLs and allowed origins at each identity provider and the site URL and redirect list in your auth system.

Want this done right, the first time?

OnlineAppCreator takes products from idea to operation. Tell us where you stand and get a concrete plan in a free 15-minute call.