3 min read
How to add cloudflare custom domain to Vercel
Table of Contents

Overview

This guide provides a step-by-step process for connecting a custom Cloudflare domain to a Vercel project. Starting from purchasing a domain to setting up DNS configurations, it covers how to add both A and CNAME records in Cloudflare, enabling the site to go live and be accessible on the chosen domain.

Add Cloudflare custom domain to Vercel

  1. Sign up and sign in to Cloudflare https://dash.cloudflare.com/sign-up.

  2. In your Cloudflare dashboard, select the Domain Registration > Register Domains tab.

  3. Search for your favorite domain and purchase it. In my case, I purchased the domain https://devjourney.me/ for my portfolio.

  4. Sign in to Vercel and go to your dashboard, where you can see all your projects in the Overview tab.

  5. Click on a project and on the top right, select Domains.

  6. Type your domain in the text box, e.g., devjourney.me, and click Add.

  7. Select the recommended option: Add www.devjourney.me and redirect devjourney.me to it.

  8. Vercel will show an invalid configuration under your domains and display the relevant A record IP under devjourney.me and a CNAME IP under www.devjourney.me. These need to be set up on Cloudflare to make it work.

  9. Go to the Cloudflare dashboard and select Domain Registration > Manage Domains tab.

  10. Your domain will be listed in a table. Select Manage.

  11. Look for Update DNS configuration under the quick actions.

  12. Add an A record (turn off proxy):

    TypeName(required)IPv4 address(required)Proxy status
    A@xx.xx.xx.xxoff
  13. Add a CNAME record (turn off proxy):

    TypeName(required)IPv4 address(required)Proxy status
    CNAMEwwwcname.vercel-dns.comoff
  14. You’re done! Visit your domain, and you should now see your project live and accessible.


Using Cloudflare as your DNS provider

Add Cloudflare custom domain to Vercel