Guides
Build your Next.js App
Build and run your Next.js application in development and production environments.
Build your Next.js App
This guide explains how to build and run your Next.js application in both development and production environments.
Development Mode
For development with hot-reloading capabilities, execute:
npm run devThis enables immediate reflection of code changes in the browser without requiring full page reloads.
Production Mode
Production deployment involves two sequential steps.
Step 1: Create the Build
Generate an optimized production build using:
npm run buildThis creates an optimized, static version stored in the .next folder.
Step 2: Run the Build
Start the server to serve your optimized application:
npm startFollowing these steps ensures efficient production deployment. For additional deployment information, consult the Next.js production builds documentation.