title: How to use environment variables secrets safely in production
body: <p>I would like to use environment variables to securely hold secrets with pm2.</p>
  
  <p>I have a reverse proxy to an express backed server that uses a database with a password each time it connects to preform a query.  </p>
  
  <p>I would like to access it normally from the program:</p>
  
  <pre><code>procsess.env.my_secret
  </code></pre>
  
  <p>but I'm assuming that simply setting the variable at run time like the following isn't safe:</p>
  
  <pre><code>MY_SECRET="secret password" pm2/node my_api_server.js
  </code></pre>
  
  <p>How should I set the secret password considering I'm using pm2 and I would like the variable to persist through restarts/crashes?</p>
  
  <p>I should note that different environment handling and passing code to other developers through the VCN is less important to me.</p>