2016-10-21 04:01:34 -05:00
+++
title = "Installing on RPM-based Linux"
description = "Grafana Installation guide for Centos, Fedora, OpenSuse, Redhat."
keywords = ["grafana", "installation", "documentation", "centos", "fedora", "opensuse", "redhat"]
2016-12-16 10:36:01 -06:00
aliases = ["installation/installation/rpm"]
2016-10-21 04:01:34 -05:00
type = "docs"
[menu.docs]
name = "Installing on Centos / Redhat"
identifier = "rpm"
parent = "installation"
weight = 2
+++
2015-04-13 00:55:07 -05:00
# Installing on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat)
Description | Download
------------ | -------------
2018-06-25 10:22:31 -05:00
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [x86-64 ](https://grafana.com/grafana/download?platform=linux )
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [ARM64 ](https://grafana.com/grafana/download?platform=arm )
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [ARMv7 ](https://grafana.com/grafana/download?platform=arm )
2015-04-13 00:55:07 -05:00
2018-06-25 10:22:31 -05:00
Read [Upgrading Grafana ]({{< relref "installation/upgrading.md" >}} ) for tips and guidance on updating an existing installation.
2017-04-28 03:58:26 -05:00
2016-10-21 04:01:34 -05:00
## Install Stable
2015-05-10 15:52:40 -05:00
You can install Grafana using Yum directly.
2015-04-14 09:49:42 -05:00
2017-10-05 12:01:03 -05:00
```bash
2018-06-25 10:22:31 -05:00
$ sudo yum install < rpm package url >
2018-02-05 09:02:17 -06:00
```
2018-06-25 10:22:31 -05:00
Example:
2018-04-20 06:23:45 -05:00
```bash
2018-06-25 10:22:31 -05:00
$ sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.4-1.x86_64.rpm
```
2018-04-20 06:23:45 -05:00
2018-06-25 10:22:31 -05:00
Or install manually using `rpm` . First execute
```bash
$ wget < rpm package url >
```
2015-04-13 00:55:07 -05:00
2018-06-25 10:22:31 -05:00
Example:
2015-10-24 01:03:58 -05:00
2017-10-05 12:01:03 -05:00
```bash
2018-06-19 08:00:45 -05:00
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.4-1.x86_64.rpm
2018-06-25 10:22:31 -05:00
```
### On CentOS / Fedora / Redhat:
```bash
2017-10-05 12:01:03 -05:00
$ sudo yum install initscripts fontconfig
2018-06-25 10:22:31 -05:00
$ sudo rpm -Uvh < local rpm package >
2017-10-05 12:01:03 -05:00
```
2015-04-13 00:55:07 -05:00
2018-06-25 10:22:31 -05:00
### On OpenSuse:
2015-10-24 00:53:30 -05:00
2017-10-05 12:01:03 -05:00
```bash
2018-06-25 10:22:31 -05:00
$ sudo rpm -i --nodeps < local rpm package >
2017-10-05 12:01:03 -05:00
```
2016-12-20 06:02:55 -06:00
2015-05-10 15:52:40 -05:00
## Install via YUM Repository
2015-04-14 09:49:42 -05:00
Add the following to a new file at `/etc/yum.repos.d/grafana.repo`
2017-10-05 12:01:03 -05:00
```bash
[grafana]
name=grafana
2018-03-28 08:35:51 -05:00
baseurl=https://packagecloud.io/grafana/stable/el/7/$basearch
2017-10-05 12:01:03 -05:00
repo_gpgcheck=1
enabled=1
gpgcheck=1
2017-10-12 23:00:22 -05:00
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
2017-10-05 12:01:03 -05:00
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
```
2015-04-14 09:49:42 -05:00
2017-09-18 02:08:42 -05:00
There is also a testing repository if you want beta or release candidates.
2015-04-20 05:33:32 -05:00
2017-10-05 12:01:03 -05:00
```bash
2018-03-28 08:35:51 -05:00
baseurl=https://packagecloud.io/grafana/testing/el/7/$basearch
2017-10-05 12:01:03 -05:00
```
2015-04-20 05:33:32 -05:00
2015-05-10 15:52:40 -05:00
Then install Grafana via the `yum` command.
2015-04-14 09:49:42 -05:00
2017-10-05 12:01:03 -05:00
```bash
$ sudo yum install grafana
```
2015-04-14 09:49:42 -05:00
2015-04-20 05:38:49 -05:00
### RPM GPG Key
2015-05-10 15:52:40 -05:00
The RPMs are signed, you can verify the signature with this [public GPG
key](https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana).
2015-04-20 05:38:49 -05:00
2015-04-13 00:55:07 -05:00
## Package details
- Installs binary to `/usr/sbin/grafana-server`
2015-05-10 15:52:40 -05:00
- Copies init.d script to `/etc/init.d/grafana-server`
- Installs default file (environment vars) to `/etc/sysconfig/grafana-server`
- Copies configuration file to `/etc/grafana/grafana.ini`
- Installs systemd service (if systemd is available) name `grafana-server.service`
- The default configuration uses a log file at `/var/log/grafana/grafana.log`
- The default configuration specifies an sqlite3 database at `/var/lib/grafana/grafana.db`
2015-04-13 00:55:07 -05:00
## Start the server (init.d service)
2015-05-10 15:52:40 -05:00
You can start Grafana by running:
2017-10-05 12:01:03 -05:00
```bash
$ sudo service grafana-server start
```
2015-05-10 15:52:40 -05:00
This will start the `grafana-server` process as the `grafana` user,
which is created during package installation. The default HTTP port is
`3000` , and default user and group is `admin` .
To configure the Grafana server to start at boot time:
2017-10-05 12:01:03 -05:00
```bash
$ sudo /sbin/chkconfig --add grafana-server
```
2015-04-13 00:55:07 -05:00
## Start the server (via systemd)
2017-10-05 12:01:03 -05:00
```bash
$ systemctl daemon-reload
$ systemctl start grafana-server
$ systemctl status grafana-server
```
2015-04-13 00:55:07 -05:00
2015-05-10 15:52:40 -05:00
### Enable the systemd service to start at boot
2015-04-13 01:14:13 -05:00
2017-10-05 12:01:03 -05:00
```bash
sudo systemctl enable grafana-server.service
```
2015-04-13 01:14:13 -05:00
2015-04-13 00:55:07 -05:00
## Environment file
2015-05-10 15:52:40 -05:00
The systemd service file and init.d script both use the file located at
`/etc/sysconfig/grafana-server` for environment variables used when
starting the back-end. Here you can override log directory, data
directory and other variables.
2015-04-13 00:55:07 -05:00
### Logging
2015-05-10 15:52:40 -05:00
By default Grafana will log to `/var/log/grafana`
2015-04-13 01:14:13 -05:00
### Database
2015-05-10 15:52:40 -05:00
The default configuration specifies a sqlite3 database located at
`/var/lib/grafana/grafana.db` . Please backup this database before
2016-10-21 04:01:34 -05:00
upgrades. You can also use MySQL or Postgres as the Grafana database, as detailed on [the configuration page ]({{< relref "configuration.md#database" >}} ).
2015-04-13 00:55:07 -05:00
## Configuration
2015-05-10 15:52:40 -05:00
The configuration file is located at `/etc/grafana/grafana.ini` . Go the
2016-10-21 04:01:34 -05:00
[Configuration ]({{< relref "configuration.md" >}} ) page for details on all
2015-05-10 15:52:40 -05:00
those options.
2015-04-13 00:55:07 -05:00
### Adding data sources
2017-02-06 11:04:34 -06:00
- [Graphite ]({{< relref "features/datasources/graphite.md" >}} )
- [InfluxDB ]({{< relref "features/datasources/influxdb.md" >}} )
- [OpenTSDB ]({{< relref "features/datasources/opentsdb.md" >}} )
- [Prometheus ]({{< relref "features/datasources/prometheus.md" >}} )
2016-10-21 04:01:34 -05:00
2016-11-16 11:49:14 -06:00
### Server side image rendering
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations,
for example in alert notifications.
If the image is missing text make sure you have font packages installed.
2017-10-05 12:01:03 -05:00
```bash
2016-11-16 11:49:14 -06:00
yum install fontconfig
yum install freetype*
yum install urw-fonts
```
2016-10-21 04:01:34 -05:00
## Installing from binary tar file
2017-03-21 09:37:55 -05:00
Download [the latest `.tar.gz` file ](https://grafana.com/get ) and
2016-10-21 04:01:34 -05:00
extract it. This will extract into a folder named after the version you
downloaded. This folder contains all files required to run Grafana. There are
no init scripts or install scripts in this package.
To configure Grafana add a configuration file named `custom.ini` to the
`conf` folder and override any of the settings defined in
`conf/defaults.ini` .
2015-04-13 00:55:07 -05:00
2016-10-21 04:01:34 -05:00
Start Grafana by executing `./bin/grafana-server web` . The `grafana-server`
binary needs the working directory to be the root install directory (where the
binary and the `public` folder is located).
2015-04-13 00:55:07 -05:00