Next.js Installation guides developers through scaffolding a production-ready application environment using modern CLI tools. Installing Next.js requires Node.js version 18.17 or higher installed on your computer.
The official create-next-app command initializes everything automatically, including TypeScript setup, Tailwind CSS styling, and ESLint linting rules.
Open your command line interface and execute the installation wizard:
npx create-next-app@latest
The CLI wizard asks setup questions for your project configuration:
✔ What is your project named? ... my-app
✔ Would you like to use TypeScript? ... Yes
✔ Would you like to use ESLint? ... Yes
✔ Would you like to use Tailwind CSS? ... Yes
✔ Would you like to use `src/` directory? ... No
✔ Would you like to use App Router? (recommended) ... Yes
✔ Would you like to customize the default import alias (@/*)? ... Yes
After installation completes, navigate into the directory to view the project layout:
my-app/
├── app/ # App Router directory
│ ├── favicon.ico # Website icon
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout wrapper
│ └── page.tsx # Homepage view component
├── node_modules/ # Installed dependencies
├── public/ # Static assets (images, icons)
├── .eslintrc.json # ESLint config
├── next.config.ts # Next.js configuration
├── package.json # Dependency scripts
└── tsconfig.json # TypeScript configuration
Start the interactive local development server with instant hot-reloading:
cd my-app
npm run dev
Open http://localhost:3000 in your web browser to see your live application.
// app/page.tsx
export default function Page() {
return (
<div className="flex flex-col items-center justify-center min-h-screen">
<h1 className="text-4xl font-bold">Installation Complete!</h1>
<p className="mt-2 text-lg text-gray-600">Your Next.js environment is ready.</p>
</div>
);
}
@/components/Header instead of relative paths ../../components/Header.Installing Next.js takes less than two minutes with create-next-app. Running the development server allows immediate feedback as you build out pages and server components.
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With