Skip to main content

Grafana

Installation

Install the prerequisite packages:

sudo apt install -y apt-transport-https software-properties-common wget

Import the GPG key:

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

To add a repository for stable releases, run the following command:

echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

Run the following command to update the list of available packages:

# Updates the list of available packages
sudo apt update

To install Grafana, run the following command:

# Installs the latest OSS release:
sudo apt-get install grafana

# Alternatively, Install the latest Enterprise release:
sudo apt-get install grafana-enterprise

Start Grafana

To start the service, run the following commands:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl enable grafana-server

To verify that the service is running, run the following command:

sudo systemctl status grafana-server

Enable Firewall

If you are using UFW, make sure you open the ports

sudo ufw allow proto tcp from any to any port 3000 comment 'Grafana Port'