Cloudflare Monorepo
Learn how to deploy the Cloudflare Monorepo template to Cloudflare.
This feature is only included for the following templates:
Deploying to Cloudflare
To deploy your project to Cloudflare, you will need to have a Cloudflare account. If you do not have a Cloudflare account, you can sign up for one here on Cloudflare.
Update app configs
You will need to update the global config files located in the /packages/configs directory. You can view all of the available config files here on GitHub.
Set up your services
Follow the instructions in the AI, Auth, D1 database, Emails, Payments, and Real-time documentations to set up services that you will need for your project.
Deploy the docs app
Follow the instructions in the Setup and Deployment sections of the README of the docs app at /apps/docs/README.md to deploy the docs app to Cloudflare.
Once you have deployed the docs app, note origin URL that you have deployed to. If you wish to use a custom domain, you can do so by going to the settings page of the Cloudflare Worker dashboard. You will need this origin URL for connecting the Next.js app zones.
Deploy the marketing app
Follow the instructions in the Setup and Deployment sections of the README of the marketing app at /apps/marketing/README.md to deploy the marketing app to Cloudflare.
Once you have deployed the marketing app, note origin URL that you have deployed to. If you wish to use a custom domain, you can do so by going to the settings page of the Cloudflare Worker dashboard. You will need this origin URL for connecting the Next.js app zones.
Deploy the web app
Follow the instructions in the Setup and Deployment sections of the README of the web app at /apps/web/README.md to deploy the web app to Cloudflare.
When deploying the web app to Cloudflare, you will also need to update the build environment variables NEXT_PUBLIC_ZONE_DOCS_URL and NEXT_PUBLIC_ZONE_MARKETING_URL to the origin URLs of the docs and marketing apps that you deployed earlier.