Deploy NextJS Website From Scratch (with Ubuntu, NGINX and pm2)

Опубликовано: 23 Март 2025
на канале: Web Dev Fuel
27,012
591

In this video you'll learn how to deploy a NextJS website from scratch without Vercel by setting up a Ubuntu server on Digital Ocean, using NGINX proxy server to handle HTTP requests and pm2 to run the node process in the background.

-----------------------------

Table of contents:
00:00 - Introduction
02:29 - Create/provision a Ubuntu server in the cloud
06:54 - Create new user with root permissions and SSH access
20:10 - Update and upgrade system with apt
21:14 - Install NGINX and Let's Encrypt packages
22:25 - Create website folder and set user as owner
24:38 - Create NGINX configuration file
31:45 - Create symbolic link between sites-avaliable and sites-enabled
33:36 - Point domain name A Record to server IP Address
36:29 - Restart NGINX with systemctl
39:26 - Allow traffic to ports 80 and 443 with ufw
41:24 - Install node with nvm
42:42 - Install yarn and pm2 globally with npm
43:17 - Run "yarn" command inside Next.js project folder to install dependencies
43:38 - Run "yarn build" to build Next.js project
44:58 - Start Next.js website in the background with pm2
48:50 - Install Let's Encrypt SSL Certificate with certbot