Skip to content

Commit 27d2fa2

Browse files
authored
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. ![image](https://github.com/user-attachments/assets/6dff819b-c46f-4b1a-833c-0827c6ef8735) 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. ![image](https://github.com/user-attachments/assets/6d3291b8-f9bd-47e7-a21e-b843c0e1ef0c) 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.
1 parent df3ef84 commit 27d2fa2

25 files changed

Lines changed: 226 additions & 265 deletions

docs/01-app/01-getting-started/11-deploying.mdx

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,77 @@ nav_title: Deploying
44
description: Learn how to deploy your Next.js application.
55
---
66

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.
88

9-
## Managed infrastructure providers
9+
| Deployment Option | Feature Support |
10+
| -------------------------------- | ----------------- |
11+
| [Node.js server](#nodejs-server) | All |
12+
| [Docker container](#docker) | All |
13+
| [Static export](#static-export) | Limited |
14+
| [Adapters](#adapters) | Platform-specific |
1015

11-
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
1217

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:
1419

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+
```
1729

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.
33+
34+
### Templates
1935

20-
- [Deno](https://github.com/nextjs/deploy-deno)
2136
- [Flightcontrol](https://github.com/nextjs/deploy-flightcontrol)
2237
- [Railway](https://github.com/nextjs/deploy-railway)
38+
- [Replit](https://github.com/nextjs/deploy-replit)
39+
40+
## Docker
41+
42+
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.
45+
46+
### Templates
47+
48+
- [Docker](https://github.com/vercel/next.js/tree/canary/examples/with-docker)
49+
- [Docker Multi-Environment](https://github.com/vercel/next.js/tree/canary/examples/with-docker-multi-env)
50+
- [DigitalOcean](https://github.com/nextjs/deploy-digitalocean)
51+
- [Fly.io](https://github.com/nextjs/deploy-fly)
52+
- [Google Cloud Run](https://github.com/nextjs/deploy-google-cloud-run)
2353
- [Render](https://github.com/nextjs/deploy-render)
2454
- [SST](https://github.com/nextjs/deploy-sst)
2555

26-
Please refer to each provider's documentation for information on supported Next.js features.
56+
## Static export
2757

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.
2959

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.
3161

32-
- [A Node.js server](/docs/app/guides/self-hosting#nodejs-server)
33-
- [A Docker container](/docs/app/guides/self-hosting#docker-image)
34-
- [A static export](/docs/app/guides/self-hosting#static-html-export)
62+
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).
3563

36-
We have community maintained deployment examples with the following self-hosting providers:
64+
### Templates
3765

38-
- [DigitalOcean](https://github.com/nextjs/deploy-digitalocean)
39-
- [Fly.io](https://github.com/nextjs/deploy-fly)
4066
- [GitHub Pages](https://github.com/nextjs/deploy-github-pages)
41-
- [Google Cloud Run](https://github.com/nextjs/deploy-google-cloud-run)
4267

43-
> **🎥 Watch:** Learn more about self-hosting Next.js → [YouTube (45 minutes)](https://www.youtube.com/watch?v=sIVL4JMqRfc).
68+
## Adapters
69+
70+
Next.js can be adapted to run on different platforms to support their infrastructure capabilities.
71+
72+
Refer to each provider's documentation for information on supported Next.js features:
73+
74+
- [AWS Amplify](https://docs.amplify.aws/nextjs/start/quickstart/nextjs-app-router-client-components)
75+
- [Cloudflare](https://developers.cloudflare.com/pages/framework-guides/nextjs/ssr/supported-features)
76+
- [Deno Deploy](https://docs.deno.com/examples/next_tutorial)
77+
- [Netlify](https://docs.netlify.com/frameworks/next-js/overview/#next-js-support-on-netlify)
78+
- [Vercel](https://vercel.com/docs/frameworks/nextjs)
79+
80+
> **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.

docs/01-app/02-guides/authentication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ export async function createSession(id) {
949949
950950
> **Tips**:
951951
>
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.
953953
> - 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.
954954
955955
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.

docs/01-app/02-guides/custom-server.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Next.js includes its own server with `next start` by default. If you have an exi
1111
> **Good to know**:
1212
>
1313
> - 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).
1514
> - 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.
1615
1716
Take a look at the [following example](https://github.com/vercel/next.js/tree/canary/examples/custom-server) of a custom server:

docs/01-app/02-guides/environment-variables.mdx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,6 @@ This allows you to use a singular Docker image that can be promoted through mult
230230
- You can run code on server startup using the [`register` function](/docs/app/guides/instrumentation).
231231
- 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.
232232

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-
247233
## Test Environment Variables
248234

249235
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.

docs/01-app/02-guides/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ description: Learn how to implement common UI patterns and use cases using Next.
5757

5858
### Deployment
5959

60-
- [Creating a Dockerfile](/docs/app/guides/self-hosting#docker-image)
60+
- [Creating a Dockerfile](/docs/app/getting-started/deploying#docker)
6161
- [Creating a static export (SPA)](/docs/app/guides/static-exports)
6262
- [Configuring caching when self-hosting](/docs/app/guides/self-hosting#configuring-caching)
6363
- [Configuring Image Optimization when self-hosting](/docs/app/guides/self-hosting#image-optimization)

docs/01-app/02-guides/multi-zones.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ The Next.js applications that make up the different zones can live in any reposi
117117

118118
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.
119119

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`.
121-
122120
<AppOnly>
123121

124122
## Server Actions

docs/01-app/02-guides/production-checklist.mdx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Recommendations to ensure the best performance and user experience
66

77
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.
88

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.
1010

1111
## Automatic optimizations
1212

@@ -148,19 +148,3 @@ Additionally, the following tools can help you understand the impact of adding n
148148
- [Package Phobia](https://packagephobia.com/)
149149
- [Bundle Phobia](https://bundlephobia.com/)
150150
- [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

Comments
 (0)