Grafana installation on Linux/Ubuntu

Abdullah Eid
2 min readFeb 8, 2024

--

1. Install the prerequisite packages:

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

2. Import the GPG key

sudo mkdir -p /etc/apt/keyrings/
sudo wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee
/etc/apt/keyrings/grafana.gpg > /dev/null

3. Add a repository for stable releases

sudo 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

4. Update the list of available packages

sudo apt-get update

5. Install Grafana OSS

sudo apt-get install grafana
#for grafana enterprise whish is paid use this:
#sudo apt-get install grafana-enterprise

6. Configure the Grafana server to start at boot using systemd

sudo systemctl enable grafana-server.service

7. Start the service

sudo systemctl daemon-reload
sudo systemctl start grafana-server

8. Verify that the service is running

sudo systemctl status grafana-server

Following a successful setup, you can access the Grafana web interface by navigating to localhost:3000 in your web browser. Upon reaching this address, you will be presented with the Grafana login user interface, confirming that the installation and configuration have been completed successfully.

The default username is “admin” and the default password is also “admin”.

9. Run the following command to create an override file in your configured editor.

# Alternatively, create a file in /etc/systemd/system/grafana-server.service.d/override.conf
sudo systemctl edit grafana-server.service

--

--