---
title: "Setting Up a Custom Domain"
description: "A complete, beginner-friendly guide to connecting your own domain name to your deployed Nuxas site. Learn how to buy a domain, configure DNS records, and enable HTTPS on Netlify, Cloudflare, Vercel, and other hosting providers."
canonical_url: "https://nuxas.pages.dev/docs/19-custom-domain"
---

> Index of every page on this site: [llms.txt](https://nuxas.pages.dev/llms.txt)

## Setting Up a Custom Domain

In the previous chapter, we deployed to Netlify, and we discussed other hosting providers. Now it is time to connect your own domain name.

A custom domain is the address visitors type to reach your site, like `my-saas.com` instead of `random-name-12345.netlify.app`. It makes your site look professional, improves brand recognition, and is essential for SEO. Search engines treat a custom domain more seriously than a subdomain on a hosting provider.

This chapter walks you through the entire process: buying a domain, connecting it to your hosting provider, configuring DNS records, and enabling HTTPS.

### Part 1 — Buying a Domain

If you do not already own a domain, you need to buy one. There are many registrars to choose from. Here are the most popular ones:

- **Namecheap** — [https://www.namecheap.com](https://www.namecheap.com)
- **Cloudflare Registrar** — [https://www.cloudflare.com/products/registrar/](https://www.cloudflare.com/products/registrar/)
- **Porkbun** — [https://porkbun.com](https://porkbun.com)
- **Google Domains** — [https://domains.google](https://domains.google) (now Squarespace)

All four are reliable, and the prices are usually within a few dollars of each other. For most users, Namecheap or Cloudflare Registrar are the best choices.

**How to buy a domain:**

1. Go to your chosen registrar.
2. Search for the domain name you want. For example, `my-saas.com`.
3. If the domain is available, add it to your cart.
4. Choose the registration period. One year is the minimum, but longer periods often cost less per year. Two to three years is a common choice.
5. Complete the checkout. You will need to provide your name, address, and payment information.
6. After the purchase, you will receive an email from the registrar with instructions to manage your domain.

### A Note on Domain Names

Domain names are a branding decision, not just a technical one. A few guidelines:

- **Keep it short.** `my-saas.com` is better than `my-awesome-saas-product-2026.com`.
- **Use .com if possible.** It is the most trusted TLD. `.io`, `.dev`, and `.ai` are also acceptable for SaaS, but `.com` is still the default.
- **Avoid hyphens and numbers.** They are hard to say out loud and easy to mistype.
- **Check social media availability.** If `@my-saas` is taken on Twitter, your branding will be inconsistent.

### Part 2 — Adding the Domain to Your Hosting Provider

The next step is to connect the domain to your hosting provider. The exact process depends on which provider you used in the previous chapter.

#### Netlify

1. Log in to your Netlify dashboard.
2. Click on your site.
3. Go to **Site settings** → **Domain management** → **Domains**.
4. Click **Add a domain**.
5. Enter your domain name (for example, `my-saas.com`) and click **Verify**.
6. Netlify will show you instructions for DNS configuration. Keep this page open — you will need it in Part 3.

#### Cloudflare Pages

1. Log in to your Cloudflare dashboard.
2. Go to **Workers & Pages**, then select your project.
3. Click **Custom domains**, then **Set up a custom domain**.
4. Enter your domain name.
5. Cloudflare will automatically configure the DNS if your domain is also registered with Cloudflare. If not, you will need to add a CNAME record.

#### Vercel

1. Log in to your Vercel dashboard.
2. Go to your project, then **Settings** → **Domains**.
3. Click **Add**, then enter your domain name.
4. Vercel will show you the DNS records to add. Keep this page open.

#### AWS Amplify

1. Log in to the AWS Management Console and go to **Amplify**.
2. Select your app.
3. Go to **Domain management** → **Add domain**.
4. Enter your domain name.
5. Follow the prompts to configure DNS.

### Part 3 — Configuring DNS Records

DNS records tell the internet where your domain points. There are two common configurations:

1. **A record** — points to an IP address. Used for apex domains like `my-saas.com`.
2. **CNAME record** — points to another domain name. Used for subdomains like `www.my-saas.com`.

Your hosting provider will tell you exactly which records to add. But you need to add them at your **domain registrar**, not at your hosting provider.

Here is how to add DNS records at the most popular registrars.

#### Namecheap

1. Log in to Namecheap.
2. Click **Domain List** in the left sidebar, then click **Manage** next to your domain.
3. Go to the **Advanced DNS** tab.
4. Click **Add New Record** and enter the record type, host, and value provided by your hosting provider.
5. Click the green checkmark to save.

#### Cloudflare Registrar

1. Log in to Cloudflare.
2. Select your domain, then go to **DNS** in the left sidebar.
3. Click **Add record**.
4. Choose the record type, enter the name and value, and click **Save**.

#### Google Domains / Squarespace

1. Log in to your registrar.
2. Find the **DNS** section for your domain.
3. Add the records provided by your hosting provider.

### Part 4 — Waiting for Propagation

DNS changes do not take effect immediately. The internet needs time to propagate the new records, which can take anywhere from a few minutes to a few hours. In rare cases, it can take up to 48 hours.

During this time, you may notice:

- Your domain works for some people but not others.
- Your domain works on some networks but not others.
- Your domain shows an error like "This site can't be reached."

This is normal. Wait patiently. You can check the propagation status using a tool like [https://dnschecker.org](https://dnschecker.org).

### Part 5 — Enabling HTTPS

HTTPS is the secure version of HTTP. It encrypts traffic between your site and your visitors, prevents tampering, and is required for a good SEO score.

Most hosting providers enable HTTPS automatically once your domain is connected. Netlify, Cloudflare, Vercel, and AWS Amplify all provide free SSL certificates via Let's Encrypt.

**If HTTPS is not automatic,** check your hosting provider's documentation. On Netlify, for example, you can click **Verify DNS configuration** in the domain settings page, then **Provision certificate**.

For a VPS, you need to install Certbot manually, as we covered in the previous chapter.

### Part 6 — Updating site.url

After your domain is working, update `site.url` in `nuxt.config.ts`:

```ts
site: {
  url: 'https://my-saas.com',
  name: 'My SaaS',
  description: 'My SaaS description',
  defaultLocale: 'en',
},
```

Save the file, commit the change, and push to GitHub:

```cmd
git add .
git commit -m "Update site URL to custom domain"
git push
```

Your hosting provider will rebuild the site automatically. After the rebuild, your sitemap, canonical tags, and Open Graph URLs will all use the new domain.

### Part 7 — Adding the www Subdomain

Most sites are accessible from both `my-saas.com` and `www.my-saas.com`. To avoid duplicate content (which hurts SEO), you should redirect one to the other.

The convention is:

- `https://my-saas.com` is the canonical URL.
- `https://www.my-saas.com` redirects to the apex domain.

Most hosting providers handle this automatically. On Netlify, for example, you can set the primary domain to `my-saas.com` and Netlify will redirect `www` to it.

If your provider does not handle this, add a redirect rule in your hosting configuration.

### Part 8 — A Note on Decap CMS After Domain Change

If you are using Decap CMS, you need to update the OAuth callback URL and the site URL in the Decap CMS configuration after changing the domain.

**For Netlify with Git Gateway:** No change is needed. Git Gateway authenticates through Netlify, not through your domain.

**For GitHub backend:** You need to update the OAuth app's callback URL. Go to GitHub Settings → Developer settings → OAuth Apps → Your App → Update the callback URL to your new domain.

**For local mode:** No change is needed. Local mode works regardless of the domain.

### Troubleshooting

#### Issue: "This site can't be reached"

This usually means DNS propagation is not complete. Wait a few minutes and try again. If the problem persists after an hour, check your DNS records.

#### Issue: "SSL certificate error"

This usually means HTTPS is not yet provisioned. Most providers provision certificates automatically within minutes of DNS propagation. If the error persists after an hour, click **Verify DNS configuration** in your hosting dashboard.

#### Issue: The site loads but images are broken

This is likely a cached asset issue. Clear your browser cache and try again. If the images are hosted on `localhost`, update their URLs to production URLs.

#### Issue: The old Netlify URL still works but the new domain does not

This means DNS records are not pointing to the right place. Check your registrar's DNS settings and compare them to your hosting provider's instructions.

### What to Expect in the Next Chapter

In the next chapter, we will cover support and services. You will learn how to reach us if you need help, how to use the contact form, and what services we offer beyond the Nuxas template.

See you in the next chapter.

## Sitemap

See the full [sitemap](https://nuxas.pages.dev/sitemap.md) for all pages.
