docs/sources/setup-grafana/installation/redhat-rhel-fedora/index.md
This topic explains how to install Grafana dependencies, install Grafana on RHEL or Fedora, and start the Grafana server on your system.
You can install Grafana from the RPM repository, from standalone RPM, or with the binary .tar.gz file.
If you install via RPM or the .tar.gz file, then you must manually update Grafana for each new version.
The following video demonstrates how to install Grafana on RHEL or Fedora as outlined in this document:
{{< youtube id="4khbLlyoqzE" >}}
If you install from the RPM repository, then Grafana is automatically updated every time you update your applications.
| Grafana Version | Package | Repository |
|---|---|---|
| Grafana Enterprise | grafana-enterprise | https://rpm.grafana.com |
| Grafana Enterprise (Beta) | grafana-enterprise | https://rpm-beta.grafana.com |
| Grafana OSS | grafana | https://rpm.grafana.com |
| Grafana OSS (Beta) | grafana | https://rpm-beta.grafana.com |
{{< admonition type="note" >}} Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS edition. You can also upgrade to the full Enterprise feature set, which has support for Enterprise plugins. {{< /admonition >}}
To install Grafana from the RPM repository, complete the following steps:
{{< admonition type="note" >}} If you wish to install beta versions of Grafana, substitute the repository URL for the beta URL listed above. {{< /admonition >}}
Import the GPG key:
wget -q -O gpg.key https://rpm.grafana.com/gpg.key
sudo rpm --import gpg.key
Create /etc/yum.repos.d/grafana.repo with the following content:
[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
To install Grafana OSS, run the following command:
sudo dnf install grafana
To install Grafana Enterprise, run the following command:
sudo dnf install grafana-enterprise
If you install Grafana manually using YUM or RPM, then you must manually update Grafana for each new version. This method varies according to which Linux OS you are running.
Note: The RPM files are signed. You can verify the signature with this public GPG key.
On the Grafana download page, select the Grafana version you want to install.
Select an Edition.
Depending on which system you are running, click Linux or ARM.
Copy and paste the RPM package URL and the local RPM package information from the download page into the pattern shown below and run the command.
sudo yum install -y <rpm package url>
If you install Grafana manually using the standalone binaries, then you must manually update Grafana for each new version.
Complete the following steps to install Grafana using the standalone binaries:
Navigate to the Grafana download page.
Select the Grafana version you want to install.
Select an Edition.
Depending on which system you are running, click the Linux or ARM tab on the download page.
Copy and paste the code from the download page page into your command line and run.
Create a user account for Grafana on your system:
sudo useradd -r -s /bin/false grafana
Move the unpacked binary to /usr/local/grafana:
sudo mv <DOWNLOAD PATH> /usr/local/grafana
Change the owner of /usr/local/grafana to Grafana users:
sudo chown -R grafana:users /usr/local/grafana
Create a Grafana server systemd unit file:
sudo touch /etc/systemd/system/grafana-server.service
Add the following to the unit file in a text editor of your choice:
[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
Use the binary to manually start the Grafana server:
/usr/local/grafana/bin/grafana-server --homepath /usr/local/grafana
{{< admonition type="note" >}}
Manually invoking the binary in this step automatically creates the /usr/local/grafana/data directory, which needs to be created and configured before the installation can be considered complete.
{{< /admonition >}}
Press CTRL+C to stop the Grafana server.
Change the owner of /usr/local/grafana to Grafana users again to apply the ownership to the newly created /usr/local/grafana/data directory:
sudo chown -R grafana:users /usr/local/grafana
Configure the Grafana server to start at boot time using systemd.
To uninstall Grafana, run the following commands in a terminal window:
If you configured Grafana to run with systemd, stop the systemd service for Grafana server:
sudo systemctl stop grafana-server
If you configured Grafana to run with init.d, stop the init.d service for Grafana server:
sudo service grafana-server stop
To uninstall Grafana OSS:
sudo dnf remove grafana
To uninstall Grafana Enterprise:
sudo dnf remove grafana-enterprise
Optional: To remove the Grafana repository:
sudo rm -i /etc/yum.repos.d/grafana.repo
Refer to Start the Grafana server.