Next.js Local Development Guide
Build full-stack React applications with Next.js, featuring App Router support for SSR/SSG, with localhost defaulting to localhost:3000.
Next.js is a full-stack framework based on React, offering App Router, server components, API routes, static exports, and edge deployment. It is widely used for production-level web applications and marketing sites.
Quick Start
npx create-next-app@latest my-app
cd my-app
npm run devDefault localhost Access
| Purpose | Address |
|---|---|
| Development Server | http://localhost:3000 |
To change the port: npm run dev -- -p 3001 or adjust in package.json.
Common Commands
| Command | Description |
|---|---|
npm run dev | Development mode (Turbopack optional) |
npm run build | Production build |
npm run start | Run production server |
npm run lint | ESLint check |
Routing and Rendering
- App Router (directory
app/): Recommended for new projects - Supports SSR, SSG, ISR, and mixing client components
- API and Server Actions can implement backend logic within the same repository
Deployment
Can be deployed to Vercel (official platform), Node servers, Docker, or generate a pure static site using output: 'export'.
Summary
Next.js local development defaults to http://localhost:3000, suitable for React full-stack and SEO-friendly modern web applications.