From the course: Advanced Express

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Deployment and operation with PM2

Deployment and operation with PM2

From the course: Advanced Express

Start my 1-month free trial

Deployment and operation with PM2

- [Instructor] In this video, I will deploy our application to a server using PM2. PM2 is a very powerful process manager that also comes with a feature that lets us deploy a project. This is a good option for smaller projects. In larger projects you might have a whole deployment pipeline that takes care of that. As server, I'm using an EC2 instance, but any host on the internet will do. On this host, I installed Node.js and PM2 and I created the user Node.js and a directory on Node.js deploy. I also added the public SSH key of my development machine to the list of authorized keys. PM2 tool relies on Git to deploy project from. For that I pushed it to a GitHub repository. Additionally, I copied my .env file into the deploy directory because it's not published to GitHub for obvious security reasons. On MongoDB Atlas, I also white listed the IP of my server so that it can then connect to the MongoDB cluster. To setup the deployment on all development machine, we first have to install…

Contents