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.
Prerequisites
Make sure you have:
- Node.js (v18 or later recommended)
- 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:
- ✔ TypeScript? → Yes (recommended)
- ✔ ESLint? → Yes
- ✔ Tailwind CSS? → Optional
- ✔ App Router? → Yes (latest standard)
- ✔ src/ directory? → Optional
- ✔ 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…
