Follow the instructions below to deploy a Next.js app with a local PostgreSQL database to a VPS, secure it, and connect it to a custom domain with free SSL. Watch the accompanying tutorial on YouTube: https://www.youtube.com/watch?v=2T_Dx7YgBFw
- Get your VPS server on Hostinger (Use code
CODINGINFLOW
for 10% off). Install Ubuntu 24 as the OS and set a root password. - Log into your server as root:
ssh root@<your-server-ip>
- Update Linux packages:
apt update && apt upgrade -y
- Create a new user:
adduser