Skip to main content
doc0blade47/next.jsdocumentation home
Sign in

Installation and Setup

Last updated Oct 12, 2026

Overview

Introduction to Setup

Getting started with Next.js is quick and straightforward. You can instantly create and initialize a new Next.js project on your machine using the official setup tool. This tool guides you through project configuration, automatically sets up your file structure, and installs all necessary dependencies so you can start building your web application right away.

System Requirements and Prerequisites

Before you create a new project, make sure your machine meets the basic software requirements:

  • Node.js: Version 20.9.0 or higher is required.

Note

You can verify your installed Node.js version by running node -v in your terminal.


Creating a New Project

The easiest way to set up a new Next.js application is to run the interactive creation tool. Open your terminal and run the following command:

npx create-next-app@latest

When you run the command, the tool will ask you a series of interactive questions to customize your new project, such as your preferred project name, styling options, and language preferences.


Customizing Your Setup with Command-Line Options

Configuration Flags Reference

Project Configuration Flags

FlagDescription
--ts, --typescriptInitialize as a TypeScript project (default).
--js, --javascriptInitialize as a JavaScript project.
--tailwindInitialize with Tailwind CSS configuration (default).
--react-compilerInitialize with React Compiler enabled.
--cache-componentsInitialize with Cache Components enabled.
--eslintInitialize with ESLint configuration.
--biomeInitialize with Biome configuration.
--appInitialize as an App Router project.
--src-dirInitialize inside a src/ directory.
--rspackEnable Rspack as the bundler.
--import-alias <prefix/*>Specify import alias to use (default "@/*").
--apiInitialize a headless API using the App Router.
--emptyInitialize an empty project.
--agents-mdInclude AGENTS.md to guide coding agents (default).
--agent-feedbackPrepare anonymized feedback for your review.
--no-agent-feedbackDo not prepare anonymized feedback.
--disable-gitSkip initializing a Git repository.
--skip-installExplicitly tell the CLI to skip installing packages.
--reset, --reset-preferencesReset saved preferences for the setup tool.
--yesUse saved preferences or defaults for unprovided options.
-e, --example <name|url>Bootstrap the app using an official example or public GitHub URL.
--example-path <path>Specify the path to the example in a GitHub URL if needed.

Sources: packages/create-next-app/index.ts

Package Manager Flags

You can explicitly choose which package manager you want the tool to use for installing dependencies:

FlagPackage Manager
--use-npmnpm
--use-pnpmpnpm
--use-yarnYarn
--use-bunBun

Sources: packages/create-next-app/index.ts

Tip

If you don't specify a package manager flag, the tool will automatically detect which package manager you are currently using.


Starting Your Development Server

Once your project has been successfully created and initialized, navigate into your new project folder and start the local development server:

cd your-project-name
npm run dev

Open your web browser and visit http://localhost:3000 to see your running application.

Was this page helpful?