How Do i Set Environment Variables In Digital Ocean


I launched my bot on digital ocean and I’m trying to setup environment variables like Database URL and REDIS. Is there any way to set that up within the BOTPRESS global config.json. I’ve tried setting the environment variable and it’s not recognizing it. Typing $ printenv shows it in my variable list.but botpress cannot recognize it. I installed botpress using the 1-click install though .

Any help please, I need to deploy

Hi @naijatechguy,

I think the solution would something like

  1. SSH into the machine.
  2. Stop the bp running container: docker container stop bp.
  3. Remove it with docker container rm bp.
  4. Re-create the container like explained here with --env for each env vars.

The reason why Botpress doesn’t recognize the environment variables is because docker isolates the one on you host machine from those on your containers (this prevent from having conflicting env vars between multiple running containers).

On a side note, I recommend you to take a look at docker-compose if you want a way to be able to easily configure and manage multiple containers at the same time.

Please let me know if that doesn’t solve your issue :slight_smile: