output (next.config)

Selects the build output mode: standalone server or static export.

Since standalone Next 12.1; export Next 13.3 (App Router) Spec ↗

Syntax

output: 'standalone' | 'export'

Parameters

NameTypeRequiredDescription
output 'standalone' | 'export' No `standalone` bundles a minimal server for containers; `export` produces a fully static site.

Returns

NextConfig — The build output target.

Examples

// Minimal self-contained server (ideal for Docker)
const nextConfig = {
  output: 'standalone',
}
module.exports = nextConfig
// Fully static HTML export (no Node server)
const nextConfig = {
  output: 'export',
  images: { unoptimized: true },
}
module.exports = nextConfig

Notes

`standalone` outputs `.next/standalone` with only the files needed to run (`node server.js`), shrinking Docker images. `export` emits static HTML/CSS/JS to `out/` and disables server features (no SSR, Route Handlers, dynamic functions, or default image optimization). Omit `output` for the normal hybrid build.

See also