Setup Grafana with https (Lighttdp + Letsencrypt + Nextcloud)

Hello everyone,

I have the following problem. I would like to secure my server a little bit and switch it completely to ‘https’, which works great with my Nextcloud instance, but I am currently having problems switching my Grafana instance over too. I have changed the /etc/grafana/grafana.ini as recommended at https://grafana.com/docs/grafana/latest/setup-grafana/set-up-https/ and also integrated the Letsencrypt certificate with the symlinks specified there.

With this configuration:

[server]
http_addr =
http_port = 3000
domain = mysite.com
root_url = https://subdomain.mysite.com:3000
cert_key = /etc/grafana/grafana.key
cert_file = /etc/grafana/grafana.crt
enforce_domain = False
protocol = https

however, I am not able to enable https connections. Could the reason be that the default port :443 is then used and the domain displays the default placeholder page of lighttdp there?

Wouldn’t it be nice if it could also be an option for Https Grafana during the install process, if a letsencrypt instance is already installed?

Required Information

  • DietPi version | 9.9.0
  • Distro version | bookworm
  • Kernel version | Linux DietPi 6.1.0-30-amd64
  • Architecture | amd64

Additional Information (if applicable)

  • Nextcloud installed
  • piHole installed
  • Lighttdp as web server
  • working letsencrpyt cert not yet set to HSTS

Well in grafana configuration, you specified port 3000 to be used as well https. Means https should be working on port 3000 now. Did you tried this one using https?

A port can be used just once. It can’t be used by 2 applications at the same time. Means, port 443 has been configured on your web server and you will not be able to use it on grafana directly.

Another option, instead of configuring https on grafana directly, would be using your web server as reverse proxy.