title: AWS EC2 AMI User Data run PM2
body: <p>I want to start my application on an instance boot.
  I used the following user data, but I'm unable to see any process running in pm2.</p>
  <p>Note: Creating an instance using an AMI. NodeJs, PM2 and all the dependencies areinstalled. I can SSH to server and start my application using pm2 manually.</p>
  <pre><code>#!/bin/bash
  pm2 start /home/ubuntu/foyrinfrasubscription/server/server.js --name &quot;ReportSub&quot;
  pm2 save
  pm2 resurrect
  </code></pre>