Cloudflare DevelopersCD
Cloudflare Developers3w ago
6 replies
DevNick

How to deploy Next.js 15 on Workers with GitHub

🏗️Workers BuildsSolved
I wanna deploy my existing Next.js project on a worker.
I've done all the steps from the docs: https://developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/#deploy-an-existing-nextjs-project-on-workers

When I execute "pnpm run deploy", then I can deploy my project under "project.mysite.workers.dev", but how can I deploy a site on the prewie url "*-project.mysite.workers.dev"?
Even ChatGPT and Gemini can't give me an answer for this.

Alternative setup:
I create a new worker with GitHub I have to enter a build command and a deploy command (see screenshot - I blured my github name und project name, so it is emtpy in the screenshot).
What are the commands for Nextjs? I can't find anything in the docs.
When I use the default command I get a build error: [ERROR] The entry-point file at ".open-next/worker.js" was not found.
image.png
Cloudflare Docs
Create an Next.js application and deploy it to Cloudflare Workers with Workers Assets.
Next.js
Was this page helpful?