01 Overview
Grafana turns Prometheus, Loki, and dozens of other data sources into dashboards and alerts. Dashboards are portable JSON, so they can be version-controlled and provisioned automatically alongside infrastructure.
→ official documentation02 Installation
Pick a platform. Each step is copy-pasteable on its own.
01 Install prerequisites
sudo apt-get install -y apt-transport-https software-properties-common wget
02 Add the Grafana GPG key and repo
sudo mkdir -p /etc/apt/keyrings/ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
03 Install Grafana
sudo apt-get update sudo apt-get install -y grafana
04 Enable and start the service
sudo systemctl enable --now grafana-server
01 Add the Grafana repo
cat <<EOF | sudo tee /etc/yum.repos.d/grafana.repo [grafana] name=grafana baseurl=https://rpm.grafana.com repo_gpgcheck=1 enabled=1 gpgcheck=1 gpgkey=https://rpm.grafana.com/gpg.key EOF
02 Install Grafana
sudo dnf install -y grafana
03 Enable and start the service
sudo systemctl enable --now grafana-server
01 Install via Homebrew
brew install grafana
02 Start the service
brew services start grafana
Note — commands assume sudo privileges and an up-to-date package index. Pin a specific version in production rather than tracking latest.
03 Install script
The steps above bundled into a single idempotent shell script for provisioning boxes unattended.
install-grafana.sh
Ubuntu/Debian target · safe to re-run · exits non-zero on failure
04 Cheatsheet
The commands reached for most often once Grafana is installed.
| Command | What it does |
|---|---|
| localhost:3000 | Default web UI address (admin/admin on first login) |
| grafana-cli plugins install <id> | Install a plugin from the catalog |
| sudo systemctl status grafana-server | Check service status |
| /etc/grafana/grafana.ini | Main server config file |
| /var/lib/grafana/grafana.db | Default SQLite store for dashboards & users |
| Dashboards > Export > Save JSON | Export a dashboard for version control |