# Add your domain (/en/docs/deployment/domain)

① Live → ② Accounts work → ③ Merge = deployed → **④ Features** → ⑤ Taking payments

Your pre-launch app is live on your host's URL with test billing if billing is configured. This page moves it to your own domain,
such as `https://app.yourdomain.com`, and updates everything that names the
URL in one pass.

**Give your agent this prompt:**

```text interactive=true
Prepare to move my app on <host> to <new origin>.
Follow https://coremvp.com/en/docs/deployment/domain.md and its prerequisites.
Ask me before DNS or provider changes, secret writes, deployment, production changes or removing old redirects. Finish when sign-in, configured Google sign-in, delivery to the new origin for every active billing provider and resulting access, and ./coremvp prod e2e smoke <new origin> pass.
Report what changed, the check results and anything you could not run.
```

**You'll need**

A domain you own and access to its DNS records.

### 1. Point the domain at your host

**Vercel:**

```bash interactive=true
bunx vercel domains add <app-domain> <project-name>
```

Replace `<app-domain>` and `<project-name>` with your domain and Vercel project name.
Add the DNS records Vercel shows, then wait until **Settings → Domains**
shows the domain as valid with HTTPS
([Vercel's domain guide](https://vercel.com/docs/domains/working-with-domains/add-a-domain)).

**Cloudflare:**

The domain must be in an active Cloudflare zone you own. A hostname with an existing CNAME cannot be used as a Custom Domain. In the Worker's **Settings →
Domains & Routes**, add a **Custom domain**
([Cloudflare's custom domain guide](https://developers.cloudflare.com/workers/configuration/routing/custom-domains/)).
Cloudflare creates the DNS record and certificate.

Keep the DNS records for your email sending domain from
[Add email](/en/docs/deployment/email).

### 2. Update everything that names the URL

Change all of these to the new origin together:

| Where                                                                                            | What                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Your host                                                                                        | `NEXT_PUBLIC_APP_URL` (Vercel `env update`, or `.env.cloudflare`)                                                                                                |
| Cloudflare **Build variables**, if you set up [Ship on merge](/en/docs/deployment/ship-on-merge) | `NEXT_PUBLIC_APP_URL`                                                                                                                                            |
| Supabase **Authentication → URL Configuration**                                                  | **Site URL**, and the three [redirect URLs](/en/docs/deployment/supabase#allow-auth-redirects) on the new origin; keep the old ones until the check below passes |
| Every active billing provider                                                                    | Edit the existing webhook destination URL to the new origin, keeping its signing secret                                                                          |
| Google Cloud, if you added Google sign-in                                                        | Add the new origin to the OAuth client’s authorized JavaScript origins. The redirect URI still points to Supabase                                                |

Keep the existing destinations active during the domain move. If you also
need to replace a webhook destination, finish the domain move first where
possible. Plan the replacement separately with the provider's delivery and
retry instructions. Use [Rotate a secret](/en/docs/deployment/after-launch/rotate-a-secret)
to check the credential on the receiving deployment.

### 3. Redeploy

**Vercel:**

```bash
bunx vercel deploy --prod
```

**Cloudflare:**

Run the build, dry run and deploy from
[Deploy to Cloudflare](/en/docs/deployment/cloudflare#deploy). The app URL
is built in, so this must be a new build.

## Check it works

On the new domain:

1. Sign up, sign in, reload and sign out.
2. If Google sign-in is configured, sign in with Google on the new origin.
3. Check each active billing provider, including any provider retaining subscriptions or purchases. Run a test checkout for each that accepts new checkout ([Stripe](/en/docs/deployment/billing/stripe#check-it-works), [Polar](/en/docs/deployment/billing/polar#check-it-works)); check delivery to the new origin and access. For a retained provider without new checkout, inspect delivery of a relevant retained-subscription event to the new origin and its resulting state. In live mode, keep live mode and ask before a real purchase. Check failed deliveries and resolve them before finishing.
4. Run `./coremvp prod e2e smoke https://app.yourdomain.com`, replacing the example with your new origin.

When applicable checks pass, remove the old origin's Supabase redirect URLs. Keep the
host's own domain; it still points at the same app.

## What's next

- [Next: Go live](/en/docs/deployment/launch-app): Switch to real email and live payments, then watch the live checks pass.
