Grafana and InfluxDB with SSL inside a Docker Container

Self-signed SSL certificates

On the host, create a directory for storing the self signed SSL certificates. This directory will be mounted in the Grafana container as well as in the InfluxDB container to /var/ssl . Create the self signed SSL certificates as follows:

Next, create a config directory and create individual configuration files for Grafana and InfluxB: mkdir conf 


In the file ./conf/grafana/defaults.ini set the protocol to https and provide the paths to the mounted ssl directory in the container.


The file ./conf/influxdb/influxdb.conf is also pretty simple. Add a [http] category and add the settings:


You can set environment variables in env files  for the services.



Docker Compose

Now you can launch the service by using docker-compose up  for the following file. Note

Lets Encrypt Setup

If you require valid certificates, you can also use certificates from lets encrypt.

First, create the certificates on the host:

Then use this docker-compose file.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.