How to install Next.js
By Flavio Copes
Learn how to install Next.js 16 with create-next-app, or manually with npm i next react react-dom, then start the App Router dev server.
To install Next.js, you need to have Node.js installed.
Next.js latest stable is 16.3.4. It needs Node 20.9.0 or newer. Check with node -v in your terminal, and compare it to the latest LTS version listed on https://nodejs.org/.
After you install Node.js, you will have the npm command available into your command line.
If you have any trouble at this stage, I recommend the following tutorials I wrote for you:
- how to install Node.js
- how to update Node.js
- An introduction to the npm package manager
- Unix Shells Tutorial
- How to use the macOS terminal
- The Bash Shell
The recommended way: create-next-app
Official Next.js docs start new apps with:
npx create-next-app@latest my-app --yes
cd my-app
npm run dev
The --yes flag accepts the defaults. That setup includes TypeScript, Tailwind CSS, ESLint, the App Router, Turbopack, and an import alias.
Open http://localhost:3000 in your browser to see the app.
The screenshots later in this post are from an older Pages Router install. The commands above are the current path.
Manual install
If you want to wire the packages yourself, create a folder and initialize it:
mkdir my-app
cd my-app
npm init -y
Then install Next.js, React, and React DOM:
npm i next@latest react@latest react-dom@latest
Open package.json and set the scripts to:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}
Next.js uses the App Router by default. Create app/page.js:
export default function Home() {
return (
<div>
<h1>Home page</h1>
</div>
)
}
Then start the development server:
npm run dev
This makes the app available on port 3000, on localhost.

Open http://localhost:3000 in your browser to see it.

Those screenshots show an older Next 9 / Pages Router project. The flow is the same idea: install, add a page, run npm run dev.
Want me to talk about your product? You can sponsor this site.
Related posts about next: