See what shipped at NTL DEPLOY.Try the new AI workflow →
Next.js on Netlify
Netlify supports all major Next.js features with zero configuration.
Under the hood, this is powered by our OpenNext adapter, which we maintain in the open and test alongside every stable release of Next.js.
The information on this page is applies to Next.js version 13.5 and above. For earlier Next.js versions, visit thelegacy runtime page.
Get started
Section titled “Get started”If you have an existing Next.js app you’d like to deploy, push your code to a Git provider and connect it through the Netlify Dashboard.
When starting from scratch, the fastest way is to deploy ourNext.js platform starter template to your Netlify account.
Key features
Section titled “Key features”App Router: Netlify fully supports the Next.js App Router, which supports more powerful nested layouts and React’s latest features, such as Server Components and Streaming.
Automatic fine-grained caching: the adapter uses ourfine-grained caching primitives to support the Next.js Full Route Cache and Data Cache. This means that static page responses are automatically cached at the edge and can be revalidated by path or by tag.
On-demand and time-based revalidation: both the App Router and Pages Router support on-demand and time-based revalidation, allowing you to revalidate and regenerate content at any time after a deploy.
Image optimization: the
next/image
component usesNetlify Image CDN by default, to ensure your images are optimized and served in the most efficient format.
Next.js support on Netlify
Section titled “Next.js support on Netlify”The following tables show you a comprehensive mapping of critical Next.js features and how Netlify supports them. Netlify supports new Next.js features as early as possible, but experimental features may not be fully stable yet.
Next.js Feature | Support | Notes |
---|---|---|
App Router | ✓ | Full Support |
Server-Side Rendering (SSR) | ✓ | Full Support |
Incremental Static Regeneration (ISR) | ✓ | Full Support |
Static Site Generation (SSG) | ✓ | Full Support. Pre-rendered pages are stored in Next.js route cache, and fetched from the route cache by a function invocation when first accessed after a deploy. |
React Server Components | ✓ | Full Support |
Server Actions | ✓ | Full Support |
Response Streaming | ✓ | Full Support |
asynchronous work withnext/after | ✓ | Full Support. Learn more in theAPI reference. |
Middleware | ✓ | Full support. Implemented automatically viaEdge Functions. Learn aboutlimitations. |
Route Handlers | ✓ | Full Support |
Image Optimization | ✓ | Full Support |
Redirects and rewrites | ✓ | Full Support |
Internationalization | ✓ | Full Support |
Draft Mode | ✓ | Full Support |
Experimental framework features | Partial Support | Partial Prerendering (PPR): supported. Use cache: supported. Node.js in Middleware: not supported yet. |
How Netlify runs your Next.js app
Section titled “How Netlify runs your Next.js app”Netlify automatically configures your site to support modern Next.js features out of the box. This is powered by our OpenNext adapter, an open source project that provisions the correct infrastructure for each part of your Next.js application without custom configuration.
We recommend that you don’t pin the adapter version. We actively maintain the adapter to support all Next.js versions starting from version 13.5 and, if you don’t pin the version, we will automatically update the adapter to the latest version on each site build for you.
What the adapter does
Section titled “What the adapter does”When you deploy a Next.js project on Netlify, the adapter automatically:
Provisions Netlify Functions for:
- Server-Side Rendering (SSR)
- Incremental Static Regeneration (ISR)
- Partial Prerendering (PPR)
- API routes
- Server Actions
Provisions Netlify Edge Functions for:
- Next.js Middleware
- Geolocation- and routing-based personalization
- Fast execution at the network edge
Configures caching and revalidation with:
- Next.js Full Route Cache and Data Cache
- Tag-based or path-based revalidation
Enables image optimization with the Netlify Image CDN and
next/image
Compatibility and testing
Section titled “Compatibility and testing”We verify compatibility with every new stable version of Next.js. Each release of the adapter is tested using:
•Our official end-to-end test suite•Additional integration tests with Netlify’s platform•Real-world deploys using a public starter template
Reverting to an older adapter version
Section titled “Reverting to an older adapter version”We recommend that you don’t pin the adapter version. We actively maintain the adapter to support all Next.js versions starting from version 13.5 and, if you don’t pin the version, we will automatically use the latest version on each site build for you.
To pin a specific version of the adapter:
Install the version you want in
package.json
:Terminal window npminstall@netlify/plugin-nextjs@<version>Add the plugin to your
netlify.toml
:[[plugins]]package ="@netlify/plugin-nextjs"
You’ll be opting out of automatic updates and newer architecture improvements maintained through OpenNext. To opt back in, remove@netlify/plugin-nextjs
from yourpackage.json
.
Limitations
Section titled “Limitations”Open issues are documented in theend-to-end test report page.
- Edge Runtime Location: SSR pages using the edge runtime run in your functions region rather than true edge locations
- Rewrite Limitations: Rewrites in Next.js configuration can’t point to static files in the public directory.
- Middleware Execution Order: Headers and redirects are evaluated after middleware, differing from stand-alone Next.js behavior.
- Node.js Middleware:
- C++ Addons are not supported,
- Filesystem is not supported.
- Forms Integration: Netlify Forms requires a specific workaround when used with Next.js applications.Learn more.
More resources
Section titled “More resources”Did you find this doc useful?
Your feedback helps us improve our docs.