Skip to content

New guide for migrating from Vercel to Workers #21959

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

Draft
wants to merge 2 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/content/docs/workers/static-assets/migrations/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
pcx_content_type: navigation
title: Migrations
sidebar:
order: 11
head: []
description: Learn how to migrate your applications to Cloudflare Workers.
---

import {
Description,
DirectoryListing,
} from "~/components";

<Description>
Bring your existing applications to Cloudflare Workers.
</Description>

Take advantage of Cloudflare's global network and migrate your existing applications to Workers.

<DirectoryListing folder="workers/static-assets/migrations" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
updated: 2025-04-25
difficulty: Beginner
pcx_content_type: tutorial
title: Migrate from Vercel to Workers
---

import { WranglerConfig } from "~/components";

In this tutorial, you will learn how to migrate your Vercel application to Cloudflare Workers.

You should already have an existing project deployed on Vercel that you would like to host on Cloudflare Workers. Vercel specific features are not supported by Cloudflare Workers. Review the [Workers compatibility matrix](/workers/static-assets/migrate-from-pages/#compatibility-matrix) for more information on what is supported.

## Frameworks

Some frameworks like Next.js, Astro with on demand rendering, and others have specific guides for migrating to Cloudflare Workers; refer to our [framework guides](/workers/frameworks/) for more information. If your framework has a **Deploy an existing project on Workers** guide, follow that guide for specific instructions. Otherwise, continue with the steps below.

## Find your build command and build directory

To move your application to Cloudflare Workers, you will need to know your build command and build directory. Cloudflare Workers will use this information to build and deploy your application. We'll cover how to find these values in the Vercel Dashboard below.

In your Vercel Dashboard, find the project you want to migrate to Workers. Go to the **Settings** tab for your specific project and find the **Build & Development settings** panel. You will find the **Build Command** and **Output Directory** fields there. If you are using a framework, these values may not be filled in but will show the defaults used by the framework. Save these for deploying to Cloudflare Workers. In the below image, the **Build Command** is `npm run build`, and the **Output Directory** is `dist`.

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

## Create a wrangler file

In the root of your project, create a `wrangler.jsonc` or `wrangler.toml` file (`wrangler.jsonc` is recommended). What goes in the file depends on what type of application you are deploying: static or single-page application.

For each case, be sure to update the `<your-project-name>` value with the name of your project and `<your-build-directory>` value with the build directory from Vercel. Be sure to set the right pathing, for example `./dist` if the build directory is `dist` or `./build` if your build directory is `build`.

For a **static site**, you will need to add the following to your wrangler file.

<WranglerConfig>

```jsonc
{
"name": "<your-project-name>",
"compatibility_date": "2025-04-23",
"assets": {
"directory": "<your-build-directory>",
}
}
```

</WranglerConfig>

For a **single page application**, you will need to add the following to your wrangler file, which includes the `not_found_handling` field.

<WranglerConfig>

```jsonc
{
"name": "<your-project-name>",
"compatibility_date": "2025-04-23",
"assets": {
"directory": "<your-build-directory>",
"not_found_handling": "single-page-application"
}
}
```

</WranglerConfig>

Some frameworks provide specific guides for migrating to Cloudflare Workers. Please refer to our [framework guides](/workers/frameworks/) for more information. If your framework includes a “Deploy an existing project on Workers” guide, follow it for detailed instructions.

## Create a new Workers project

Your application has the proper configuration to be built and deployed to Cloudflare Workers.

The [Connect a new Worker](/workers/ci-cd/builds/#connect-a-new-worker) guide will instruct you how to connect your GitHub project to Cloudflare Workers. In the configuration step, ensure your build command is the same as the command you found on Vercel. Also, the deploy command should be the default `npx wrangler deploy`.

## Add a custom domain

Workers Custom Domains only supports domains that are configured as zones on your account. A zone refers to a domain (such as example.com) that Cloudflare manages for you, including its DNS and traffic.

Follow these instructions for [adding a custom domain to your Workers project](/workers/configuration/routing/custom-domains/#add-a-custom-domain). You will also find additional information on creating a zone for your domain.

## Delete your Vercel app

Once your custom domain is set up and sending requests to Cloudflare Workers, you can safely delete your Vercel application.

## Troubleshooting

For additional migration instructions, review the [Cloudflare Pages to Workers migration guide](/workers/static-assets/migrate-from-pages/). While not Vercel specific, it does cover some additional steps that may be helpful.