2016-10-21 04:01:34 -05:00
+++
2019-12-05 12:51:08 -06:00
title = "Install on Debian/Ubuntu"
description = "Install guide for Grafana on Debian or Ubuntu"
2016-10-21 04:01:34 -05:00
keywords = ["grafana", "installation", "documentation"]
type = "docs"
2019-12-30 01:17:03 -06:00
aliases = ["/docs/grafana/latest/installation/installation/debian"]
2016-10-21 04:01:34 -05:00
[menu.docs]
identifier = "debian"
parent = "installation"
2019-11-13 06:04:06 -06:00
weight = 200
2016-10-21 04:01:34 -05:00
+++
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
# Install on Debian or Ubuntu
2015-04-13 00:34:55 -05:00
2020-01-10 11:38:54 -06:00
This page explains how to install Grafana dependencies, download and install Grafana, get the service up and running on your Debian or Ubuntu system, and the installation package details.
2017-04-28 03:58:26 -05:00
2019-12-30 10:04:02 -06:00
**Note on upgrading:** While the process for upgrading Grafana is very similar to installing Grafana, there are some key backup steps you should perform. Read [Upgrading Grafana ]({{< relref "upgrading.md" >}} ) for tips and guidance on updating an existing installation.
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
## 1. Download and install
2017-09-14 04:28:59 -05:00
2020-01-10 11:38:54 -06:00
You can install Grafana using our official APT repository, by downloading a `.deb` package, or by downloading a binary `.tar.gz` file.
2019-12-05 12:51:08 -06:00
2020-01-10 11:38:54 -06:00
### Install from APT repository
2018-02-05 09:02:17 -06:00
2020-01-10 11:38:54 -06:00
If you install from the APT repository, then Grafana is automatically updated every time you run `apt-get update` .
2018-04-20 06:23:45 -05:00
2020-01-24 09:33:59 -06:00
| Grafana Version | Package | Repository |
|-----------------|---------|------------|
| Grafana OSS | grafana | `https://packages.grafana.com/oss/deb stable main` |
| Grafana OSS (Beta) | grafana | `https://packages.grafana.com/oss/deb beta main` |
| Grafana Enterprise | grafana-enterprise | `https://packages.grafana.com/enterprise/deb stable main` |
| Grafana Enterprise (Beta) | grafana-enterprise | `https://packages.grafana.com/enterprise/deb beta main` |
2015-08-12 09:30:48 -05:00
2020-01-24 09:33:59 -06:00
> We recommend all users to install the Enterprise Edition of Grafana, which can be seamlessly upgraded with a Grafana Enterprise [subscription](https://grafana.com/products/enterprise/?utm_source=grafana-install-page).
#### To install the latest Enterprise edition:
2019-11-13 06:04:06 -06:00
2019-06-13 02:52:44 -05:00
```bash
2020-01-10 11:38:54 -06:00
sudo apt-get install -y apt-transport-https
2019-12-05 12:51:08 -06:00
sudo apt-get install -y software-properties-common wget
2019-12-19 08:48:16 -06:00
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
2020-01-24 09:33:59 -06:00
# Alternatively you can add the beta repository, see in the table above
sudo add-apt-repository "deb https://packages.grafana.com/enterprise/deb stable main"
2020-01-10 11:38:54 -06:00
sudo apt-get update
2020-01-24 09:33:59 -06:00
sudo apt-get install grafana-enterprise
2019-01-08 09:45:04 -06:00
```
2020-01-24 09:33:59 -06:00
#### To install the latest OSS release:
2015-04-14 09:28:57 -05:00
2017-10-05 12:01:03 -05:00
```bash
2020-01-10 11:38:54 -06:00
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
2020-01-24 09:33:59 -06:00
# Alternatively you can add the beta repository, see in the table above
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
2017-05-08 01:02:08 -05:00
sudo apt-get update
sudo apt-get install grafana
```
2015-04-14 09:28:57 -05:00
2020-01-08 03:38:31 -06:00
### Set up repository for ARM
If you have problems using `add-apt-repository` , you can set up the repository without it.
Add this repository for stable releases:
```bash
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```
Add this repository if you want beta releases:
```bash
echo "deb https://packages.grafana.com/oss/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```
2019-12-05 12:51:08 -06:00
### Install .deb package
2015-04-14 09:28:57 -05:00
2020-01-10 11:38:54 -06:00
If you install the `.deb` package, then you will need to manually update Grafana for each new version.
2015-04-14 09:28:57 -05:00
2020-01-10 11:38:54 -06:00
1. On the [Grafana download page ](https://grafana.com/grafana/download ), select the Grafana version you want to install.
* The most recent Grafana version is selected by default.
* The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
1. Select an **Edition** .
* **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
2020-01-24 09:33:59 -06:00
* **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
2020-01-10 11:38:54 -06:00
1. Depending on which system you are running, click **Linux** or **ARM** .
1. Copy and paste the code from the installation page into your command line and run. It follows the pattern shown below.
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
```bash
sudo apt-get install -y adduser libfontconfig1
2020-01-10 11:38:54 -06:00
wget < .deb package url >
sudo dpkg -i grafana< edition > _< version > _amd64.deb
2019-12-05 12:51:08 -06:00
```
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
## Install from binary .tar.gz file
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
Download the latest [`.tar.gz` file ](https://grafana.com/grafana/download?platform=linux ) and extract it. The files extract into a folder named after the Grafana version that you downloaded. This folder contains all files required to run Grafana. There are no init scripts or install scripts in this package.
2015-04-13 00:34:55 -05:00
2017-05-08 01:02:08 -05:00
```bash
2020-01-10 11:38:54 -06:00
wget < tar.gz package url >
2019-12-05 12:51:08 -06:00
sudo tar -zxvf < tar.gz package >
2017-05-08 01:02:08 -05:00
```
2015-05-10 15:15:34 -05:00
2019-12-05 12:51:08 -06:00
## 2. Start the server
This starts the `grafana-server` process as the `grafana` user, which was created during the package installation.
2015-05-10 15:15:34 -05:00
2019-12-05 12:51:08 -06:00
If you installed with the APT repository or `.deb` package, then you can start the server using `systemd` or `init.d` . If you installed a binary `.tar.gz` file, then you need to execute the binary.
2018-07-11 10:13:15 -05:00
2019-12-05 12:51:08 -06:00
### Start the server with systemd
2020-01-10 11:38:54 -06:00
To start the service and verify that the service has started:
2015-04-13 01:14:13 -05:00
2017-05-08 01:02:08 -05:00
```bash
2019-12-05 12:51:08 -06:00
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
2017-05-08 01:02:08 -05:00
```
2015-04-13 00:34:55 -05:00
2020-01-10 11:38:54 -06:00
Configure the Grafana server to start at boot:
2015-04-13 01:14:13 -05:00
2017-05-08 01:02:08 -05:00
```bash
sudo systemctl enable grafana-server.service
```
2015-04-13 01:14:13 -05:00
2019-12-05 12:51:08 -06:00
### Start the server with init.d
2020-01-10 11:38:54 -06:00
To start the service and verify that the service has started:
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
```bash
sudo service grafana-server start
sudo service grafana-server status
```
2015-04-13 01:14:13 -05:00
2019-12-05 12:51:08 -06:00
Configure the Grafana server to start at boot:
2015-04-13 01:14:13 -05:00
2019-12-05 12:51:08 -06:00
```bash
sudo update-rc.d grafana-server defaults
```
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
### Execute the binary
2015-04-13 00:34:55 -05:00
2020-01-10 11:38:54 -06:00
The `grafana-server` binary .tar.gz needs the working directory to be the root install directory where the binary and the `public` folder are located.
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
Start Grafana by running:
```bash
./bin/grafana-server web
```
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
## Package details
2015-04-13 00:34:55 -05:00
2019-12-05 12:51:08 -06:00
- Installs binary to `/usr/sbin/grafana-server`
- 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`
- 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`
- Installs HTML/JS/CSS and other Grafana files at `/usr/share/grafana`
2015-04-13 00:55:07 -05:00
2019-12-05 12:51:08 -06:00
## Next steps
2015-05-10 15:15:34 -05:00
2020-05-05 17:23:30 -05:00
Refer to the [Getting Started ]({{< relref "../getting-started/getting-started/" >}} ) guide for information about logging in, setting up data sources, and so on.
2015-04-13 00:55:07 -05:00
2019-12-05 12:51:08 -06:00
## Configure Grafana
2018-08-14 06:21:52 -05:00
2020-01-29 11:23:28 -06:00
Refer to the [Configuration ]({{< relref "configuration.md" >}} ) page for details on options for customizing your environment, logging, database, and so on.