Environment variables OSS

Grafana simply will not pick up the environment variables I am setting to overwrite the configuration files. I am trying to edit my SMTP password using an environment variable, but having no luck. I have also tried editing other settings, as shown in the documentation, which also does not seem to work.

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?
    Adding an SMTP password with the GF_SMTP_PASSWORD environment variable

  • How are you trying to achieve it?
    exoprt GF_SMTP_PASSWORD=my_pass
    systemctl restart grafana-server

  • What happened?
    Grafana just does not see the environment variable at all

  • What did you expect to happen?
    I would expect the logs to at least see something related to the variable

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No errors, which is kind of the problem. It looks as though it just does not see the variable.

  • Did you follow any online instructions? If so, what is the URL?

@dannnydannydanny Using exporting command you set environment variable in your current shell.

You need to define environment variables for the service grafana-server.