# Day 73 - Grafana🔥Part-2   (Feb 7, 2024)

## **🙏 Introduction:**

In this blog, we will learn about open-source monitoring tool Grafana.

# **🎯Task: 1**

## **Setup grafana in your local environment on AWS EC2**

* Go to the AWS console and Launch an EC2 instance
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705425713312/1ccd512b-d929-4bd2-9493-6e0a9967da52.png?auto=compress,format&format=webp align="left")

* Open port 3000 in your EC2 instance's security group to allow external access to Grafana.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705425681270/1057d2c2-2409-4cd9-856c-4360a23b1097.png?auto=compress,format&format=webp align="left")

* Now we will SSH our instance
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426086993/f615c80b-5c73-47cb-993e-7caeb3350a5f.png?auto=compress,format&format=webp align="left")

* Download the GPG keys and add them to the trusted keys list
    

```plaintext
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426259123/db8147b1-9a75-4110-b133-2823d765bae3.png?auto=compress,format&format=webp align="left")

* Now, add it to the Grafana repository
    

```plaintext
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426323359/2d2e9f47-b0da-4b49-b875-6cc6416ae41d.png?auto=compress,format&format=webp align="left")

* Update our EC2 instance
    

```plaintext
sudo apt update -y
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426424283/d83ff8ae-b13f-4e38-b423-e6041f859c4e.png?auto=compress,format&format=webp align="left")

* Install Grafana
    

```plaintext
sudo apt install grafana
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426497917/5f5037fd-a3ac-49f2-98d6-422507668d13.png?auto=compress,format&format=webp align="left")

* Start & enable the Grafana server
    

```plaintext
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426682427/5dc9bce8-29cd-4ef7-981f-b8a0bdf9990e.png?auto=compress,format&format=webp align="left")

* Check the status of Grafana server
    

```plaintext
sudo systemctl status grafana-server
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426764458/604ca2e3-de89-4f66-a89b-fa0a4608d0d8.png?auto=compress,format&format=webp align="left")

* Access Grafana server
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705426928563/ddfca732-f01e-4b6b-96e7-99b58b3bbcd8.png?auto=compress,format&format=webp align="left")
