โ† Back to list

๐Ÿš€ Step-by-Step Guide: Install Grafana on a Linux Machine ๐Ÿ–ฅ๏ธ

Grafana is an open-source platform for monitoring and observability, widely used for visualizing data from various sources. Below are theโ€ฆ

Shlpa S Behani in DevOps Playbook ยท 2025-02-02 13:54 ยท 3 claps ยท 2.1 min read paywalled
#monitoring #observability #devops #grafana #prometheus
Open on Medium โ†—
Wiki topics: โ˜๏ธ ยท DevOps & Cloud ๐Ÿ”“ ยท Open Source

๐Ÿš€ Step-by-Step Guide: Install Grafana on a Linux Machine ๐Ÿ–ฅ๏ธ

Grafana is an open-source platform for monitoring and observability, widely used for visualizing data from various sources. Below are the steps to install Grafana on a Linux machine, configure it, and access it via a web interface.

โœ… Prerequisites

  • A Linux-based system (Ubuntu, CentOS, RHEL, or Amazon Linux).
  • Root or sudo privileges.
  • An active internet connection.

๐Ÿ”„ 1. Update Your System

Before installing Grafana, ensure your system is updated:

sudo apt update && sudo apt upgrade -y  # For Ubuntu/Debian
sudo yum update -y                      # For CentOS/RHEL/Amazon Linux

๐Ÿ“ฆ 2. Install Required Dependencies

Ensure you have the necessary utilities installed:

sudo apt install -y software-properties-common wget  # For Ubuntu/Debian
sudo yum install -y wget                             # For CentOS/RHEL/Amazon Linux

๐Ÿ”— 3. Add the Grafana Repository

Add Grafanaโ€™s official repository to your system.

For Ubuntu/Debian:

wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

For CentOS/RHEL/Amazon Linux:

sudo tee /etc/yum.repos.d/grafana.repo << EOF
[grafana]
name=Grafana OSS Repository - RHEL packages
baseurl=https://packages.grafana.com/oss/rpm
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
EOF

๐Ÿ“ฅ 4. Install Grafana

For Ubuntu/Debian:

sudo apt update
sudo apt install grafana -y

For CentOS/RHEL/Amazon Linux:

sudo yum install grafana -y

๐Ÿ”„ 5. Start and Enable the Grafana Service

Enable and start the Grafana service to run it on system boot:

sudo systemctl start grafana-server
sudo systemctl enable grafana-server

Check the service status to ensure itโ€™s running:

sudo systemctl status grafana-server

๐Ÿ”ฅ 6. Configure Firewall Rules

Grafanaโ€™s default HTTP port is 3000. Allow traffic to this port:

For UFW (Ubuntu/Debian):

sudo ufw allow 3000/tcp
sudo ufw reload

For Firewalld (CentOS/RHEL/Amazon Linux):

sudo firewall-cmd --add-port=3000/tcp --permanent
sudo firewall-cmd --reload

๐ŸŒ 7. Access Grafana Web Interface

  1. Open a web browser.
  2. Navigate to http://<server-ip>:3000.
  • Replace <server-ip> with your serverโ€™s public or private IP address.
  1. Log in with the default credentials:
  • Username: admin
  • Password: admin
  1. You will be prompted to change the default password for security.

โš™๏ธ 8. Configure Grafana

  1. Add Data Sources:
  • Navigate to Configuration > Data Sources.
  • Add sources like Prometheus, Elasticsearch, or Azure Monitor.

2. Create Dashboards:

  • Use the + Create option to build dashboards tailored to your needs.

๐Ÿ› ๏ธ 9. Optional: Enable External Access

To allow Grafana to bind to all interfaces (not just localhost), update its configuration file:

  1. Edit the Grafana configuration file:
sudo nano /etc/grafana/grafana.ini
  1. Locate the [server] section and update these lines:
[server]
http_addr = 0.0.0.0
http_port = 3000
  1. Restart Grafana to apply changes:
sudo systemctl restart grafana-server

โœ… 10. Verify Installation

  • Visit http://<server-ip>:3000.
  • Ensure Grafanaโ€™s dashboard loads correctly.

๐ŸŽฏ Conclusion

You have successfully installed Grafana on your Linux machine. Configure your data sources and start building dashboards to visualize your metrics. Grafanaโ€™s flexibility and integration capabilities make it a powerful tool for monitoring and observability.

โœจ Letโ€™s Connect and Continue the Learning Journey! โœจ

Did you find this blog post helpful? If so, please show your support by:

๐Ÿ‘ Clapping: A quick way to let us know you appreciate the content. ๐Ÿ‘ฃ Following: Stay updated with our latest insights and best practices. ๐Ÿ“ฉ Subscribing: Receive our latest articles directly to your inbox.

Your feedback and support help us continue to create valuable content. Thank you! ๐Ÿ’™๐Ÿ˜Š

Have questions or tips to share? Drop them in the comments below! ๐Ÿ’ฌ


๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
post_id
ec822a328dd1
slug
step-by-step-guide-install-grafana-on-a-linux-machine-๏ธ-ec822a328dd1
url
https://medium.com/devops-playbook/step-by-step-guide-install-grafana-on-a-linux-machine-%EF%B8%8F-ec822a328dd1
canonical_url
https://medium.com/devops-playbook/step-by-step-guide-install-grafana-on-a-linux-machine-%EF%B8%8F-ec822a328dd1
author_url
https://medium.com/@shilpa.behani89
status
ok
fetched_at
2026-06-12 22:02:08