๐ 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โฆ
๐ 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
- Open a web browser.
- Navigate to
http://<server-ip>:3000.
- Replace
<server-ip>with your serverโs public or private IP address.
- Log in with the default credentials:
- Username:
admin - Password:
admin
- You will be prompted to change the default password for security.
โ๏ธ 8. Configure Grafana
- 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:
- Edit the Grafana configuration file:
sudo nano /etc/grafana/grafana.ini
- Locate the
[server]section and update these lines:
[server]
http_addr = 0.0.0.0
http_port = 3000
- 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