Configure a Grafana Docker image
If you do not designate a location for information storage, then all your Grafana data disappears as soon as you stop your container. To save your data, you need to set up persistent storage or bind mounts for your container.
Run Grafana container using bind mounts
You may want to run Grafana in Docker but use folders on your host for the database or configuration. When doing so, it becomes important to start the container with a user that is able to access and write to the folder you map into the container.
The following settings are hard-coded when launching the Grafana Docker container and can only be overridden using environment variables, not in .
Example:
It’s possible to supply Grafana with configuration through files. This works well with Docker Secrets as the secrets by default gets mapped into /run/secrets/<name of secret>
of the container.
For example, you could set the admin password this way:
- Environment variable:
GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/admin_password
You may also specify multiple profiles to GF_AWS_PROFILES
(e.g. ).
Supported variables:
GF_AWS_${profile}_ACCESS_KEY_ID
: AWS access key ID (required).GF_AWS_${profile}_SECRET_ACCESS_KEY
: AWS secret access key (required).