Next.js Project Setup
Create a modern web application with Next.js 14+. App Router and TypeScript support.
Setup Steps
1. Create a new Next.js project:
npx create-next-app@latest project-name2. Options during setup:
- TypeScript: Yes
- ESLint: Yes
- Tailwind CSS: Yes
- src/ directory: Yes
- App Router: Yes
- Import alias: @/*
3. Navigate to the project directory:
cd project-name4. Start the development server:
npm run dev5. Open http://localhost:3000 in your browser
6. Create a page (App Router):
mkdir -p src/app/aboutCreate page file: src/app/about/page.tsx
7. Create an API Route:
mkdir -p src/app/api/helloRoute file: src/app/api/hello/route.ts
8. Production build:
npm run build
npm start9. Environment variables (.env.local):
DATABASE_URL="..."
NEXT_PUBLIC_API_URL="..."Related Guides
Linux VPS Server Setup (Ubuntu)
Configure your Ubuntu-based VPS server from scratch. Security, user management and basic settings.
Apache Web Server Setup
Install Apache HTTP server and configure virtual hosts.
Nginx Web Server Setup
Install Nginx web server and configure it as a reverse proxy.
Let's Encrypt SSL Certificate Setup
Get a free SSL/TLS certificate with Certbot and enable HTTPS.