Deploying Node.js applications with PM2
This is a very exciting moment! We are about to make our application available on the public internet. In this case, we will use a DigitalOcean Droplet to host the application. A Droplet is a virtual machine with Ubuntu 23.10 and 0.5 GB of RAM that will host the application. We will use PM2 to keep the application running and to restart it if it crashes.
If you don’t want to use DigitalOcean, as an alternative, you can use an old computer that has at least 4 GB RAM, Ubuntu (or another Linux distro), and have SSH communication enabled (no need to install Node.js or deploy a website at this point). An old laptop is a great option or even a Raspberry PI (3, 4, or 5) (https://www.raspberrypi.com/) with Raspbian (https://www.raspberrypi.com/software/) will do the job. Here, you can find two tutorials that will help you with the setup: