Self-Hosting Next.js @leerob
Self-Hosting Next.js  @leerob
Uploaded October 2024 | Updated December 2026, 3 hours ago
Learn how to deploy Next.js, Postgres, and Nginx to a $4 VPS with Docker.

I'll explain how to use and configure Next.js features like image optimization, caching & ISR, streaming, middleware, server components, and more.

0:00 Intro
1:15 Demo App
2:01 Setting up our Linux server
3:58 VPS vs. dedicated server
6:03 Vertical vs. horizontal scaling
7:08 Deploying to our VPS
17:24 Data fetching
18:03 Image optimization
21:08 Streaming
22:13 Postgres database
23:49 ISR / Caching
28:59 Middleware
29:43 Reading environment variables
31:14 Running code on server startup
32:18 Cron that hits a Route Handler
32:50 Rate limiting
33:31 Tradeoffs vs. managed services
42:25 Other options

github.com/leerob/next-self-host
Self-Hosting Next.jsShould you learn JavaScript before React?Immersive Web Experiences (with Bruno Simon)React 2025 – Firebase Admin with Next.js + SWRThe Future of Mixed Reality (with Adora Nwodo)Introduction to Next.js – Next vs. Gatsby vs. CRAWhat State Management Library Should I Use with React?Route Groups with the Next.js App RouterStatic Sites with Next.js 9.3 and PrismaPartial Prerendering in Next.js 14 (Preview)Code Walkthrough for Next.js / React / MDX / Tailwind ApplicationRebuilding the Twitter Embed Widget! (Next.js + Tailwind)
leerob |

Self-Hosting Next.js

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER