Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Environmental Variables in Digital Ocean Droplets

I have a Node.js app that I want running on a Digital Ocean droplet, however, I have a few environmental variables that I need to be using.
Is it safe for me to create a .env file on it to store the variables? (If no, how do I go about doing this?)
Because I know that services like Heroku have a ‘configuration variable’ setting on their dashboard, whereas Digital Ocean doesn’t

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Heroku is an app platform, not a VM, which is how they can inject your environment variables.

If it’s on your machine, it’s ok for you to create the file – it won’t be accessible via the web (but it WILL be there).

Here’s how to do it with the Digital Ocean App Platform (https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/), and here’s how to do it with just a droplet (https://www.digitalocean.com/community/questions/how-can-i-set-environment-variable-in-droplet-not-using-app)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading