Install Grafana in Any Cloud VM for Monitoring

Install Grafana on EC2 and start with an Auto Start

Narendiran Krishnan
Geek Culture
5 min readMay 5, 2021

--

Credit: Some Random dude on Google Images

What is Grafana ?

Grafana is an awesome tool which helps you Query, Visualize and create alerts on those Visualizations. End users can create complex monitoring dashboards using interactive query builders. In this blog, we will install it in the AWS EC2 Instance. But the way to install it in a different cloud VM is similar as only the name alone differs as shown below

cloud_comparison

Grafana Features:

It’s an open source tool and so it does have a great community as we can post any kinda questions and the random guy on the internet will definitely answer those questions as soon as possible.

Moreover, it supports all the major databases in the same dashboard.

Based on my personal experience this works well with the time series database. I found it most helpful.

Steps to install Grafana in EC2 Instance:

  • Create a EC2 instance with Ubuntu / Linux based OS
  • Configure the Security Groups
  • Install Grafana
  • Adding Grafana to APT Repository
  • Start and add Auto Start to Grafana
  • Logging into Grafana Dashboard

Step 1: Create a EC2 Instance

You can create an EC2 Instance with Ubuntu and grab whatever is free as I did that only.

Step 2: Configure Security Groups

Create a security group with open 22 and 3000 port.

22 port → ssh access

3000 port → Access to the Grafana dashboard via a web browser

Security_rules

Step 3: Install Grafana

Always make sure to get the latest version. You can verify that from the following link given below,

code:

wget_command

code:

dpkg_code

Step 4: Adding the Grafana sources to our APT Repository

Note: APT Repository → It’s a collection of deb packages with metadata which is readable by the apt-* family of tools, namely, apt-get. Having the APT Repository will let you perform the package install, removal, upgrade etc (End of Thinking Capacity)…!

we need to modify our /etc/apt/sources.list file by adding a line to the bottom of it.

Scroll down all the way to the bottom using your down-arrow key until you cannot scroll down and then add the following line at the bottom:

adding_grafana_source_repo

Now we need to add the Package Cloud key. This allows us to install signed packages.

adding_grafana_source_repo

Once you’re done with this we gotta update and verify it once again just to ensure that everything we did went well.

install_grafana

Step 5: Starting the Grafana Server and adding it to Auto start

Starting Grafana is kinda simple just starting the services as shown below

Now we are going to add it to Auto Start, run:

adding_autostart

Alright, now it’s time to visualize the output …!!!

Logging in to Grafana

Open up your Web Browser and enter the IP of your server followed by port 3000, like

http://<you IP address>:3000

You should then be greeted by the Grafana Login Window.

finally_grafana_board

Note:

User Name: admin

Password: admin

Once you enter the details you will be prompted to change the User Name and Password, so do it according to your wish

new_password_prompt

After this, you will finally visualize the Grafana Dashboard.

atlast_grafana

The Grafana Version that I have used for this blog is 7.5.5

If you wanna implement Grafana to get the Cloud Watch Metrics in your EC2 instance then check the blog below,

If you wish to stay connected,

you can just google “ narenltk / narendiran krishnan ” or just drop a mail to → narenltk@gmail.com → Happy to help..!!!

--

--

Narendiran Krishnan
Geek Culture

AI blogger. Inspiring & working towards a better future through technology & Artificial Intelligence. Join me in the quest ..!!