How to Set Up a New Next.js Project and Install Tailwind CSS (2025 Guide)

Deepak ModiDeepak Modi
3 min read

Next.js is a powerful React framework built by Vercel that makes it easy to create production-grade web applications. It extends React with powerful features like:

  • βœ… Server-Side Rendering (SSR)

  • ⚑ Static Site Generation (SSG)

  • πŸ”€ Hybrid Rendering (both SSR + SSG)

  • πŸ”§ Built-in API routes

  • 🌐 SEO optimization

  • πŸ› οΈ Image optimization, routing, and more!

When Next.js is paired with Tailwind CSS, it allows you to build sleek, fast, and scalable modern web applications.

In this guide, we’ll walk you through the process of setting up a brand new Next.js project (using the latest v15+) and installing Tailwind CSS v4.1β€”step by step using the latest create-next-app prompts.


βœ… Prerequisites

Make sure you have these installed:

  • Node.js (v18 or later recommended)

  • npm (comes with Node)

  • VS Code or your favorite code editor


βš™οΈ Step 1: Create a New Next.js App

Open your terminal and run:

npx create-next-app@latest

You’ll be prompted with several options to customize your setup:

βœ” What is your project named? … my-app
βœ” Would you like to use TypeScript? … Yes
βœ” Would you like to use ESLint? … Yes
βœ” Would you like to use Tailwind CSS? … Yes
βœ” Would you like your code inside a `src/` directory? … Yes
βœ” Would you like to use App Router? (recommended) … Yes
βœ” Would you like to use Turbopack for `next dev`? … Yes
βœ” Would you like to customize the import alias (`@/*` by default)? … No

πŸ’‘ Pro Tip: Select β€œYes” for Tailwind CSS and App Router to unlock modern Next.js power.

Once complete, it sets up the entire project with Tailwind, ESLint, TypeScript, and even a Git repo. Here’s what the terminal will show:

Success! Created my-app at /your/path/to/my-app

Alternatively, you can quickly scaffold a new Next.js project with Tailwind, TypeScript, ESLint, App Router, and more using this one-liner: npx create-next-app@latest my-app --typescript --eslint --tailwind --src-dir --app --import-alias "@/*"

πŸ’‘ This sets everything up automatically without the need to answer prompts manually!

Once the setup is complete, navigate into your project folder and open it in VS Code:

cd my-app
code .

🧡 Step 2: Run the Dev Server

Spin up your dev server with:

npm run dev

If you chose Turbopack, you'll see a blazing-fast startup and your app will be live at:

http://localhost:3000

πŸŽ‰ You've successfully created a Next.js 15.2.4 project with Tailwind CSS, TypeScript, ESLint, App Router, and Turbopack β€” fully set up and running on http://localhost:3000.


🎨 Step 3: Start Using Tailwind CSS

Since you selected Tailwind CSS in the setup, it’s already configured! You can now start styling using utility classes like this:

export default function Home() {
  return (
    <main className="flex min-h-screen items-center justify-center bg-gray-100">
      <h1 className="text-4xl font-bold text-blue-600">Hello Tailwind + Next.js!</h1>
    </main>
  );
}

The global styles and Tailwind config are already placed inside the src directory:

  • src/app/globals.css

  • tailwind.config.ts

  • postcss.config.mjs


πŸ§ͺ Bonus: Folder Structure

Here’s a quick peek at the auto-generated folder structure:

my-app/
β”œβ”€ src/
β”‚  β”œβ”€ app/
β”‚  β”‚  β”œβ”€ page.tsx
β”‚  β”‚  β”œβ”€ layout.tsx
β”‚  β”œβ”€ styles/
β”‚  β”‚  β”œβ”€ globals.css
β”œβ”€ tailwind.config.ts
β”œβ”€ postcss.config.mjs
β”œβ”€ tsconfig.json

πŸŽ‰ Conclusion

That’s it! You now have a fully working Next.js + Tailwind CSS app using the latest features like App Router, Turbopack, and TypeScript β€” all preconfigured.

You can now:

  • Build full-stack apps using API routes

  • Add dynamic pages via the App Router

  • Easily style with Tailwind utility classes

  • Optimize performance with Turbopack

Happy building!


πŸ™Œ Connect With Me

If you found this helpful, give it a like and share it with your dev friends. You can connect with me on:

10
Subscribe to my newsletter

Read articles from Deepak Modi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Deepak Modi
Deepak Modi

Hey! I'm Deepak, a Full-Stack Developer passionate about web development, DSA, and building innovative projects. I share my learnings through blogs and tutorials.