Install on Debian or Ubuntu

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 also describes the installation package details.

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 for tips and guidance on updating an existing installation.

Note: You can use Grafana Cloud to avoid the overhead of installing, maintaining, and scaling your observability stack. The free forever plan includes Grafana, 10K Prometheus series, 50 GB logs, and more. Create a free account to get started.

1. Download and install

You can install Grafana using our official APT repository, by downloading a .deb package, or by downloading a binary .tar.gz file.

Install from APT repository

If you install from the APT repository, then Grafana is automatically updated every time you run apt-get update.

Grafana VersionPackageRepository
Grafana Enterprisegrafana-enterprisehttps://packages.grafana.com/enterprise/deb stable main
Grafana Enterprise (Beta)grafana-enterprisehttps://packages.grafana.com/enterprise/deb beta main
Grafana OSSgrafanahttps://packages.grafana.com/oss/deb stable main
Grafana OSS (Beta)grafanahttps://packages.grafana.com/oss/deb beta main

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.

To install the latest Enterprise edition:

  1. sudo apt-get install -y apt-transport-https
  2. sudo apt-get install -y software-properties-common wget
  3. wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

Add this repository for stable releases:

  1. echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

Add this repository if you want beta releases:

  1. echo "deb https://packages.grafana.com/enterprise/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

After you add the repository:

  1. sudo apt-get update
  2. sudo apt-get install grafana-enterprise

To install the latest OSS release:

  1. sudo apt-get install -y apt-transport-https
  2. sudo apt-get install -y software-properties-common wget
  3. wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

Add this repository for stable releases:

  1. 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:

  1. echo "deb https://packages.grafana.com/oss/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

After you add the repository:

  1. sudo apt-get update
  2. sudo apt-get install grafana

Install .deb package

If you install the .deb package, then you will need to manually update Grafana for each new version.

  1. On the Grafana download page, 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.
  2. 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.
    • Open Source - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
  3. Depending on which system you are running, click Linux or ARM.
  4. Copy and paste the code from the installation page into your command line and run. It follows the pattern shown below.
  1. sudo apt-get install -y adduser
  2. wget <.deb package url>
  3. sudo dpkg -i grafana<edition>_<version>_amd64.deb

Install from binary .tar.gz file

Download the latest .tar.gz file and extract it. The files extract into a folder named after the Grafana version downloaded. This folder contains all files required to run Grafana. There are no init scripts or install scripts in this package.

  1. wget <tar.gz package url>
  2. sudo tar -zxvf <tar.gz package>

2. Start the server

This starts the grafana-server process as the grafana user, which was created during the package installation.

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.

Start the server with systemd

To start the service and verify that the service has started:

  1. sudo systemctl daemon-reload
  2. sudo systemctl start grafana-server
  3. sudo systemctl status grafana-server

Configure the Grafana server to start at boot:

  1. sudo systemctl enable grafana-server.service

Serving Grafana on a port < 1024

If you are using systemd and want to start Grafana on a port that is less than 1024, then you must add a systemd unit override.

  1. The following command creates an override file in your configured editor:
  1. # Alternatively, create a file in /etc/systemd/system/grafana-server.service.d/override.conf
  2. systemctl edit grafana-server.service

1 Add these additional settings to grant the CAP_NET_BIND_SERVICE capability. To read more about capabilities, see the manual page on capabilities.

  1. [Service]
  2. # Give the CAP_NET_BIND_SERVICE capability
  3. CapabilityBoundingSet=CAP_NET_BIND_SERVICE
  4. AmbientCapabilities=CAP_NET_BIND_SERVICE
  5. # A private user cannot have process capabilities on the host's user
  6. # namespace and thus CAP_NET_BIND_SERVICE has no effect.
  7. PrivateUsers=false

Start the server with init.d

To start the service and verify that the service has started:

  1. sudo service grafana-server start
  2. sudo service grafana-server status

Configure the Grafana server to start at boot:

  1. sudo update-rc.d grafana-server defaults

Execute the binary

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.

Start Grafana by running:

  1. ./bin/grafana-server web

Package details

  • 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 a SQLite3 db at /var/lib/grafana/grafana.db
  • Installs HTML/JS/CSS and other Grafana files at /usr/share/grafana

Next steps

Refer to the Getting Started guide for information about logging in, setting up data sources, and so on.

Configure Grafana

Refer to the Configuration page for details on options for customizing your environment, logging, database, and so on.