CodePark/ questions / Env & deployment
START PRACTICINGPRACTICE
Frontend question · Next.js › Env & deployment

What are the main ways to deploy a Next.js app, and what are the trade-offs?

There are three main ways: Vercel, your own Node.js server, or a static export. They trade ease of setup against control and features.

Vercel supports every feature with no configuration. That includes ISR (Incremental Static Regeneration: rebuilding static pages in the background), image optimization and edge middleware. The cost is platform lock-in and usage-based pricing.

A Node.js server (next build, then next start) also supports all features. It runs on any host or container.

  • With output: "standalone", the build copies only the files and dependencies it needs into .next/standalone. This makes Docker images much smaller.
  • Self-hosting means you manage scaling, the ISR cache across instances, and the CDN.

A static export with output: "export" produces plain HTML, CSS and JS for any static host. Features that need a server are not available:

  • Server Actions
  • request-time APIs like cookies()
  • ISR
  • default image optimization
  • Vercel supports all features with zero config.
  • A Node.js server supports all features, but you manage it yourself.
  • output: "standalone" produces small Docker images.
  • output: "export" produces static files with no server features.