Skip to main content
Create a new Next.js app and run it locally.

System requirements

Before you begin, make sure your development environment meets the following requirements:
  • Node.js version 20.9 or later — nodejs.org
  • Operating system: macOS, Windows (including WSL), or Linux.

Supported browsers

Next.js supports modern browsers with zero configuration:

Quick start

Then visit http://localhost:3000.
--yes skips the interactive prompts, using saved preferences or defaults. The default setup enables TypeScript, Tailwind CSS, ESLint, App Router, and Turbopack, with import alias @/*, and includes AGENTS.md (with a CLAUDE.md symlink) to guide coding agents to write up-to-date Next.js code.

Create with the CLI

To create a project interactively, run create-next-app without --yes:
On installation, you’ll see the following prompts:
If you choose customize settings, you’ll be asked:

CLI flags

You can pass flags to skip prompts entirely:

Manual installation

If you prefer to set things up yourself, install the required packages:
The App Router uses React canary releases built-in, which include all stable React 19 changes plus newer features being validated in frameworks. You should still declare react and react-dom in package.json for tooling and ecosystem compatibility.
Add the following scripts to your package.json:
Turbopack is the default bundler. To use Webpack instead, run next dev --webpack or next build --webpack.

Create the app directory

Next.js uses file-system routing — routes are determined by how you structure your files.
1

Create the root layout

Create an app/ folder, then add app/layout.tsx inside it. This is the root layout and is required. It must contain <html> and <body> tags.
2

Create the home page

Add app/page.tsx with some initial content:
Both layout.tsx and page.tsx are rendered when a user visits /.
3

Create the public folder (optional)

Create a public/ folder at the root of your project to store static assets such as images and fonts. Files inside public can be referenced from your code starting from the base URL (/).

Set up TypeScript

Minimum TypeScript version: v5.1.0
Next.js has built-in TypeScript support. To add TypeScript to an existing project, rename a file to .ts or .tsx and run next dev. Next.js will automatically install the necessary dependencies and add a tsconfig.json file with the recommended configuration.

IDE plugin

Next.js includes a custom TypeScript plugin and type checker that VSCode and other editors can use for advanced type-checking and auto-completion. To enable the plugin in VS Code:
1

Open the command palette

Press Ctrl/⌘ + Shift + P.
2

Select the TypeScript version

Search for TypeScript: Select TypeScript Version and select Use Workspace Version.

Set up linting

Next.js supports linting with ESLint or Biome.
ESLint provides comprehensive rules. Add lint scripts to package.json:
Create an explicit config file (the recommended format is eslint.config.mjs). See the ESLint config reference for a recommended setup.
Starting with Next.js 16, next build no longer runs the linter automatically. Run your linter through npm scripts instead.
If your project previously used next lint, migrate to the ESLint CLI with the codemod:

Set up absolute imports and module path aliases

Next.js has built-in support for the paths and baseUrl options in tsconfig.json and jsconfig.json. These let you alias project directories to absolute paths, making imports cleaner.
To configure absolute imports, add baseUrl to your tsconfig.json:
To configure path aliases, add a paths entry:
Each path in paths is relative to the baseUrl location.