Disable Grafana login screen

I have a homeasstant+grafana+influxdb setup running in docker containers, and configured with docker-compose. I have a few grafana graphs embedded as lovelace cards.

Problem: sometimes these grafana cards start asking a login/password.

I already tried number of options to suppress login screen and allow anonymous grafana access, but it still asks the password when loading those cards. Here is my grafana section of the docker-compose file

  grafana:
    container_name: grafana
    image: grafana/grafana:7.3.6
    volumes:
      - ./grafana:/var/lib/grafana
    environment:
      - GF_SECURITY_ALLOW_EMBEDDING=true
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_AUTH_ANONYMOUS_ORG_NAME=Viewer
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
      - GF_AUTH_DISABLE_LOGIN_FORM=true
      - GF_AUTH_OAUTH_AUTO_LOGIN=true
    ports:
      - "3000:3000"
    depends_on:
      - influxdb
    restart: always
    user: "grafana"

Does anybody know how to suppress the grafana login screen?

1 Like

Hi I had the same problem and solved it as following:

I use the following docker container: Docker Hub
that is running on my Synology, so I’m just going to give you a step by step guide how to do it there, but I’m sure this will work for other systems as well.

steps:

  1. log in to your Synology through SSH
  2. In your SSH command, execute: sudo docker exec -it <CONTAINER_ID> bash
    Of course, replace the container_id with the correct id.
  3. You are now logged in the bash of the docker container.
    Locate file: /etc/grafana/grafana.ini and use nano to edit the file
  4. Apply steps for anonymous access, as described here:
    Grafana Authentication | Grafana Labs
  5. reboot the grafana docker container

Works for home assistant. My wive was always complaining about this, but now she won’t have to anymore!

You can add to your docker-compose file a new volume and change the [auth.anonymous] according to the link shared by @GensGroen

    volumes:
      - ./grafana:/var/lib/grafana
      - ./grafana/config/custom.ini:/etc/grafana/grafana.ini