The fastest way to start a Next.js project is create-next-app, the official scaffolding CLI. It generates a ready-to-run app with TypeScript, ESLint, Tailwind CSS, the App Router, and Turbopack already configured, so the only thing left is writing your first page.
Run this in the folder where you want the project:
npx create-next-app@latest my-appReplace my-app with your project name. The CLI asks a few questions, creates a new folder with that name, and installs the dependencies for you.
The prompts you will see
After the project name, create-next-app stops to ask how the project should be configured. The first question is whether to use the recommended defaults or to customize the setup.
What is your project named? my-app
Would you like to use the recommended Next.js defaults?
Yes, use recommended defaults - TypeScript, ESLint, Tailwind CSS, App Router, AGENTS.md
No, reuse previous settings
No, customize settings - Choose your own preferencesThe recommended setup enables TypeScript, Tailwind CSS, ESLint, the App Router, and Turbopack. It also sets an import alias of @/* and adds an AGENTS.md file that helps coding agents write current Next.js code. Accept the defaults unless you have a specific reason to change one, because each is the value the Next.js team ships with.
If you choose customize settings, you can pick TypeScript or plain JavaScript, choose ESLint, Biome, or no linter, enable the React Compiler, add Tailwind CSS, use a src directory, and adjust the import alias. Each choice only affects the generated files, so you can change any of them later.
Skip the prompts with --yes
For scripts and tutorials, pass the --yes flag to accept saved preferences or the defaults without prompts.
npx create-next-app@latest my-app --yesThis is the version you see in automated guides. Always include a project name so the generated folder is predictable.
Run the app
Move into the new folder and start the dev server:
cd my-app
npm run devOpen http://localhost:3000. The server starts with Turbopack, the default bundler, and shows the generated landing page with links to the documentation and a starter example. Edit app/page.tsx and save to see the page update immediately without a manual refresh.
Common problems
- Node version. create-next-app needs Node.js 20.9 or newer, so check with node --version first. An old Node install fails during the dependency step.
- Wrong folder. Always cd into the new folder before running the dev server, or npm will not find the project scripts.
- Port in use. If port 3000 is taken, the server picks the next free port and prints the new address in the terminal.
Once the app runs, read Next.js Project Structure Explained to understand the generated folders, or learn the flags in Running the Next.js Dev Server.
Rune AI
Key Insights
- create-next-app scaffolds a Next.js project in one command.
- Recommended defaults include TypeScript, ESLint, Tailwind CSS, the App Router, and Turbopack.
- The --yes flag skips prompts using saved preferences or defaults.
- Node.js 20.9 or newer is required.
- Run the dev server inside the new folder with npm run dev.
Frequently Asked Questions
What Node.js version do I need?
Can I create the app without answering prompts?
Which package manager should I use?
Conclusion
create-next-app is the fastest way to start a Next.js project. Run it with a project name, accept the recommended defaults or customize them, then start the dev server and open localhost:3000.
More in this topic
`generateMetadata` Explained with Real Examples
What generateMetadata does, when it runs, and how to use it for real routes: awaited params, deduplicated data fetching, extending parent metadata, and returning a 404 from metadata.
Canonical URLs in Next.js: `metadataBase`, `alternates.canonical`, and Dynamic Pages
How canonical URLs work in the Next.js App Router: setting metadataBase once, writing alternates.canonical per route, handling dynamic segments, and what happens when the base URL is missing.
Open Graph and Twitter Card Metadata in Next.js
How to write Open Graph and Twitter card metadata in the Next.js App Router: the openGraph and twitter fields, automatic card defaults, article tags, and image merge rules.