This video will show you excatly how to deploy your NodeJS API on any VPS. For this tutorial we will be using Linode Ubuntu VPS to deploy our API and make it live on the internet. We will be setting a this API with SSL from Let's Encrypt and reverse proxy with Nginx.
Timestamps:
===========
00:00 Intro
02:21 Building Basic Express API
07:14 Setting up VPS with Linode
12:18 Login into server & updating
14:51 Installing Node and Npm
19:12 Copy project to server
30:10 Setting up PM2
34:02 Setting up Reverse Proxy with Nginx
44:00 Adding Server Firewalls
45:46 Setting up domain name and SSL
54:22 Outro
List of commands used in tutorial:
============================
touch
cd
ls
ssh-keygen -t rsa
apt-get update
apt-get upgrade
apt-get install npm
npm i -g n
n install lts
apt-get install nginx
nginx -t
systemctl restart nginx
Nginx location block code:
======================
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
Basic API Github Link:
==================
https://github.com/LloydJanseVanRensburg/youtube-deploy-node-tutorial
Linode Link:
==========
https://www.linode.com/
Certbot Commands:
=================
https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal
Hardening up server even more:
==========================
https://www.linode.com/docs/guides/securing-your-server/
Subscribe: https://www.youtube.com/@the_full_stack_junkie/featured