Grafana is an open source software that specializes in creating graphs and visualizations for users to easily understand the time-series data.
On this step-by-step guide, we will be launching an EC2 Instance with Amazon Linux 2 as the operating system, then install and run Grafana.
EC2 Instance Setup
Launch an EC2 Instance using the
Amazon Linux 2 AMI.
For reference here are the settings of my EC2 Instance.
|Amazon Linux 2
|t2.micro (free tier) or
|8GB General Purpose SSD (gp2)
|See below (EC2 Security Group Setup)
Note: This post is about installing Grafana on Amazon Linux 2. Launching an EC2 Instance will not be discussed here.
EC2 Security Group Setup
For the EC2 Instance Security Group I opened SSH (
22) and default Grafana port (
3000) to the internet (
SSH to the target EC2 Instance.
ssh email@example.com -i GrafanaKeyPair.pem
Since this is the first time we are using the EC2 Instance we need to update all installed packages.
sudo yum update -y
Then we add a new YUM respository for the operating system to know where to download Grafana. The command below will use
sudo nano /etc/yum.repos.d/grafana.repo
Add the lines below to
grafana.repo. This setting will install to the Open Source version of Grafana.
sudo yum install grafana
There will be around 3 times the system will ask if it is okay to download the grafana packages. Just press
enter everytime to allow download and installation.
systemd to load the new settings. Start Grafana Server, then check for its status.
sudo systemctl daemon-reload
Start the Grafana Server.
sudo systemctl start grafana-server
Check the status of Grafana Server
sudo systemctl status grafana-server
Status output should show that
Run the command below to make sure that Grafana will start upon booting our Amazon Linux 2 instance.
sudo systemctl enable grafana-server.service
Visit the newly installed Grafana Server by visiting the Public IP of the EC2 Instance on port
This will then redirect to the login screen of Grafana.
On first login Grafana will requires to change the admin password. Input the desired password (except
admin) and click Save.
This will move to the default Grafana Welcome Grafana page.
We can now add
Explore plugins and many more.
We have now succesfully installed Grafana on EC2 Instance running in Amazon Linux 2.
If you have any questions or issues encountered let me know in the comments below.