Skip to content

[Pages] Clarify vercel migration guide #21605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Pages] Clarify vercel migration guide
  • Loading branch information
kodster28 committed Apr 10, 2025
commit e7e49c6532cdaabd46f4d4c36951737e1421a175
19 changes: 4 additions & 15 deletions src/content/docs/pages/configuration/custom-domains.mdx
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
---
pcx_content_type: how-to
title: Custom domains

---

import { Render } from "~/components";

When deploying your Pages project, you may wish to point custom domains (or subdomains) to your site.

## Add a custom domain

To add a custom domain:

1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login).
2. Select your account in **Account Home** > **Workers & Pages**.
3. Select your Pages project > **Custom domains**.
4. Select **Set up a domain**.
5. Provide the domain that you would like to serve your Cloudflare Pages site on and select **Continue**.

![Adding a custom domain for your Pages project through the Cloudflare dashboard](~/assets/images/pages/platform/domains.png)
<Render file="custom-domain-steps" />

### Add a custom apex domain

Expand All @@ -32,10 +25,8 @@ If you are deploying to a subdomain, it is not necessary for your site to be a C

:::note


If the zone is on the Enterprise plan, make sure that you [release the zone hold](/fundamentals/setup/account/account-security/zone-holds/#release-zone-holds) before adding the custom domain. A zone hold would prevent the custom subdomain from activating.


:::

#### Add a custom CNAME record
Expand All @@ -50,10 +41,8 @@ If your site is already managed as a Cloudflare zone, the CNAME record will be a

:::note


To ensure a custom domain is added successfully, you must go through the [Add a custom domain](#add-a-custom-domain) process described above. Manually adding a custom CNAME record pointing to your Cloudflare Pages site - without first associating the domain (or subdomains) in the Cloudflare Pages dashboard - will result in your domain failing to resolve at the CNAME record address, and display a [`522` error](/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-522-connection-timed-out).


:::

## Delete a custom domain
Expand Down Expand Up @@ -115,4 +104,4 @@ Once a custom domain is set up, if you change the DNS entry to point to somethin

## Relevant resources

* [Debugging Pages](/pages/configuration/debugging-pages/) - Review common errors when deploying your Pages project.
- [Debugging Pages](/pages/configuration/debugging-pages/) - Review common errors when deploying your Pages project.
43 changes: 27 additions & 16 deletions src/content/docs/pages/migrations/migrating-from-vercel/index.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
updated: 2020-09-23
updated: 2025-04-10
difficulty: Beginner
pcx_content_type: tutorial
title: Migrating from Vercel to Pages
sidebar:
hidden: true
---

In this tutorial, you will learn how to deploy your Vercel application to Cloudflare Pages.
import { Render } from "~/components";

:::note
In this tutorial, you will learn how to deploy your Vercel application to Cloudflare Pages.

You should already have an existing project deployed on Vercel that you would like to host on Cloudflare Pages. Features such as Vercel's serverless functions are currently not supported in Cloudflare Pages.

:::

## Finding your build command and build directory
## Find your build command and build directory

To move your application to Cloudflare Pages, you will need to find your build command and build directory. Cloudflare Pages will use this information to build your application and deploy it.

Expand All @@ -31,26 +29,39 @@ Find the **Build & Development settings** panel, which will have the **Build Com

![Finding the Build Command and Output Directory fields](~/assets/images/pages/migrations/vercel-deploy-3.png)

## Creating a new Pages project
## Create a new Pages project

After you have found your build directory and build command, you can move your project to Cloudflare Pages.

The [Get started guide](/pages/get-started/) will instruct you how to add your GitHub project to Cloudflare Pages.

## Adding a custom domain
## Add a custom domain

To use a custom domain for your Pages project, [add a custom domain](/pages/configuration/custom-domains/) that is the same custom domain as your currently deployed Vercel application. When Pages finishes the initial deploy of your site, you will need to delete the Vercel application to start sending requests to Cloudflare Pages.
Next, connect a [custom domain](/pages/configuration/custom-domains/) to your Pages project. This domain should be the same one as your currently deployed Vercel application.

:::note
### Change domain nameservers

Cloudflare does not provide IP addresses for your Pages project because we do not require `A` or `AAAA` records to link your domain to your project. Instead, Cloudflare uses `CNAME` records.
In most cases, you will want to [add your domain to Cloudflare](/dns/zone-setups/full-setup/setup/).

For more details, refer to [Custom domains](/pages/configuration/custom-domains/).
This does involve changing your domain nameservers, but simplifies your Pages setup and allows you to use an apex domain for your project (like `example.com`).

If you want to take a different approach, read more about [custom domains](/pages/configuration/custom-domains/).

### Set up custom domain

:::
<Render file="custom-domain-steps" />

## Cleaning up your old application and assigning the domain
The next steps vary based on if you [added your domain to Cloudflare](#change-domain-nameservers):

In your DNS settings for your domain, make sure that you have updated the CNAME record for your domain from Vercel to Cloudflare Pages. With your DNS record updated, requests will go to your Pages application.
- **Added to Cloudflare**: Cloudflare will set everything up for you automatically and your domain will move to an `Active` status.
- **Not added to Cloudflare**: You need to [update some DNS records](/pages/configuration/custom-domains/#add-a-custom-subdomain) at your DNS provider to finish your setup.

By completing this guide, you have successfully migrated your Vercel project to Cloudflare Pages.
## Delete your Vercel app

After Pages finishes the initial deploy of your site and you have your custom domain set up, delete the Vercel application to start sending requests to Cloudflare Pages.

## Troubleshooting

Cloudflare does not provide IP addresses for your Pages project because we do not require `A` or `AAAA` records to link your domain to your project. Instead, Cloudflare uses `CNAME` records.

For more details, refer to [Custom domains](/pages/configuration/custom-domains/).
13 changes: 13 additions & 0 deletions src/content/partials/pages/custom-domain-steps.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
{}
---

To add a custom domain:

1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login).
2. Select your account in **Account Home** > **Workers & Pages**.
3. Select your Pages project > **Custom domains**.
4. Select **Set up a domain**.
5. Provide the domain that you would like to serve your Cloudflare Pages site on and select **Continue**.

![Adding a custom domain for your Pages project through the Cloudflare dashboard](~/assets/images/pages/platform/domains.png)