Stacks Horizon
All posts
Web & App Development2026-04-215 min readStacks Horizon

Next.js Installation Guide (Latest Version)

# What is Next.js? Next.js is a React-based framework used to build fast, SEO-friendly web applications with features like SSR, SSG, and API routes.

Next.js Installation Guide (Latest Version)

Prerequisites

Make sure you have:

  1. Node.js (v18 or later recommended)
  2. npm / npx (comes with Node.js)

Check versions:

node -v
npm -v

Create a New Next.js Project

Run the official command:

npx create-next-app@latest my-app

Or with yarn:

yarn create next-app my-app

Setup Options (Interactive)

You’ll be asked:

  1. ✔ TypeScript? → Yes (recommended)
  2. ✔ ESLint? → Yes
  3. ✔ Tailwind CSS? → Optional
  4. ✔ App Router? → Yes (latest standard)
  5. ✔ src/ directory? → Optional
  6. ✔ Import alias? → Optional

Move Into Project

cd my-app

Run Development Server

npm run dev

Open in browser:

http://localhost:3000

Build for Production

npm run build
npm start

Optional: Install Additional Packages

Example:

npm install axios

Run Next.js with Docker (Optional)

FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
RUN npm install

COPY . .

RUN npm run build

EXPOSE 3000

CMD ["npm", "start"]

Build & run:

docker build -t nextjs-app .
docker run -p 3000:3000 nextjs-app

Conclusion

You now have a fully working Next.js app running locally. From here, you can start building APIs, UI components, and full-stack features.

Comments

Share your thoughts on this article.

Loading comments…