Run the Docker image for Grafana
What is Grafana
Grafana is an open-source data visualization and monitoring tool used to create interactive and customizable dashboards for analyzing and monitoring time-series data. It allows users to connect to various data sources, such as databases, cloud platforms, and monitoring systems, and visualize the data in the form of graphs, charts, tables, and alerts.
Grafana supports a wide range of data sources, including popular databases like MySQL, PostgreSQL, and Elasticsearch, cloud platforms like AWS and Google Cloud, as well as monitoring systems like Prometheus and Graphite. It provides a user-friendly web interface that allows users to create and configure dashboards, define queries to retrieve data from different sources, and design visualizations using a drag-and-drop approach.
With Grafana, you can easily create and organize panels to display your data in real-time, set up alerts and notifications based on defined thresholds, and share your dashboards with others.
Grafana Docker images come in two editions:
- Grafana Enterprise:
grafana/grafana-enterprise
- Grafana Open Source:
grafana/grafana-oss
Run Grafana via Docker CLI
To run the latest stable version of Grafana, run the following command
Use Persistent Stearge (recommended)
It is recommended to have persistent storage because, without it, all data will be lost once the container is shut down.
Create a Grafana Docker volume grafana-storage
by running the following commands
docker volume create grafana-storage
Verify the volume was created correctly.
docker volume inspect grafana-storage
Start the Grafana container by running the following command.
docker run -d -p 3000:3000 --name=grafana \
--volume grafana-storage:/var/lib/grafana \
grafana/grafana-enterprise
Sign in to Grafana
To sign in to Grafana for the first time:
Open your web browser and go to http://localhost:3000/.
Default username and password admin
Create a dashboard
- Click Dashboards in the left-side menu.
- On the Dashboards page, click New and select New Dashboard from the dropdown menu.
- On the dashboard, click + Add visualization.