2015-03-10 02:55:42 -05:00
|
|
|
---
|
|
|
|
page_title: Grafana Installation
|
|
|
|
page_description: Install guide for Grafana.
|
|
|
|
page_keywords: grafana, installation, documentation
|
|
|
|
---
|
|
|
|
|
|
|
|
# Installation
|
2015-03-10 11:25:11 -05:00
|
|
|
Grafana is easily installed via a Debian/Ubuntu package (.deb), via Redhat/Centos package (.rpm) or manually via
|
2015-03-10 11:54:07 -05:00
|
|
|
a tar that contains all required files and binaries. If you can't find a package or binary for your platform you might be able
|
2015-03-10 11:25:11 -05:00
|
|
|
to build one your self, read [build from source](../project/building_from_source) instructions for more information.
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:54:07 -05:00
|
|
|
## Ubuntu & Debian
|
2015-03-30 05:31:12 -05:00
|
|
|
Start by [downloading](http://grafana.org/download) the latest `.deb` package.
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
To install the package
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
$ sudo apt-get install -y adduser libfontconfig
|
2015-03-11 09:13:52 -05:00
|
|
|
$ sudo dpkg -i grafana_latest_amd64.deb
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:54:07 -05:00
|
|
|
## Redhat & Centos
|
2015-03-30 05:31:12 -05:00
|
|
|
Start by [downloading](http://grafana.org/download) the latest `.rpm` package.
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
$ sudo yum install initscripts fontconfig
|
2015-03-11 09:13:52 -05:00
|
|
|
$ sudo rpm -Uvh grafana-latest-1.x86_64.rpm
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:25:11 -05:00
|
|
|
On Redhat/RHEL 5.10 you need to add the grafana user before executing the above.
|
|
|
|
Execute this to add a grafana user:
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-11 09:13:52 -05:00
|
|
|
sudo useradd -r grafana
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:25:11 -05:00
|
|
|
### Package details
|
|
|
|
The `.deb` and the `rpm` package install will do the following
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
- Install binary to `/usr/sbin/grafana-server`
|
|
|
|
- Init.d script to `/etc/init.d/grafana-server`
|
|
|
|
- Default file (environment vars) to `/etc/default/grafana-server` (deb package) or `/etc/sysconfig/grafana-server` (for the rpm package)
|
|
|
|
- Configuration file to `/etc/grafana/grafana.ini`
|
|
|
|
- Systemd service (if systemd is available) name `grafana-server.service`
|
2015-03-10 11:25:11 -05:00
|
|
|
- The default configuration specifies log file at `/var/log/grafana/grafana.log`
|
2015-04-12 14:28:01 -05:00
|
|
|
- The default configuration specifies sqlite3 db at `/var/lib/grafana/grafana.db`
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
### Start the server (init.d service)
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
- Start grafana by `sudo service grafana-server start`
|
|
|
|
- This will start the grafana-server process as the `grafana` user (created during package install)
|
2015-03-10 11:25:11 -05:00
|
|
|
- Default http port is `3000`, and default user is admin/admin
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
### Start the server (via systemd)
|
|
|
|
|
|
|
|
$ systemctl daemon-reload
|
|
|
|
$ systemctl start grafana-server
|
|
|
|
$ systemctl status grafana-server
|
|
|
|
|
|
|
|
## Manual install from binary tar file
|
2015-03-10 11:25:11 -05:00
|
|
|
Start by [downloading](http://grafana.org/download/builds) the latest `.tar.gz` file and 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.
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:25:11 -05:00
|
|
|
To configure grafana add a config file named `custom.ini` to the `conf` folder and override any of the settings defined in
|
|
|
|
`conf/defaults.ini`. Start grafana by excecuting `./grafana web`. The grafana binary needs the working directory
|
|
|
|
to be the root install dir (where the binary is and the public folder is located).
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:25:11 -05:00
|
|
|
## Dependencies
|
|
|
|
There are no dependencies with the default configuration. You can switch from a sqlite3 database to mysql or postgres but
|
|
|
|
that is optional. For small to medium setups sqlite3 should suffice.
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:25:11 -05:00
|
|
|
## Install using provisioning
|
|
|
|
If you prefer to install grafana via Puppet, Ansible, Docker or Chef. [This page](provisioning) has compiled a
|
|
|
|
list of repositories for different provisioning systems
|
2015-03-10 02:55:42 -05:00
|
|
|
|
2015-03-10 11:54:07 -05:00
|
|
|
## Install from offical docker image
|
|
|
|
|
|
|
|
Grafana has an offical docker container.
|
|
|
|
|
2015-04-12 14:28:01 -05:00
|
|
|
$ docker run -i -p 3000:3000 grafana/grafana
|
2015-03-10 11:54:07 -05:00
|
|
|
|
|
|
|
All grafana configuration settings can be defined using ENVIRONMENT variables, this is especially useful when using the
|
|
|
|
above container.
|
|
|
|
|
2015-03-12 09:10:27 -05:00
|
|
|
### Docker volumes & ENV config
|
|
|
|
|
|
|
|
The docker container exposes two volumes, the sqlite3 database in the folder `/opt/grafana/data` and
|
|
|
|
configuration files in the `/opt/grafana/conf` folder. You can map these volumes to host folders when you start the container:
|
|
|
|
|
|
|
|
$ docker run -d -p 3000:3000 \
|
|
|
|
-v /var/grafana/data:/opt/grafana/data \
|
|
|
|
-e "GF_SECURITY_ADMIN_PASSWORD=secret \
|
|
|
|
grafana/grafana:develop
|
|
|
|
|
|
|
|
In the above example I map the data folder and set a config option via an `ENV` variable.
|
|
|
|
|
2015-03-10 11:54:07 -05:00
|
|
|
## Configuration
|
|
|
|
|
2015-03-11 09:13:52 -05:00
|
|
|
The backend web server has a number of configuration options. Go the [Configuration](configuration) page for details
|
|
|
|
on all those options.
|
2015-03-10 11:54:07 -05:00
|
|
|
|