데브허브 | DEVHUB | Self-Host Next.js & PostgreSQL On VPS - Full Tutorial (Custom Domain, SSL, Security)
Learn how to self-host your Next.js app and a local Postgres database on a cheap VPS. Set up Nginx and PM2 and secure your server with a Firewall. Connect a real domain and set up a free SSL certificate. Every step and command is provided.
Get a cheap VPS on Hostinger (Use code CODINGINFLOW for 10% off): http://hostinger.com/codinginflow
All steps & commands for copy-pasting: https://gist.github.com/codinginflow/...
The sample project we will deploy: https://github.com/codinginflow/next-...
⭐ Get my full-stack Next.js with Express & TypeScript course: https://codinginflow.com/nextjs
✅ Get my free React Best Practices course: https://www.codinginflow.com/reactbes...
💌 Join my newsletter for regular web dev tips: https://codinginflow.com/newsletter
💬 Join our developer community on Discord: https://codinginflow.com/discord
📣 Follow Coding in Flow on social media:
Twitter: / codinginflow
Instagram: / codinginflow
TikTok: / codinginflow
Facebook: / codinginflow
Timestamps:
0:00 - Overview
0:51 - Self-hosting vs Vercel
2:50 - Sample project overview
7:57 - VPS server setup
10:50 - VPS configuration + security (sudo, ssh keys, ufw, pings)
25:34 - Node.js, Git, PostgreSQL installation + setup
35:43 - Nginx installation + configuration
41:44 - PM2 installation + setup (logs, startup script)
46:57 - Custom domain + SSL (Certbot) setup