Skip to content
FossShelf
Home / Categories / For Web Developers

next.js

Full-stack React framework with server-side rendering and MIT license.

Replaces —

143.65K starsMITlast commit 14 Nov 2026
Screenshot of next.js

Who it's for

Frontend teams building content-heavy React sites

Teams with marketing sites, documentation portals, or editorial content that depends on search indexing can use Next.js to generate pages statically at build time while keeping dynamic sections server-rendered. The built-in image optimization and font pipeline reduces the Core Web Vitals work that typically follows a site launch.

Your site is a pure single-page app with no SEO requirements and no public-facing static routes. Plain Create React App or Vite is simpler and has less build configuration overhead.

Startups building full-stack SaaS products

Next.js API routes and Server Actions let a small team build the frontend and backend in one repository with one deployment unit. Server-side session handling, database queries via Server Actions, and a public marketing page with SSG can all coexist in the same Next.js project, keeping the initial infrastructure surface small.

Your backend has complex non-HTTP workloads such as queues, long-running jobs, or WebSocket servers that do not fit the request-response model. A dedicated backend service is a cleaner boundary for those workloads.

Teams self-hosting to control per-request platform costs

High-traffic applications on managed platforms like Vercel or Netlify accumulate per-request and bandwidth costs that scale directly with traffic. Self-hosting Next.js on a VPS or container cluster moves these to fixed infrastructure costs. The break-even point is roughly a few million page views per month depending on page complexity.

Your traffic is low and unpredictable, or you have no infrastructure operations capability. Managed platform costs at low traffic volumes are lower than the engineering time needed to set up and maintain a self-hosted Node.js deployment.

The problem

Building a React application that ranks in search results, loads fast, and handles both static and dynamic routes without a large infrastructure team requires assembling multiple tools that do not always work well together. Client-side rendering alone leaves pages invisible to search crawlers, while full server-side rendering on every request adds latency and server cost. Teams typically patch this with separate tools for static generation, server rendering, image optimization, and code splitting, each with its own configuration, upgrade cycle, and failure mode. The result is weeks of setup before meaningful product work starts. Small teams trying to catch up to the defaults that commercial platforms provide spend engineering time on framework glue instead of on their product.

How it works

Hybrid rendering per page (SSR, SSG, and CSR)

Each page in a Next.js app can independently use server-side rendering, static generation, or client-side rendering. A marketing page can be statically generated at build time for maximum CDN performance while a dashboard route renders server-side on each request. This flexibility means no architectural compromise between performance and data freshness.

File-based routing with nested layouts

Routes are defined by files in the app/ or pages/ directory, eliminating a separate router configuration. Nested layouts let shared UI elements like navigation bars and sidebars wrap multiple routes without re-rendering on navigation. The App Router introduced in Next.js 13 extends this with React Server Components support.

Built-in image and font optimization

The Image component automatically serves correctly sized images in modern formats (WebP, AVIF), adds lazy loading, and prevents layout shift. The next/font module loads web fonts with zero layout shift and no requests to external font servers at runtime, which improves both Core Web Vitals scores and user privacy.

API routes and server actions

API endpoints live in the same project as the frontend, defined as route.ts files in the App Router or pages/api/ files in the Pages Router. Server Actions (stable since Next.js 14) let components call server-side functions directly without a separate API endpoint, reducing round-trips for form submissions and mutations.

Rust-based compiler for fast builds

Next.js uses SWC, a Rust-based JavaScript and TypeScript compiler, to replace Babel for transpilation. SWC compiles roughly 17 times faster than Babel on large codebases, which reduces development hot-reload latency and production build times. TypeScript, JSX, and modern JavaScript syntax are all supported without extra configuration.

Features

  • Hybrid rendering per page (SSR, SSG, and CSR)
  • File-based routing with nested layouts
  • Built-in image and font optimization
  • API routes and server actions
  • Rust-based compiler for fast builds

How to install

Bootstrap a new Next.js project using the official setup CLI.

npx create-next-app@latest

Recommended for this setup

Strengths

  • MIT license with no usage restrictions: Next.js is MIT licensed, meaning it can be used commercially, modified, and distributed without royalty fees. Unlike proprietary frameworks with per-seat or per-deployment pricing, there are no licensing costs regardless of traffic volume or team size. You can fork, modify, and ship a custom build commercially with no restrictions.
  • Self-hosting on any Node.js infrastructure: A Next.js application can be deployed as a Node.js server, as a Docker container, to a static CDN export, or to any platform supporting Node 18+. Self-hosting eliminates the per-request and per-build costs that managed platforms add. Teams with data residency requirements can run entirely within their own infrastructure.
  • 142,000+ GitHub stars and active full-time maintenance: With over 142,000 stars and 33,000 forks on GitHub, Next.js has one of the largest communities in the React ecosystem. Vercel's core team maintains the framework full-time, with a new major version roughly annually and frequent patch releases. The last push to the repository was within the current week.
  • Incremental adoption path from Create React App: Next.js supports gradual migration from existing React applications. The Pages Router closely resembles Create React App's mental model, and the App Router can be adopted incrementally alongside it. Teams can port routes one at a time rather than doing a full rewrite, which lowers the migration risk for production apps.

Trade-offs

  • Some features are optimized for Vercel hosting first: Vercel, the company behind Next.js, optimizes certain features for its own cloud platform before documenting self-hosted equivalents. Edge Functions, Image Optimization CDN caching, and incremental static regeneration behave differently when self-hosted. Teams self-hosting need to implement caching layers and edge logic separately, which adds infrastructure work.
  • App Router has a steeper learning curve than Pages Router: The App Router introduced in Next.js 13 and stabilized in Next.js 14 uses React Server Components, a mental model that differs significantly from traditional client-side React. Teams upgrading from the Pages Router or learning Next.js for the first time encounter a larger conceptual surface area before they can be productive.
  • Server-rendered deployments require Node.js process management: Unlike static sites, a server-rendered Next.js app needs a running Node.js process, a process manager such as pm2 or systemd, and a reverse proxy. For teams that want zero-infrastructure hosting, managed platform options are simpler at the cost of a price premium. Pure static exports avoid this, but lose SSR and Server Actions.

Tech stack

Languages
JavaScript, TypeScript, Rust, MDX, CSS, Shell, Go, Python, SCSS, Dockerfile, C++, HTML, Batchfile, WebAssembly, Assembly, Sass, Pug, C, Pawn
Frameworks
Express, Next.js, React
Databases
—
Tooling
Node.js, Webpack

FAQ

Is Next.js free to use?

Yes. Next.js is MIT licensed and free to use, modify, and deploy commercially. There are no licensing fees regardless of team size or traffic volume. The Vercel hosting platform made by the same company has a paid tier, but it is separate from the framework. Self-hosting Next.js on your own infrastructure is fully supported and has no cost tied to the framework license.

Can I self-host Next.js without using Vercel?

Yes. Next.js can be deployed as a Node.js server on any host running Node 18+, as a Docker container, or exported as static HTML to any CDN. The next start command runs a production Node.js server. Most teams pair this with a reverse proxy such as nginx or Caddy and a process manager such as pm2 or systemd. The official deployment documentation at nextjs.org covers each method.

What is the difference between the Pages Router and the App Router in Next.js?

The Pages Router is the original routing system where each file in the pages/ directory becomes a route. The App Router, introduced in Next.js 13 and stable since Next.js 14, uses an app/ directory and adds React Server Components, nested layouts, streaming, and Server Actions. Both routers can coexist in the same project, so migration is incremental. New projects are recommended to start with the App Router.

Does Next.js support TypeScript out of the box?

Yes. TypeScript is supported without any separate configuration. Running create-next-app with the TypeScript flag generates a ready-to-use TypeScript project including type-safe API routes and Server Actions. The Next.js repository itself is written in TypeScript, and the framework ships its own type definitions so you get autocomplete and type checking immediately.

What license does Next.js use?

Next.js is MIT licensed. This means you can use it for any purpose including commercial projects, modify the source code, and distribute your changes without restrictions. The license does not require you to open-source your own application code. Attribution to the original project is not required in end products.

Similar tools

More in Web Developers