2015-04-13 00:34:55 -05:00
|
|
|
---
|
|
|
|
page_title: Installing on Debian / Ubuntu
|
|
|
|
page_description: Grafana Installation guide for Debian / Ubuntu.
|
|
|
|
page_keywords: grafana, installation, debian, ubuntu, guide
|
|
|
|
---
|
|
|
|
|
|
|
|
# Installing on Debian / Ubuntu
|
|
|
|
|
|
|
|
## Download
|
|
|
|
|
|
|
|
Description | Download
|
|
|
|
------------ | -------------
|
2015-08-11 04:12:06 -05:00
|
|
|
.deb for Debian-based Linux | [grafana_2.1.1_amd64.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_2.1.1_amd64.deb)
|
2015-04-13 00:34:55 -05:00
|
|
|
|
|
|
|
## Install
|
|
|
|
|
2015-08-11 04:12:06 -05:00
|
|
|
$ wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.1.1_amd64.deb
|
2015-04-13 00:34:55 -05:00
|
|
|
$ sudo apt-get install -y adduser libfontconfig
|
2015-08-11 04:12:06 -05:00
|
|
|
$ sudo dpkg -i grafana_2.1.1_amd64.deb
|
2015-04-13 00:34:55 -05:00
|
|
|
|
2015-04-14 09:28:57 -05:00
|
|
|
## APT Repository
|
2015-05-10 15:15:34 -05:00
|
|
|
Add the following line to your `/etc/apt/sources.list` file.
|
2015-04-14 09:28:57 -05:00
|
|
|
|
2015-04-20 05:33:32 -05:00
|
|
|
deb https://packagecloud.io/grafana/stable/debian/ wheezy main
|
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
Use the above line even if you are on Ubuntu or another Debian version.
|
|
|
|
There is also a testing repository if you want beta or release
|
|
|
|
candidates.
|
2015-04-14 09:28:57 -05:00
|
|
|
|
2015-04-20 05:33:32 -05:00
|
|
|
deb https://packagecloud.io/grafana/testing/debian/ wheezy main
|
2015-04-14 09:28:57 -05:00
|
|
|
|
2015-05-10 15:52:40 -05:00
|
|
|
Then add the [Package Cloud](https://packagecloud.io/grafana) key. This
|
|
|
|
allows you to install signed packages.
|
2015-04-14 09:28:57 -05:00
|
|
|
|
|
|
|
$ curl https://packagecloud.io/gpg.key | sudo apt-key add -
|
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
Update your Apt repositories and install Grafana
|
2015-04-14 09:28:57 -05:00
|
|
|
|
|
|
|
$ sudo apt-get update
|
|
|
|
$ sudo apt-get install grafana
|
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
On some older versions of Ubuntu and Debian you may need to install the
|
|
|
|
`apt-transport-https` package which is needed to fetch packages over
|
|
|
|
HTTPS.
|
2015-04-14 09:28:57 -05:00
|
|
|
|
|
|
|
$ sudo apt-get install -y apt-transport-https
|
|
|
|
|
2015-04-13 00:34:55 -05:00
|
|
|
## Package details
|
|
|
|
|
|
|
|
- Installs binary to `/usr/sbin/grafana-server`
|
2015-05-10 15:52:40 -05:00
|
|
|
- Installs Init.d script to `/etc/init.d/grafana-server`
|
|
|
|
- Creates default file (environment vars) to `/etc/default/grafana-server`
|
|
|
|
- Installs configuration file to `/etc/grafana/grafana.ini`
|
|
|
|
- Installs systemd service (if systemd is available) name `grafana-server.service`
|
2015-05-10 15:15:34 -05:00
|
|
|
- The default configuration sets the log file at `/var/log/grafana/grafana.log`
|
|
|
|
- The default configuration specifies an sqlite3 db at `/var/lib/grafana/grafana.db`
|
2015-04-13 00:34:55 -05:00
|
|
|
|
|
|
|
## Start the server (init.d service)
|
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
You can start Grafana by running:
|
2015-04-13 00:34:55 -05:00
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
$ sudo service grafana-server start
|
|
|
|
|
|
|
|
This will start the `grafana-server` process as the `grafana` user,
|
|
|
|
which was created during the 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:
|
2015-04-13 01:14:13 -05:00
|
|
|
|
|
|
|
$ sudo update-rc.d grafana-server defaults 95 10
|
2015-04-13 00:34:55 -05:00
|
|
|
|
2015-04-13 01:14:13 -05:00
|
|
|
## Start the server (via systemd)
|
2015-05-10 15:15:34 -05:00
|
|
|
|
|
|
|
To start the service using systemd.
|
|
|
|
|
2015-04-13 00:34:55 -05:00
|
|
|
$ systemctl daemon-reload
|
|
|
|
$ systemctl start grafana-server
|
|
|
|
$ systemctl status grafana-server
|
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
Enable the systemd service so that Grafana starts at boot.
|
2015-04-13 01:14:13 -05:00
|
|
|
|
|
|
|
sudo systemctl enable grafana-server.service
|
|
|
|
|
2015-04-13 00:34:55 -05:00
|
|
|
## Environment file
|
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
The systemd service file and init.d script both use the file located at
|
|
|
|
`/etc/default/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:34:55 -05:00
|
|
|
|
|
|
|
### Logging
|
|
|
|
|
2015-05-10 15:15:34 -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
|
|
|
|
upgrades. You can also use MySQL or Postgres as the Grafana database.
|
2015-04-13 00:34:55 -05:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2015-05-10 15:52:40 -05:00
|
|
|
The configuration file is located at `/etc/grafana/grafana.ini`. Go the
|
|
|
|
[Configuration](/installation/configuration) page for details on all
|
|
|
|
those options.
|
2015-04-13 00:34:55 -05:00
|
|
|
|
|
|
|
### Adding data sources
|
|
|
|
|
|
|
|
- [Graphite](../datasources/graphite.md)
|
|
|
|
- [InfluxDB](../datasources/influxdb.md)
|
|
|
|
- [OpenTSDB](../datasources/opentsdb.md)
|
|
|
|
|
2015-04-13 00:55:07 -05:00
|
|
|
## Installing from binary tar file
|
|
|
|
|
2015-05-10 15:15:34 -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-05-10 15:52:40 -05:00
|
|
|
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
|
|
|
|
2015-05-10 15:15:34 -05:00
|
|
|
Start Grafana by executing `./grafana web`. The `grafana` 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
|
|
|
|
|
|
|
|