configure a ubuntu virtual machine - to serve a node js app exposing a node-red page for a lab

Опубликовано: 17 Март 2026
на канале: nirvik saha
91
1

This video documents the process of setting up / configuring a simple Linux (ubuntu) virtual machine for a specific requirement. So please feel free to debug using Google and while the exact details vary, broadly you can set up node-js ecosystem and python or use a similar configuration to experiment with AWS EC2 or Azure, deploy simple node JS or Python apps & share with friends, or demonstrate research.
docker project: https://hub.docker.com/repository/doc...
github services: https://github.com/ifcnodered/services

List of commands:
ssh [email protected]
apt install net-tools
sudo snap install network-manager
sudo apt update && sudo apt upgrade -y
sudo apt update && sudo apt install wget -y
sudo apt update && sudo apt-get -y install net-tools
sudo apt-get update && sudo apt-get install nginx
sudo apt-get update && sudo apt-get install ufw -y
sudo ufw app list
sudo ufw allow 'Nginx Http'

Change nginx configuration:
Dir: /etc/nginx/sites-available file: default
Dir /etc/nginx/sites-enabled file: myapp.conf
Put this in both files:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name some_name;
location / {
proxy_pass http://localhost:8080;
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;
try_files $uri $uri/ =404;
}


Ubuntu NodeJS, npm, nodered commands:
sudo apt install nodejs
sudo apt install nodejs npm
sudo apt install build-essential
sudo npm install -g --unsafe-perm node-red


Install and use PM2 commands:
npm install pm2
pm2 start app_name
pm2 startup systemd → output
run output
pm2 save
sudo systemctl start pm2
systemctl status pm2
pm2 kill
npm remove pm2 -g
which pm2