- Docker-compose Install
- Docker Install Grafana Download
- Install Grafana Docker Synology
- Docker Install Ubuntu
In previous blog posts I showed you how to setup a Raspberry Pi with docker-compose support and how to run InfluxDB on your Raspberry Pi.This tutorial will add Grafana to your Pi-stack and give you a complete monitoring setup.The InfluxDB+Grafana stack is heavily used in DevOps scenarios but also extremely useful if you want to visualize any kind of timeseries data at home; power consumption, smart home events, computer uptime, amount of devices in your network, weather in your basement … endless opportunities at your fingertips!
Get Grafana → An easy-to-use, fully composable observability stack. Create your free account. Self-hosting InfluxDB + Grafana via docker ¶ In this section we outline how you can deploy and host InfluxDB and Grafana on your own PC using docker. We use Windows Docker Desktop in the guide, but the principles are similar on Linux. We recommend going through the cloud based guide before trying the below. Docker + System dashboard. Dashboard compatible with Grafana 4. This dashboard display Docker and system metric, the aim it's to have all the metric on one dashboard. Jan 05, 2021 🚨 If anything goes wrong, double-check that the Grafana docker user owns the /var/lib/grafana mountpoint. One important environment variable that you want to remember is GFINSTALLPLUGINS that allows you to bootstrap your grafana docker image with pre-installed. 2 – Install Docker on Windows 10 Pro and Enterprise. Windows 10 has the Hyper-V feature available, so we are going to install the Docker Desktop version that includes the Docker Community Edition for Windows. A – Check your virtualization settings. First, we are going to check if Hyper-V is enabled on your machine. If not, you will have to.
This post assumes that you already have a Raspberry Pi with docker-compose installed; if you do not you may want to read up on this blog post.
Prepare the folder structure
As with the InfluxDB setup, we first need to create some local folders to mount into the grafana docker container for persistence on the Raspberry disk.
To create those folders you can use the following commands:
To get the correct configuration file for whatever grafana version you are running you can use the following command to spin-up a docker container and extract its default configuration:
latest to whatever version you plan to run. In this tutorial we will use
For Grafana to be able to write to the data mount it needs to own the
grafana/data directory.There are two ways to achieve this:
- Make sure your local directory is owned by the default Grafana user ID 472:472
chown 472:472 $HOME/docker/grafana/data
- Run the Grafana container with your local user ID that already owns the directory
- find your user id with
id -uand put it in the
- find your user id with
Personally, I prefer option 1 on the Raspberry Pi, but found out it does not work that well on MacOS where you might want to run this setup as well.
Creating the .env file
To make sure you do not have to expose credentials in your
docker-compose.yml file I recommend to create a separate
.env file next to the compose file.This will automatically be sourced by the
docker-compose script and the variables will be available in the compose file later on.
With the directories setup you can create the
$HOME/docker/compose-files/grafana/docker-compose.yml file.The entire file looks like this:
Let us dissect this a bit.
container_name should be clear.
restart: always ensures that the container will be started automatically after rebooting the host system (Raspberry Pi).
volumes, define the mountpoints previously created.
ports tells Docker to forward the Grafana default port to the Raspberry Pi host, so it will be reachable from within your network.
🚨 If anything goes wrong, double-check that the Grafana docker user owns the
One important environment variable that you want to remember is
GF_INSTALL_PLUGINS that allows you to bootstrap your grafana docker image with pre-installed plugins.In addition we define pass the
GF_SECURITY_ADMIN_USER/PASSWORD credentials from our
.env file into the container.
With all configuration done you can start the Grafana container:
Docker Install Grafana Download
To check if everything is running fine you can run
docker ps and look for a container named
Install Grafana Docker Synology
You should now be able to access your Grafana instance via a browser by opening
http://raspberrypi:3000 (or whatever the hostname of your raspi is 😉) and see the login screen.
Docker Install Ubuntu
If any of this is outdated or does not work for you please leave a comment or reach out via Twitter.Appreciate the feedback 👋