DEV Community 👩‍💻👨‍💻

Discussion on: How to CI/CD using PM2 for your Node.js project

ocalde profile image
Oscar Calderon

This is really interesting, thanks!! I like to play with a very small VM I have in Vulture, and I wanted something really lightweight for CD.
However there's something I don't understand. It seems it is assumed that the ecosystem file will be in your local computer. In my case, I have the ecosystem file in the VM itself along with my apps. Do I still need to configure the ssh key for it to deploy in itself? Or is there some alternate configuration to tell it to deploy locally instead of in a remote server?

t410 profile image
Tayyib Cankat Author

Thank you for your interest. Well, the ecosystem file contains the necessary information along with instructions for the machine that the app will run on. So if you want your VM to run the app with PM2, and no CD you can of course use ecosystem file without SSH configurations.

If you want to deploy the app and then run it on a remote VM without connecting to that VM from your local and physical machine then you can configure SSH information and PM2 will automate the connection, pulling from git, npm installing, running the app steps.

So you are letting PM2 do the deploying and running footwork. To deploy, PM2 needs an SSH key to connect to the remote machine. That SSH configuration part is essential for CD operations.

I hope this clarifies your question.