title: Is it possible to deploy using "pm2 deploy production" on Bitbucket Pipelines?
body: <p>I am trying to deploy using <code>pm2 deploy production</code> command using Bitbucket Pipelines.</p>
  
  <p>Do I want to know whether it is possible to do it so? Because there is an option to add existing ssh key in Bitbucket but it's asking for both Public and Private key whereas, I only have a Private key.</p>
  
  <pre><code>deploy: {
      production: {
          user: "ubuntu",
          host: "ec2-xx-xxx-xxx-xx.us-east-2.compute.amazonaws.com",
          key: "~/.ssh/myKey.pem",
          ref: "origin/master",
          repo: "git@bitbucket.org:User/myProject.git",
          path: "/home/ubuntu/myProject",
          "post-deploy":
              "npm install &amp;&amp; pm2 startOrRestart ecosystem.config.js"
      }   
  }
  </code></pre>
  
  <p>This is my PM2 deploy configuration and I am using it in package.json as,</p>
  
  <pre><code>"scripts": {
      "deploy": "pm2 deploy ecosystem.config.js production"
  }
  </code></pre>
  
  <p>and my bitbucket pipeline file command goes below.</p>
  
  <pre><code>script: # Modify the commands below to build your repository.
            - npm install
            - npm run-script deploy
  </code></pre>
  
  <p>I am hosting it in <strong>AWS EC2 instance</strong> and I only have PEM key to connect it with my EC2 instance.</p>