title: How to prepare nodejs for production?
body: <p>I have a MEAN Stack app that I need to host on CPanel and I have never deployed an app before. It is easy to deploy Angular part of the app by creating a bundle in dist folder using the command:</p>
  
  <pre><code>ng build --prod
  </code></pre>
  
  <p>But I would like to know how should I post my backend code on the server. Is there any command/commands that can create a minified bundle like in Angular?</p>
  
  <p>I would also like to know if I need to install some npm packages to make sure my app runs smoothly on the server? Like I keep reading about PM2 and Nginx when I googled about deploying nodejs. So what are their benefits?</p>
  
  <p>Please mention any articles or videos that might be useful.</p>
  
  <p>Angular version 7</p>
  
  <p>Node version 8.11.3</p>
  
  <p>Ubuntu 16.04</p>