Next.js
Updated on October 27, 2026
Next.js
The presence of next.config.js or next.config.ts is enough to trigger Next.js detection.
What the auto builder runs
npm install
npm run build # next build
npm start # next start -p $PORT
Standalone mode
If your config enables output: 'standalone', the build artifact no longer contains the same files and next start fails. Adjust the start command:
node .next/standalone/server.js
See Custom start command to configure it.
Environment variables
# Available server-side only
DATABASE_URL=postgresql://user:pass@host:5432/db
API_SECRET=super-secret
# Exposed to the browser — prefix required
NEXT_PUBLIC_API_URL=https://api.mon-domaine.com
A variable without the
NEXT_PUBLIC_prefix stays invisible on the client, even after a rebuild. This is Next.js behavior, not a Webgune limitation.
API Routes and Server Actions
API routes (app/api/*) and Server Actions work as they are. They run in the same pod as the rest of the application, so a separate service is only needed if you want to isolate the load.