deploy.ccSelf-hosting deploy handbook
deploy.cc / Guides / Next.js

Next.js deploy guide

Run Next.js as a Node.js server when you need SSR / API routes / ISR, or export static files with output: 'export'.

Build
npm run build
Output
.next(SSR)/ out(静态导出 output: 'export')
Official docs
Next.js Deploying · Static Exports · OpenNext for Cloudflare

How to deploy

  1. Static: set output: 'export', run npm run build and upload out/.
  2. Node.js / VPS: npm run build then npm run start (port 3000), keep it alive with PM2 or systemd behind Nginx.
  3. Docker: see the official Docker guidance; output: 'standalone' keeps images small.

Per platform

PlatformNotes
VercelNative support; import the repo.
CloudflarePages for static export; Workers + OpenNext for SSR.
VPSNode.js + PM2/systemd + Nginx, or Docker.

Notes

Generate a config