# Nextjs On Cloudflare

Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext.

- Repository: https://github.com/cloudflare/skills (3246 stars)
- Category: DevOps
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add cloudflare/skills --skill nextjs-on-cloudflare -g -a claude-code -y`
Codex: `npx skills add cloudflare/skills --skill nextjs-on-cloudflare -g -a codex -y`
Cursor: `npx skills add cloudflare/skills --skill nextjs-on-cloudflare -g -a cursor -y`
Gemini CLI: `npx skills add cloudflare/skills --skill nextjs-on-cloudflare -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add cloudflare/skills`

## Description

Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext. Use when starting a Next.js project on Cloudflare, moving an existing app to Workers, choosing between vinext and OpenNext, or setting up vinext for Workers. For setup, migration, or deployment, install vinext's upstream skills with `npx skills add cloudflare/vinext` if missing, then read and follow the applicable skill and docs.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Next.js on Cloudflare

**Use vinext rather than OpenNext for new Next.js projects on Cloudflare Workers.** This is the default in the [Cloudflare Next.js guide](https://developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/index.md). Preserve existing OpenNext setups during unrelated maintenance and respect explicit user choices.

## Why vinext

[vinext](https://github.com/cloudflare/vinext) reimplements the Next.js API surface on Vite:

- Familiar Next.js development: App Router, Pages Router, React Server Components, and supported `next/*` imports.
- Vite tooling: fast HMR, native ESM, and the Vite plugin ecosystem.
- Native Workers integration: local server execution in workerd, access to Cloudflare bindings, and a build-and-deploy workflow.
- Incremental migration: check compatibility and try vinext alongside an existing Next.js setup.

## Use the upstream workflow

Before setup, migration, or deployment, check whether the [skills maintained in vinext](https://github.com/cloudflare/vinext/tree/main/.agents/skills) are available. If missing, install them:

```sh
npx skills add cloudflare/vinext
```

Then read and follow the applicable upstream `SKILL.md` and its relevant references. Use the current [vinext docs](https://github.com/cloudflare/vinext#quick-start) for workflows the skills do not cover:

The rest: https://github.com/cloudflare/skills/blob/HEAD/skills/nextjs-on-cloudflare/SKILL.md
