Self Host - Where does ENV variables get saved?

I am self hosting on lightsail, running with pm2 and caddy. Installed on Debían, with root user. Works great. Have been able to update with simple stop>update>start commands. I have also been able to set env variables and these are persisted (don’t really know how). Have not restarted the server, only stop and start in case something becomes unresponsive.
I would like to know which env variables are set and have not been able to find anywhere. I found the config file where there is only data is the encryption key. So where are the other env variables that I have saved?

Thanks!

Thanks
Andres

Hey @pradilla,

I guess to answer that the question would be how did you set the env variables? n8n itself doesn’t store them they are an OS feature so they could be in memory or they could be in the users bashrc file.

If you are using pm2 though I think the normal approach would be to use an ecosystem file.

Thanks @Jon ,
I ran this in command line to enable smtop for example (plus all the other SMTP env variables required).:

N8N_EMAIL_MODE=smtp pm2 restart n8n --update-env

Also looked into .bashrc and did not fine anything related.

Any further clues?

Thanks!
Andres

Hi @Jon Juat got it!!! Info on post below.

ENV Variables are related to PM2, so command line: " pm2 env {id of the process} " pulls up the env variables set.

1 Like