Oracle Cloud Infrastructure Setup

Setting Up A Monitoring System For Testing

So the entire idea behind this free tier, was to use it for testing out random scripts and Node projects, but have them in the cloud so they could potentially be used elsewhere. But I ran into a problem with PM2 which is very useful and I use it on every other server that runs node services.

I got Node v18 to auto-install, which is fine. I then tried to install pm2. Which looked fine, but every time I tried to run a command I would get an output like this:

              $ pm2 status
              [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2

Seeing as this didn't work, I tried to find a solution. I looked up potential candidate issues like platform incompatibilities and node version support for any particular architecture.

              uname -r
              5.15.0-1025-oracle
              uname -m
              aarch64
Basically gave me the details I could use to try to attempt to solve this. Many many articles came up, from downgrading pm2 to like 2.5 and 3.1 or something like that, nothing worked. But then I noticed that the VM was spawning in the root folder. On these systems, you have no permissions to even do mkdir in the /var/www folder, let alone in the root folder so... I had a feeling that since I have no permissions to specific folders, that pm2 was not going to work on this system.

In comes forever and forever-service

I installed both and added the node app, and did some finalization settings.

              sudo apt install forever forever-service
              sudo iptables -F
              sudo cp /etc/iptables/rules.v4 /etc/iptables/rules.v4.bak && sudo truncate -s 0 /etc/iptables/rules.v4
            
And make sure that the Network Security Group on the VM Instance (in your dashboard on the Oracle site), has a security group which allows whatever port your node app is running on. Then assign it to the subnet's Network Security Group.

Now it works, and it's free. 12 Core CPU with 32 GB of RAM and ~40GB of block storage. Free.