NextjsSetup & Installation

Setup & Installation

Every Next.js project starts from the same place: the official create-next-app command-line tool. It scaffolds a complete, working project — configuration files, a starter page, and all the dependencies you need — in a single command, so you never have to assemble a build setup by hand.

Requirements

You need Node.js 18.18 or later installed (Next.js 15 raises this to Node.js 18.18+ / 20+; always check the version noted in the docs for the release you are installing). You can confirm your version with:

Bash
node -v
Creating a new project

Bash
npx create-next-app@latest

Running this command downloads and runs the latest version of the scaffolding tool without installing it globally. It then walks you through an interactive setup.

The setup prompts

Prompt

What it controls

Project name

The folder name that will be created and used as the package.json name.

TypeScript?

Whether the project is scaffolded with .tsx/.ts files and a tsconfig.json.

ESLint?

Whether ESLint (with the next/core-web-vitals config) is set up for you.

Tailwind CSS?

Whether Tailwind is installed and pre-configured for styling.

src/ directory?

Whether application code lives under src/app instead of a top-level app/.

App Router?

Whether the project uses the modern app/ directory (recommended) or the legacy pages/ directory.

Import alias

Whether to configure a @/*-style path alias instead of relative imports.

Tip
For a new project, choose **TypeScript: Yes** and **App Router: Yes**. TypeScript catches mistakes before they reach the browser, and the App Router is the modern, actively-developed routing system that this entire tutorial series is built around.
Running the app

Once scaffolding finishes, move into the project folder and start the development server.

Bash
cd my-app
npm run dev
  ▲ Next.js 15.0.0
  - Local:        http://localhost:3000
  - Environments: .env

 ✓ Ready in 1204ms

Open http://localhost:3000 in a browser and you will see the default starter page. Any edit you make to app/page.tsx shows up immediately, without a manual refresh, thanks to Fast Refresh.

What gets installed
  • next, react, and react-dom as the core runtime dependencies.

  • typescript, @types/react, and @types/node if you chose TypeScript.

  • eslint and eslint-config-next if you chose ESLint.

  • tailwindcss and its PostCSS setup if you chose Tailwind CSS.

Note
You do not have to use `create-next-app`. You can add `next`, `react`, and `react-dom` to an existing project manually — but the CLI saves you from hand-writing configuration that is easy to get subtly wrong.