Skip to content

Grafana RPM Binary Installation Guide | Compatible with CentOS/RHEL ​

Grafana RPM installation diagram

Preface ​

As the most popular open-source data visualization platform, Grafana is widely used in the monitoring field. When deploying Grafana, in addition to the cloud-native solution of Kubernetes + Helm,RPM package installation It is still the most direct and traditional way, especially suitable for the following scenarios:

  • Development and testing environment: Quickly verify Grafana functionality without deploying a full Kubernetes cluster

  • Standalone monitoring: Only need to monitor a few physical machines or virtual machines, and set up a lightweight monitoring platform

  • Resource-constrained environment Not enough resources to run a Kubernetes cluster, but visual monitoring capabilities are needed.

  • Traditional O&M habits: More familiar with RPM package management and prefer to keep the deployment process simple and controllable.

This article records in detail in CentOS/RHEL The complete process for installing Grafana OSS on a system via RPM packages, from download, installation, configuration, and opening the firewall to service management, covering all key steps and troubleshooting experience.

💡 Version Selection Tips:

Grafana provides OSS (Open Source Edition) and Enterprise (Enterprise Edition) Two versions. This article uses the OSS open-source edition for demonstration. It includes all the basic Grafana features such as core visualization, alerting, and data sources, and fully meets the needs of personal development, testing, and most production scenarios. The Enterprise edition additionally provides advanced features such as reporting, RBAC, and SAML, and is suitable for environments with enterprise-level requirements. The installation process is exactly the same for both; you can replace the download link according to your needs.

Whether you are an operations engineer, developer, or Homelab enthusiast, you can quickly build a usable Grafana monitoring platform through this article.

Environment Description ​

ProjectInformation
Operating systemCentOS 7+ / RHEL 7+
Architecturex86_64 (amd64)
Grafana version13.2.0
Installation methodRPM package
Service Managementsystemd

Part 1: Download the Grafana RPM package ​

1.1 Download from GitHub Releases ​

bash
# Enter the temporary directory
cd /tmp

# Download Grafana 13.2.0 RPM package (Enterprise Edition)
wget https://github.com/grafana/grafana/releases/download/v13.2.0/grafana-enterprise_13.2.0_linux_amd64.rpm

# Or download the OSS open-source version
wget https://github.com/grafana/grafana/releases/download/v13.2.0/grafana_13.2.0_linux_amd64.rpm

1.2 Download from the Official Grafana YUM Repository (Alternative) ​

bash
# Add the official Grafana YUM repository
cat > /etc/yum.repos.d/grafana.repo <<'EOF'
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF

# Install from the repository
yum install grafana -y

1.3 Version Selection Recommendations ​

Version typeApplicable scenariosDescription
OSS (Open Source Version)Development and testing, personal HomelabFully open source, with features sufficient for most scenarios, no license required.
Enterprise (Enterprise Edition)Enterprise production environmentIncludes advanced commercial features; a License must be applied for.

Part 2: Installing RPM Packages ​

2.1 First installation ​

bash
# Install RPM package
rpm -ivh grafana_13.2.0_linux_amd64.rpm

Expected output:

Preparing...                          ################################# [100%]
Updating / installing...
   1:grafana-13.2.0-1                 ################################# [100%]

2.2 Upgrade Installation ​

If an older version of Grafana is already installed on the system:

bash
# Upgrade using the -U parameter
rpm -Uvh grafana_13.2.0_linux_amd64.rpm

2.3 Verify Installation ​

bash
# View the list of installed files
rpm -ql grafana

# View version
/usr/sbin/grafana-server -v
# 输出:Version 13.2.0(提交:f681b1359f,分支:HEAD)

# Check Grafana CLI version
/usr/sbin/grafana-cli -v

Part 3: Configuring Grafana ​

3.1 Default configuration file location ​

FilepathExplanation
Main configuration file/etc/grafana/grafana.iniGrafana core configuration
Systemd 服务/usr/lib/systemd/system/grafana-server.serviceService Management
Data directory/var/lib/grafanaStore data (default)
Log directory/var/log/grafanalog file
Plugin directory/var/lib/grafana/pluginsPlugin storage location
default configuration file/usr/share/grafana/conf/defaults.iniDefault configuration reference

3.2 Modify the configuration file ​

bash
# Back up the original configuration
cp /etc/grafana/grafana.ini /etc/grafana/grafana.ini.bak

# Edit configuration
vim /etc/grafana/grafana.ini

Key configuration items:

ini
[server]
# Protocol (http, https, h2, socket, socket_h2)
protocol = http

# Minimum TLS version allowed. By default, this value is empty. Accepted values are: TLS1.2, TLS1.3. If nothing is set TLS1.2 would be taken
;min_tls_version = ""

# The ip address to bind to, empty will bind to all interfaces
http_addr =

# The http port to use
http_port = 3000

# The public facing domain name used to access grafana from a browser
domain = 192.168.0.231

3.3 Modify Data Directory Permissions ​

bash
# Ensure the Grafana user has permission
chown -R grafana:grafana /var/lib/grafana
chown -R grafana:grafana /var/log/grafana

Part 4: Starting the Grafana Service ​

4.1 Managing with systemd ​

bash
# Reload systemd configuration
systemctl daemon-reload

# Start the service
systemctl start grafana-server

# Set to start on boot
systemctl enable grafana-server

# Check service status
systemctl status grafana-server

4.2 Verify that the service is running normally ​

bash
# View port listening
netstat -lntp | grep 3000

# Expected output:
# tcp  0  0 0.0.0.0:3000  0.0.0.0:*  LISTEN  12345/grafana-server

# Or use the ss command
ss -lntp | grep 3000

# Test local access
curl http://192.168.0.231:3000 | head -20

# View service logs
journalctl -u grafana-server -f

Part 5: Opening the Firewall ​

This is The most easily overlooked a step, and also the main reason why external access is unavailable.

5.1 Using firewalld (CentOS 7+/RHEL 7+) ​

bash
# Open port 3000
firewall-cmd --zone=public --add-port=3000/tcp --permanent

# Reload firewall rules
firewall-cmd --reload

# Validation rules have been added
firewall-cmd --list-ports

# Expected output: 3000/tcp

5.2 Using iptables (legacy systems) ​

bash
# Add rule
iptables -A INPUT -p tcp --dport 3000 -j ACCEPT

# Save rules
service iptables save
# or
iptables-save > /etc/sysconfig/iptables

5.3 Disable Firewall (Test Environment Only) ​

bash
# Temporarily closed
systemctl stop firewalld

# Permanently disable (not recommended for production environments)
systemctl disable firewalld

Part Six: SELinux Configuration ​

If SELinux is enabled on the system, additional configuration may be required.

6.1 Check SELinux status ​

bash
getenforce
# Enforcing - Enable
# Permissive - Warning mode
# Disabled - Disabled

6.2 Temporarily Closed (for Testing) ​

bash
setenforce 0

6.3 永久配置(推荐) ​

bash
# Allow Grafana to bind port
semanage port -a -t http_port_t -p tcp 3000

# Allow Grafana to access the network
setsebool -P httpd_can_network_connect 1

# Set file context
chcon -t httpd_sys_content_t /usr/share/grafana/public -R

Part Seven: Accessing Grafana ​

7.1 Web Login ​

bash
# Browser access
http://<Server IP>:3000

# Default credentials
Username: admin
Password: admin

7.2 First Login ​

First login will Force password change, it is recommended to set a strong password.

7.3 Validation API ​

bash
# Check Grafana health status
curl http://localhost:3000/api/health

# Expected return:
# {
#   "database": "ok",
#   "version": "13.2.0",
#   "commit": "f681b1359f6a0b8ecb9f2c49a88ac72b75bde73b"
# }

Part 8: Common Questions and Troubleshooting ​

Q1:rpm -ivh Report file conflict ​

file /etc/grafana from install of grafana-13.2.0-1.x86_64 conflicts with file from package grafana-5.2.2-1.x86_64

Reason: An old version of Grafana is already installed on the system.

Solution:

bash
# Method 1: Upgrade using -U
rpm -Uvh grafana_13.2.0_linux_amd64.rpm

# Method 2: Uninstall the old version first.
rpm -e grafana-5.2.2-1.x86_64
rpm -ivh grafana_13.2.0_linux_amd64.rpm

Q2: Service failed to start; port is already in use. ​

bash
# Check port usage
lsof -i:3000
netstat -tlnp | grep 3000

# Kill the occupying process
kill -9 <PID>
systemctl start grafana-server

Q3: Unable to access externally (Connection refused) ​

Inspection sequence:

bash
# 1. Is the service running?
systemctl status grafana-server

# 2. Whether the port is listening
netstat -lntp | grep 3000

# 3. Is the firewall open?
firewall-cmd --list-ports

# 4. Whether the configuration binds to 0.0.0.0
cat /etc/grafana/grafana.ini | grep http_addr

# 5. Whether SELinux blocks
getenforce
setenforce 0

Q4: Forgot admin password ​

bash
# Reset password to admin
/usr/sbin/grafana-cli admin reset-admin-password admin

# Restart the service
systemctl restart grafana-server

Part 9: Quick Reference for Common Management Commands ​

Operationcommand
Start servicesystemctl start grafana-server
Stop servicesystemctl stop grafana-server
Restart servicesystemctl restart grafana-server
View statussystemctl status grafana-server
Set to start on bootsystemctl enable grafana-server
View logsjournalctl -u grafana-server -f
View version/usr/sbin/grafana-server -v
Reset password/usr/sbin/grafana-cli admin reset-admin-password <新密码>
Install plugin/usr/sbin/grafana-cli plugins install <插件名>
View configurationcat /etc/grafana/grafana.ini
Verify configuration/usr/sbin/grafana-cli admin config-check

Part 10: Upgrade Guide ​

10.1 View Current Version ​

bash
/usr/sbin/grafana-server -v

10.2 Download the new version ​

bash
wget https://github.com/grafana/grafana/releases/download/v13.2.0/grafana_13.2.0_linux_amd64.rpm

10.3 Execute Upgrade ​

bash
# Stop service
systemctl stop grafana-server

# Back up configuration and data
cp -r /etc/grafana /etc/grafana.bak
cp -r /var/lib/grafana /var/lib/grafana.bak

# Upgrade installation
rpm -Uvh grafana_13.2.0_linux_amd64.rpm

# Start the service
systemctl start grafana-server

# Verification version
/usr/sbin/grafana-server -v

Part 11: Comparison with Other Installation Methods ​

Comparison itemRPM installationHelm deployment
Applicable scenariosSingle machine/few nodesKubernetes cluster
DependenceNoneKubernetes + Helm
Installation speedVery fast (minute-level)Slower (requires a cluster environment)
scalabilityManual managementAuto scaling
Configuration ManagementManually modify the configuration filevalues.yaml unified management
Upgrade rollbackManual rpm -UvhHelm native support
High availabilityRequires additional configurationNative support
learning curvelowmedium-high
Suitable scenariosDevelopment testing, small-scaleLarge-scale production

Conclusion ​

Through this article, you have mastered the complete process of installing Grafana via RPM package on CentOS/RHEL systems:

  • Download and install the Grafana RPM package

  • Configure Grafana (bound to 0.0.0.0, allow external access)

  • Manage services with systemd

  • Open the firewall and SELinux configuration.

  • Access the Grafana web interface

  • Common troubleshooting

  • Version upgrade process

Core advantages of the RPM installation method: Simple, fast, and controllable—the best choice for standalone and traditional operations and maintenance scenarios.

Related Resources:

All operations in this article have been verified in CentOS 7/8 environments and are applicable to RHEL and compatible distributions.

Last updated on11/07/2026, 02:16 PM
@fishfinal | @fishfinals | [email protected]