Skip to main content

RPM-based Installation

This guide covers installing Grafana on RPM-based Linux distributions (RHEL, Fedora, CentOS) using the YUM/DNF repository or standalone RPM packages.

Installation Methods

You can install Grafana on RPM-based systems using:
  • YUM/DNF repository (recommended): Automatic updates via dnf update
  • RPM package: Manual installation from downloaded package
  • Standalone binary: Manual installation from tarball

Install from RPM Repository

Installing from the RPM repository enables automatic updates when you run dnf update or yum update.

Available Repositories

EditionPackageRepository
Grafana Enterprisegrafana-enterprisehttps://rpm.grafana.com
Grafana Enterprise (Beta)grafana-enterprisehttps://rpm-beta.grafana.com
Grafana OSSgrafanahttps://rpm.grafana.com
Grafana OSS (Beta)grafanahttps://rpm-beta.grafana.com
Grafana Enterprise is the recommended edition. It’s free and includes all OSS features, with the option to upgrade to the full Enterprise feature set.
1
Import the GPG key
2
wget -q -O gpg.key https://rpm.grafana.com/gpg.key
sudo rpm --import gpg.key
3
Create the repository file
4
Create /etc/yum.repos.d/grafana.repo with the following content:
5
sudo tee /etc/yum.repos.d/grafana.repo <<EOF
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF
6
For beta releases, change the baseurl to https://rpm-beta.grafana.com.
7
Install Grafana
8
For Grafana OSS:
9
sudo dnf install grafana
10
For Grafana Enterprise:
11
sudo dnf install grafana-enterprise
12
On older systems using YUM:
13
sudo yum install grafana-enterprise

Install from RPM Package

Manual installation using RPM packages requires you to manually update Grafana for each new version.
RPM files are signed and can be verified with the public GPG key.
1
Download and install
2
Visit the Grafana download page and:
3
  • Select your Grafana version
  • Choose your Edition (Enterprise or Open Source)
  • Select the Linux or ARM tab
  • Copy the RPM package URL
  • 4
    Install using DNF:
    5
    sudo dnf install <rpm-package-url>
    
    6
    Example:
    7
    sudo dnf install https://dl.grafana.com/enterprise/release/grafana-enterprise-11.0.0-1.x86_64.rpm
    
    8
    On older systems using YUM:
    9
    sudo yum install -y <rpm-package-url>
    

    Install as Standalone Binary

    For manual installation with full control over file locations:
    1
    Download and extract
    2
    Download the tarball from the Grafana download page and extract it:
    3
    wget <tarball-url>
    tar -zxvf grafana-<version>.linux-amd64.tar.gz
    
    4
    Create Grafana user
    5
    sudo useradd -r -s /bin/false grafana
    
    6
    Move to installation directory
    7
    sudo mv grafana-<version> /usr/local/grafana
    
    8
    Set ownership
    9
    sudo chown -R grafana:users /usr/local/grafana
    
    10
    Create systemd service file
    11
    sudo touch /etc/systemd/system/grafana-server.service
    
    12
    Add the following content:
    13
    [Unit]
    Description=Grafana Server
    After=network.target
    
    [Service]
    Type=simple
    User=grafana
    Group=users
    ExecStart=/usr/local/grafana/bin/grafana server --config=/usr/local/grafana/conf/grafana.ini --homepath=/usr/local/grafana
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
    14
    Initialize data directory
    15
    Manually start Grafana once to create the data directory:
    16
    /usr/local/grafana/bin/grafana-server --homepath /usr/local/grafana
    
    17
    Press Ctrl+C to stop, then update ownership:
    18
    sudo chown -R grafana:users /usr/local/grafana
    
    19
    Enable and start service
    20
    sudo systemctl daemon-reload
    sudo systemctl enable grafana-server
    sudo systemctl start grafana-server
    

    Start Grafana Server

    Using systemd

    Start the Grafana server:
    sudo systemctl start grafana-server
    
    Enable Grafana to start at boot:
    sudo systemctl enable grafana-server
    
    Check service status:
    sudo systemctl status grafana-server
    

    Using init.d

    Start Grafana:
    sudo service grafana-server start
    
    Enable at boot:
    sudo chkconfig grafana-server on
    

    Configuration

    After installation, Grafana uses these default paths:
    PathDescription
    /etc/grafana/grafana.iniConfiguration file
    /var/lib/grafanaData directory (SQLite database, plugins)
    /var/log/grafanaLog files
    /usr/share/grafanaInstallation directory
    /etc/grafana/provisioningProvisioning directory
    /etc/sysconfig/grafana-serverEnvironment variables

    Environment Variables File

    The systemd service reads environment variables from /etc/sysconfig/grafana-server:
    CONF_FILE=/etc/grafana/grafana.ini
    DATA_DIR=/var/lib/grafana
    LOG_DIR=/var/log/grafana
    PID_FILE_DIR=/run/grafana
    PLUGINS_DIR=/var/lib/grafana/plugins
    PROVISIONING_CFG_DIR=/etc/grafana/provisioning
    

    Systemd Service Configuration

    The Grafana systemd service (/usr/lib/systemd/system/grafana-server.service) includes:
    • Runs as non-root grafana user
    • Dependencies: PostgreSQL, MariaDB, MySQL, InfluxDB (waits for them if present)
    • Security hardening with restricted capabilities
    • File open limit: 10,000
    • Stop timeout: 20 seconds
    • Automatic restart on failure
    Service unit configuration:
    [Unit]
    Description=Grafana instance
    Documentation=http://docs.grafana.org
    Wants=network-online.target
    After=network-online.target
    After=postgresql.service mariadb.service mysql.service influxdb.service
    
    [Service]
    EnvironmentFile=/etc/sysconfig/grafana-server
    User=grafana
    Group=grafana
    Type=simple
    Restart=on-failure
    WorkingDirectory=/usr/share/grafana
    RuntimeDirectory=grafana
    RuntimeDirectoryMode=0750
    ExecStart=/usr/share/grafana/bin/grafana server \
      --config=${CONF_FILE} \
      --pidfile=${PID_FILE_DIR}/grafana-server.pid \
      --packaging=rpm \
      cfg:default.paths.logs=${LOG_DIR} \
      cfg:default.paths.data=${DATA_DIR} \
      cfg:default.paths.plugins=${PLUGINS_DIR} \
      cfg:default.paths.provisioning=${PROVISIONING_CFG_DIR}
    
    LimitNOFILE=10000
    TimeoutStopSec=20
    
    [Install]
    WantedBy=multi-user.target
    

    Firewall Configuration

    If you have firewalld enabled, allow traffic on port 3000:
    sudo firewall-cmd --permanent --add-port=3000/tcp
    sudo firewall-cmd --reload
    

    SELinux Configuration

    If SELinux is enforcing, you may need to configure it for Grafana:
    sudo semanage port -a -t http_port_t -p tcp 3000
    
    Or temporarily set SELinux to permissive mode:
    sudo setenforce 0
    

    Access Grafana

    After starting the server, access Grafana:
    1. Open your browser to http://localhost:3000
    2. Sign in with default credentials:
      • Username: admin
      • Password: admin
    3. Change the password when prompted

    Uninstall Grafana

    1
    Stop the service
    2
    For systemd:
    3
    sudo systemctl stop grafana-server
    
    4
    For init.d:
    5
    sudo service grafana-server stop
    
    6
    Remove the package
    7
    For Grafana OSS:
    8
    sudo dnf remove grafana
    
    9
    For Grafana Enterprise:
    10
    sudo dnf remove grafana-enterprise
    
    11
    On older systems using YUM:
    12
    sudo yum remove grafana-enterprise
    
    13
    Remove the repository (optional)
    14
    sudo rm -i /etc/yum.repos.d/grafana.repo
    
    15
    Remove data (optional)
    16
    sudo rm -rf /var/lib/grafana
    sudo rm -rf /var/log/grafana
    sudo rm -rf /etc/grafana
    

    Troubleshooting

    View logs

    sudo journalctl -u grafana-server -f
    
    Or check log files:
    sudo tail -f /var/log/grafana/grafana.log
    

    Check service status

    sudo systemctl status grafana-server
    

    Verify installation

    grafana-server -v
    

    Port already in use

    If port 3000 is already in use, edit /etc/grafana/grafana.ini:
    [server]
    http_port = 3001
    
    Restart Grafana:
    sudo systemctl restart grafana-server
    

    Check firewall

    sudo firewall-cmd --list-all
    

    Check SELinux status

    getenforce
    sudo ausearch -m avc -ts recent
    

    Next Steps

    • Configure data sources
    • Set up authentication (LDAP, OAuth, SAML)
    • Configure SMTP for email notifications
    • Set up provisioning for dashboards and data sources
    • Configure an external database (MySQL or PostgreSQL)