You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: remove Vercel mentions and improve deployment page (#78557)
This PR prunes references to Vercel in the documentation. Some of the
mentions were egregious and unneeded. Others were documenting specific
behavior for how Next.js runs on Vercel, which is better suited for the
Vercel documentation.
It also restructures our deployment documentation to remove any previous
bias toward Vercel. Rather than separating self-hosting (Node.js server,
Docker, static export) into its own section from managed platforms, it
now lists them all together. Vercel is listed under "Adapters",
alongside Netlify, Cloudflare, and AWS Amplify (in alphabetical order).
These are the companies we're working with on the [Deployment Adapters
API](#77740), who currently
maintain their own adapters and will eventually migrate to use this new
API. We've [started working
on](#78166) that API.
For different features in the docs, like ISR or Middleware, this PR also
adds a new feature matrix that shows the different deployment options
and whether this feature is supported. For example, features that
require using the server are not supported with static exports.
Additionally, when there is configuration possible (like changing the
caching behavior of ISR) we link back to our guide which explains these
options in detail.

This PR also updates the Middleware section of the self-hosting guide to
mention [Node.js runtime
support](https://nextjs.org/blog/next-15-2#nodejs-middleware-experimental).
I've also removed the "Managed Next.js (Vercel)" entry for the docs
sidebar, as it is not necessary and Vercel should not have additional
priority there over other providers.

Netlify has confirmed they're okay with the specific feature matrix link
included in the adapters section, and I did my best to include the
Cloudflare and Amplify versions based on their documentation. If any of
the providers want to see changes to those links, please let me know and
I'll open a PR.
Copy file name to clipboardExpand all lines: docs/01-app/01-getting-started/11-deploying.mdx
+56-19Lines changed: 56 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,40 +4,77 @@ nav_title: Deploying
4
4
description: Learn how to deploy your Next.js application.
5
5
---
6
6
7
-
Once you're ready to deploy your Next.js app, you can choose a [managed infrastructure provider](#managed-infrastructure-providers) or [self-host](#self-hosting) your application.
7
+
Next.js can be deployed as a Node.js server, Docker container, static export, or adapted to run on different platforms.
A managed platform is a practical option for deploying your Next.js app, as these providers take care of hosting, scaling, and server configuration for you.
16
+
## Node.js server
12
17
13
-
[Vercel](https://vercel.com/docs/frameworks/nextjs?utm_source=next-site&utm_medium=docs&utm_campaign=next-website), the creators and maintainers of Next.js, allows you to deploy your application with **full-feature support** and **zero-configuration**.
18
+
Next.js can be deployed to any provider that supports Node.js. Ensure your `package.json` has the `"build"` and `"start"` scripts:
14
19
15
-
- Learn more about [Next.js on Vercel](https://vercel.com/docs/frameworks/nextjs?utm_source=next-site&utm_medium=docs&utm_campaign=next-website).
16
-
- Try Next.js on Vercel by [deploying a template](https://vercel.com/templates/next.js?utm_source=next-site&utm_medium=docs&utm_campaign=next-website).
20
+
```json filename="package.json"
21
+
{
22
+
"scripts": {
23
+
"dev": "next dev",
24
+
"build": "next build",
25
+
"start": "next start"
26
+
}
27
+
}
28
+
```
17
29
18
-
We also have community maintained deployment templates for:
30
+
Then, run `npm run build` to build your application and `npm run start` to start the Node.js server. This server supports all Next.js features. If needed, you can also eject to a [custom server](/docs/app/guides/custom-server).
31
+
32
+
Node.js deployments support all Next.js features. Learn how to [configure them](/docs/app/guides/self-hosting) for your infrastructure.
Next.js can be deployed to any provider that supports [Docker](https://www.docker.com/) containers. This includes container orchestrators like Kubernetes or a cloud provider that runs Docker.
43
+
44
+
Docker deployments support all Next.js features. Learn how to [configure them](/docs/app/guides/self-hosting) for your infrastructure.
Please refer to each provider's documentation for information on supported Next.js features.
56
+
## Static export
27
57
28
-
## Self-Hosting
58
+
Next.js enables starting as a static site or [Single-Page Application (SPA)](/docs/app/guides/single-page-applications), then later optionally upgrading to use features that require a server.
29
59
30
-
Self-hosting may mean you're responsible for provisioning your own servers, managing containers, and scaling. You can self-host Next.js in three different ways:
60
+
Since Next.js supports [static exports](/docs/app/guides/static-exports), it can be deployed and hosted on any web server that can serve HTML/CSS/JS static assets. This includes tools like AWS S3, Nginx, or Apache.
Running as a [static export](/docs/app/guides/static-exports)**does not** support Next.js features that require a server. [Learn more](/docs/app/guides/static-exports#unsupported-features).
35
63
36
-
We have community maintained deployment examples with the following self-hosting providers:
> **Note:** We are working on a [Deployment Adapters API](https://github.com/vercel/next.js/discussions/77740) for all platforms to adopt. After completion, we will add documentation on how to write your own adapters.
Copy file name to clipboardExpand all lines: docs/01-app/02-guides/authentication.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -949,7 +949,7 @@ export async function createSession(id) {
949
949
950
950
> **Tips**:
951
951
>
952
-
> - For faster data retrieval, consider using a database like [Vercel Redis](https://vercel.com/docs/storage/vercel-kv). However, you can also keep the session data in your primary database, and combine data requests to reduce the number of queries.
952
+
> - For faster access, you may consider adding server caching for the lifetime of the session. You can also keep the session data in your primary database, and combine data requests to reduce the number of queries.
953
953
> - You may opt to use database sessions for more advanced use cases, such as keeping track of the last time a user logged in, or number of active devices, or give users the ability to log out of all devices.
954
954
955
955
After implementing session management, you'll need to add authorization logic to control what users can access and do within your application. Continue to the [Authorization](#authorization) section to learn more.
Copy file name to clipboardExpand all lines: docs/01-app/02-guides/custom-server.mdx
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,6 @@ Next.js includes its own server with `next start` by default. If you have an exi
11
11
> **Good to know**:
12
12
>
13
13
> - Before deciding to use a custom server, keep in mind that it should only be used when the integrated router of Next.js can't meet your app requirements. A custom server will remove important performance optimizations, like **[Automatic Static Optimization](/docs/pages/building-your-application/rendering/automatic-static-optimization).**
14
-
> - A custom server **cannot** be deployed on [Vercel](https://vercel.com/frameworks/nextjs).
15
14
> - When using standalone output mode, it does not trace custom server files. This mode outputs a separate minimal `server.js` file, instead. These cannot be used together.
16
15
17
16
Take a look at the [following example](https://github.com/vercel/next.js/tree/canary/examples/custom-server) of a custom server:
Copy file name to clipboardExpand all lines: docs/01-app/02-guides/environment-variables.mdx
-14Lines changed: 0 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,20 +230,6 @@ This allows you to use a singular Docker image that can be promoted through mult
230
230
- You can run code on server startup using the [`register` function](/docs/app/guides/instrumentation).
231
231
- We do not recommend using the [`runtimeConfig`](/docs/pages/api-reference/config/next-config-js/runtime-configuration) option, as this does not work with the standalone output mode. Instead, we recommend [incrementally adopting](/docs/app/guides/migrating/app-router-migration) the App Router if you need this feature.
232
232
233
-
## Environment Variables on Vercel
234
-
235
-
When deploying your Next.js application to [Vercel](https://vercel.com), Environment Variables can be configured [in the Project Settings](https://vercel.com/docs/projects/environment-variables?utm_medium=docs&utm_source=next-site&utm_campaign=next-website).
236
-
237
-
All types of Environment Variables should be configured there. Even Environment Variables used in Development – which can be [downloaded onto your local device](https://vercel.com/docs/concepts/projects/environment-variables#development-environment-variables?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) afterwards.
238
-
239
-
If you've configured [Development Environment Variables](https://vercel.com/docs/concepts/projects/environment-variables#development-environment-variables?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) you can pull them into a `.env.local` for usage on your local machine using the following command:
240
-
241
-
```bash filename="Terminal"
242
-
vercel env pull
243
-
```
244
-
245
-
> **Good to know**: When deploying your Next.js application to [Vercel](https://vercel.com), your environment variables in `.env*` files will not be made available to Edge Runtime, unless their name are prefixed with `NEXT_PUBLIC_`. We strongly recommend managing your environment variables in [Project Settings](https://vercel.com/docs/projects/environment-variables?utm_medium=docs&utm_source=next-site&utm_campaign=next-website) instead, from where all environment variables are available.
246
-
247
233
## Test Environment Variables
248
234
249
235
Apart from `development` and `production` environments, there is a 3rd option available: `test`. In the same way you can set defaults for development or production environments, you can do the same with a `.env.test` file for the `testing` environment (though this one is not as common as the previous two). Next.js will not load environment variables from `.env.development` or `.env.production` in the `testing` environment.
Copy file name to clipboardExpand all lines: docs/01-app/02-guides/multi-zones.mdx
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,8 +117,6 @@ The Next.js applications that make up the different zones can live in any reposi
117
117
118
118
Since the pages in different zones may be released at different times, feature flags can be useful for enabling or disabling features in unison across the different zones.
119
119
120
-
For [Next.js on Vercel](https://vercel.com?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) applications, you can use a [monorepo](https://vercel.com/blog/monorepos-are-changing-how-teams-build-software?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) to deploy all affected zones with a single `git push`.
Copy file name to clipboardExpand all lines: docs/01-app/02-guides/production-checklist.mdx
+1-17Lines changed: 1 addition & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: Recommendations to ensure the best performance and user experience
6
6
7
7
Before taking your Next.js application to production, there are some optimizations and patterns you should consider implementing for the best user experience, performance, and security.
8
8
9
-
This page provides best practices that you can use as a reference when [building your application](#during-development), [before going to production](#before-going-to-production), and [after deployment](#after-deployment) - as well as the [automatic Next.js optimizations](#automatic-optimizations) you should be aware of.
9
+
This page provides best practices that you can use as a reference when [building your application](#during-development) and [before going to production](#before-going-to-production), as well as the [automatic Next.js optimizations](#automatic-optimizations) you should be aware of.
10
10
11
11
## Automatic optimizations
12
12
@@ -148,19 +148,3 @@ Additionally, the following tools can help you understand the impact of adding n
148
148
-[Package Phobia](https://packagephobia.com/)
149
149
-[Bundle Phobia](https://bundlephobia.com/)
150
150
-[bundlejs](https://bundlejs.com/)
151
-
152
-
## After deployment
153
-
154
-
Depending on where you deploy your application, you might have access to additional tools and integrations to help you monitor and improve your application's performance.
155
-
156
-
For Vercel deployments, we recommend the following:
157
-
158
-
-**[Analytics](https://vercel.com/analytics?utm_source=next-site&utm_campaign=nextjs-docs&utm_medium=docs):** A built-in analytics dashboard to help you understand your application's traffic, including the number of unique visitors, page views, and more.
159
-
-**[Speed Insights](https://vercel.com/docs/speed-insights?utm_source=next-site&utm_campaign=nextjs-docs&utm_medium=docs):** Real-world performance insights based on visitor data, offering a practical view of how your website is performing in the field.
160
-
-**[Logging](https://vercel.com/docs/observability/runtime-logs?utm_source=next-site&utm_campaign=nextjs-docs&utm_medium=docs):** Runtime and Activity logs to help you debug issues and monitor your application in production. Alternatively, see the [integrations page](https://vercel.com/integrations?utm_source=next-site&utm_campaign=nextjs-docs&utm_medium=docs) for a list of third-party tools and services.
161
-
162
-
> **Good to know:**
163
-
>
164
-
> To get a comprehensive understanding of the best practices for production deployments on Vercel, including detailed strategies for improving website performance, refer to the [Vercel Production Checklist](https://vercel.com/docs/production-checklist?utm_source=next-site&utm_campaign=nextjs-docs&utm_medium=docs).
165
-
166
-
Following these recommendations will help you build a faster, more reliable, and secure application for your users.
0 commit comments