Deploy Next.js 15 to Cloudflare Workers: Complete Guide
Edge computing with serverless Next.js

At a Glance
Deploying Next.js 15 to Cloudflare Workers gives you edge computing with sub-50ms global latency and ~0ms cold starts via V8 isolates. OpenNext adapts Next.js for the Workers runtime with full SSR, API routes, and middleware support. This 8-step guide covers Wrangler configuration, Neon PostgreSQL HTTP driver, environment secrets, local dev testing, CI/CD with GitHub Actions, and production custom domains.
If you're running Next.js on Vercel and worried about costs as traffic grows — or simply want to experience true edge computing — Cloudflare Workers deserves serious consideration.
This guide walks you through deploying Next.js 15 on Cloudflare Workers using OpenNext, from initial setup to CI/CD in production.
Why Cloudflare Workers Over Vercel?
Cloudflare Workers runs your code across 300+ global edge locations — not from a single fixed region. Users in Hanoi, Berlin, or São Paulo all get responses from the nearest node.
| Cloudflare Workers | Vercel | |
|---|---|---|
| Latency | ~10-50ms (edge) | ~50-200ms (regional) |
| Cold start | ~0ms (V8 isolates) | 100-300ms (Node.js) |
| Free tier | 100K req/day | 100GB bandwidth/month |
| Pricing | $5/10M requests | $0.40/GB after free |
| Bundle limit | 10MB | 50MB |
- Zero cold starts: V8 isolates spin up nearly instantly, unlike Node.js containers
- Predictable costs: Pay per request rather than per bandwidth
- No vendor lock-in: Open-source adapter, standard Web APIs
- Great DX: Wrangler CLI for local dev and production deploys
When to choose Workers? When you need the lowest possible latency, have bursty traffic patterns, or want to escape Vercel's pricing model.
Prerequisites
- Node.js 20+
- Cloudflare account (free at cloudflare.com)
- Next.js 15 project
- (Optional) Neon PostgreSQL for SSR with dynamic data
Step 1: Install OpenNext and Wrangler
OpenNext is an open-source adapter that makes Next.js run on any serverless platform, including Cloudflare Workers.
npm install @opennextjs/cloudflare
npm install --save-dev wrangler
Authenticate with Cloudflare:
npx wrangler login
Step 2: Configure wrangler.jsonc
Create wrangler.jsonc at the project root:
{
"name": "my-nextjs-app"
Related Resources
Comments (0)
Loading comments...
Stay Updated
Get weekly insights on AI, automation, and shipping fast. Join 500+ founders.
Related Articles

API Proxy vs. Antigravity: The Legitimate Path and the Dangerous Shortcut
API proxies and Antigravity both promise cheaper AI — but the mechanics are completely different. One is an official reseller, the other borrows OAuth tokens in violation of ToS. In February 2026, Google acted. Here's the analysis you need before making a choice.

API Proxies & Aggregators: Use Premium AI at Optimal Cost
Managing a dozen separate API accounts is every AI builder's nightmare. Proxies and aggregators solve it cleanly: one key, one endpoint, every model — with a breakdown of OpenRouter, Z.AI, LiteLLM, and Helicone.

Mastering API Keys: Your Gateway to AI Power
API Keys are the bridge between your applications and AI power. This guide covers everything from how they work, to getting keys from OpenAI, Google Gemini, Anthropic Claude, and DeepSeek — and how to use them securely.