127.0.0.1:{port}, including WebSocket upgrades.
Prepare your app
Add standalone output tonext.config.js (or .ts/.mjs):
.next/standalone/server.js does not exist and PM2 has nothing to start.
Deploy steps
1
Fetch the code
git clone, or git fetch and reset to the branch.2
Install
The package manager comes from the lockfile:
pnpm-lock.yaml → pnpm, yarn.lock → Yarn (both through Corepack), otherwise npm ci.3
Build
npm run build (or the pnpm/Yarn equivalent) with the site’s Node version.4
Copy the standalone extras
public/, .next/static/, and .env are copied into .next/standalone/, as Next.js requires.5
Start
pm2 startOrReload ecosystem.config.js, then nginx is reloaded.