I am working on a Node.js project. It was working fine on the previous server with the command npx pm2 start ./bin/www
using PM2.
Now, I have an AlmaLinux server where I am trying to run my Node.js application. However, when I close the terminal the PM2 instance is removed from the list and the application stops working.
I attempted to solve this problem by adding a restart time, but the same issue occurred — the instance was removed upon closing the terminal.
I also tried using the nohup pm2 start ./bin/www
command. I came across the nohup
command, which is supposed to ensure that the process continues running even if the SSH session is terminated.
Please avoid marking this question as a duplicate, as it is distinct from others already present near the blocking list.