2022-05-26 23:06:25 +08:00
---
aliases:
2022-12-10 00:36:04 +08:00
- ../../installation/debian/
- ../../installation/installation/debian/
2022-05-26 23:06:25 +08:00
description: Install guide for Grafana on Debian or Ubuntu
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
labels:
products:
- enterprise
- oss
2023-06-19 23:27:40 +08:00
menuTitle: Debian or Ubuntu
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
title: Install Grafana on Debian or Ubuntu
2022-06-03 00:57:22 +08:00
weight: 100
2022-05-26 23:06:25 +08:00
---
2015-04-13 13:34:55 +08:00
2023-03-23 01:41:17 +08:00
# Install Grafana on Debian or Ubuntu
2015-04-13 13:34:55 +08:00
2023-03-23 01:41:17 +08:00
This topic explains how to install Grafana dependencies, install Grafana on Linux Debian or Ubuntu, and start the Grafana server on your Debian or Ubuntu system.
2017-04-28 16:58:26 +08:00
2023-03-23 01:41:17 +08:00
There are multiple ways to install Grafana: using the Grafana Labs APT repository, by downloading a `.deb` package, or by downloading a binary `.tar.gz` file. Choose only one of the methods below that best suits your needs.
2022-11-08 20:10:56 +08:00
2025-02-12 01:42:30 +08:00
{{< admonition type = "note" > }}
2023-05-23 04:45:28 +08:00
If you install via the `.deb` package or `.tar.gz` file, then you must manually update Grafana for each new version.
2025-02-12 01:42:30 +08:00
{{< / admonition > }}
2022-11-08 20:10:56 +08:00
2024-06-04 01:38:02 +08:00
The following video demonstrates how to install Grafana on Debian and Ubuntu as outlined in this document:
2024-05-30 00:56:15 +08:00
{{< youtube id = "_Zk_XQSjF_Q" > }}
2023-03-23 01:41:17 +08:00
## Install from APT repository
2022-11-08 20:10:56 +08:00
2023-03-23 01:41:17 +08:00
If you install from the APT repository, Grafana automatically updates when you run `apt-get update` .
2018-04-20 19:23:45 +08:00
2022-11-08 20:10:56 +08:00
| Grafana Version | Package | Repository |
| ------------------------- | ------------------ | ------------------------------------- |
| Grafana Enterprise | grafana-enterprise | `https://apt.grafana.com stable main` |
| Grafana Enterprise (Beta) | grafana-enterprise | `https://apt.grafana.com beta main` |
| Grafana OSS | grafana | `https://apt.grafana.com stable main` |
| Grafana OSS (Beta) | grafana | `https://apt.grafana.com beta main` |
2015-08-12 22:30:48 +08:00
2025-02-12 01:42:30 +08:00
{{< admonition type = "note" > }}
2023-05-23 04:45:28 +08:00
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 ](/products/enterprise/?utm_source=grafana-install-page ), which has support for [Enterprise plugins ](/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page ).
2025-02-12 01:42:30 +08:00
{{< / admonition > }}
2020-01-24 23:33:59 +08:00
2023-03-23 01:41:17 +08:00
Complete the following steps to install Grafana from the APT repository:
2019-11-13 20:04:06 +08:00
2023-09-06 23:55:53 +08:00
1. Install the prerequisite packages:
2020-01-24 23:33:59 +08:00
2023-03-23 01:41:17 +08:00
```bash
2023-09-06 23:55:53 +08:00
sudo apt-get install -y apt-transport-https software-properties-common wget
```
1. Import the GPG key:
```bash
sudo mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
2023-03-23 01:41:17 +08:00
```
2020-01-24 23:33:59 +08:00
2023-03-23 01:41:17 +08:00
1. To add a repository for stable releases, run the following command:
2020-01-24 23:33:59 +08:00
2023-03-23 01:41:17 +08:00
```bash
2023-09-06 23:55:53 +08:00
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
2023-03-23 01:41:17 +08:00
```
2021-08-06 21:52:36 +08:00
2023-03-23 01:41:17 +08:00
1. To add a repository for beta releases, run the following command:
2020-07-09 22:25:10 +08:00
2023-03-23 01:41:17 +08:00
```bash
2023-09-06 23:55:53 +08:00
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
2023-03-23 01:41:17 +08:00
```
2020-07-09 22:25:10 +08:00
2023-06-24 01:20:20 +08:00
1. Run the following command to update the list of available packages:
2015-04-14 22:28:57 +08:00
2023-03-23 01:41:17 +08:00
```bash
2023-06-24 03:31:11 +08:00
# Updates the list of available packages
2023-03-23 01:41:17 +08:00
sudo apt-get update
2023-06-24 01:20:20 +08:00
```
2023-06-24 03:31:11 +08:00
1. To install Grafana OSS, run the following command:
2022-11-08 20:10:56 +08:00
2023-06-24 01:20:20 +08:00
```bash
2023-06-24 03:31:11 +08:00
# Installs the latest OSS release:
2023-03-23 01:41:17 +08:00
sudo apt-get install grafana
2023-06-24 01:20:20 +08:00
```
2023-03-23 01:41:17 +08:00
2023-06-24 03:31:11 +08:00
1. To install Grafana Enterprise, run the following command:
2023-06-24 01:20:20 +08:00
```bash
2023-06-24 03:31:11 +08:00
# Installs the latest Enterprise release:
2023-03-23 01:41:17 +08:00
sudo apt-get install grafana-enterprise
```
2020-07-09 22:25:10 +08:00
2025-02-12 01:42:30 +08:00
## Install Grafana using a deb package
2015-04-14 22:28:57 +08:00
2025-02-12 01:42:30 +08:00
If you install Grafana manually using the deb package, then you must manually update Grafana for each new version.
2015-04-14 22:28:57 +08:00
2025-02-12 01:42:30 +08:00
Complete the following steps to install Grafana using a deb package:
2023-03-23 01:41:17 +08:00
2023-05-18 22:50:20 +08:00
1. Navigate to the [Grafana download page ](/grafana/download ).
2023-03-23 01:41:17 +08:00
1. Select the Grafana version you want to install.
2021-08-06 21:52:36 +08:00
- The most recent Grafana version is selected by default.
2023-03-23 01:41:17 +08:00
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
2020-01-11 01:38:54 +08:00
1. Select an **Edition** .
2023-03-23 01:41:17 +08:00
- **Enterprise:** This is the recommended version. It is functionally identical to the open source version, but includes features you can unlock with a license, if you so choose.
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
2023-06-22 19:50:32 +08:00
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the [download page ](/grafana/download ).
1. Copy and paste the code from the [download page ](/grafana/download ) into your command line and run.
2015-04-13 13:34:55 +08:00
2025-02-12 01:42:30 +08:00
## Install Grafana as a standalone binary
Complete the following steps to install Grafana using the standalone binaries:
1. Navigate to the [Grafana download page ](/grafana/download ).
1. Select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
1. Select an **Edition** .
- **Enterprise:** This is the recommended version. It is functionally identical to the open source version but includes features you can unlock with a license if you so choose.
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the [download page ](/grafana/download ).
1. Copy and paste the code from the [download page ](/grafana/download ) page into your command line and run.
1. Create a user account for Grafana on your system:
```shell
sudo useradd -r -s /bin/false grafana
```
1. Move the unpacked binary to `/usr/local/grafana` :
```shell
sudo mv < DOWNLOAD PATH > /usr/local/grafana
```
1. Change the owner of `/usr/local/grafana` to Grafana users:
```shell
sudo chown -R grafana:users /usr/local/grafana
```
1. Create a Grafana server systemd unit file:
```shell
sudo touch /etc/systemd/system/grafana-server.service
```
1. Add the following to the unit file in a text editor of your choice:
```ini
[Unit]
Description=Grafana Server
After=network.target
[Service]
Type=simple
User=grafana
Group=users
ExecStart=/usr/local/grafana/bin/grafana server --config=/usr/local/grafana/conf/grafana.ini --homepath=/usr/local/grafana
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
1. Use the binary to manually start the Grafana server:
```shell
2025-06-30 18:58:35 +08:00
/usr/local/grafana/bin/grafana server --homepath /usr/local/grafana
2025-02-12 01:42:30 +08:00
```
{{< admonition type = "note" > }}
Manually invoking the binary in this step automatically creates the `/usr/local/grafana/data` directory, which needs to be created and configured before the installation can be considered complete.
{{< / admonition > }}
1. Press `CTRL+C` to stop the Grafana server.
1. Change the owner of `/usr/local/grafana` to Grafana users again to apply the ownership to the newly created `/usr/local/grafana/data` directory:
```shell
sudo chown -R grafana:users /usr/local/grafana
```
1. [Configure the Grafana server to start at boot time using systemd ](https://grafana.com/docs/grafana/latest/setup-grafana/start-restart-grafana/#configure-the-grafana-server-to-start-at-boot-using-systemd ).
2023-07-05 21:06:03 +08:00
## Uninstall on Debian or Ubuntu
Complete any of the following steps to uninstall Grafana.
To uninstall Grafana, run the following commands in a terminal window:
2024-08-23 19:44:11 +08:00
1. If you configured Grafana to run with systemd, stop the systemd service for Grafana server:
2023-07-05 21:06:03 +08:00
```shell
sudo systemctl stop grafana-server
```
1. If you configured Grafana to run with init.d, stop the init.d service for Grafana server:
```shell
sudo service grafana-server stop
```
1. To uninstall Grafana OSS:
```shell
sudo apt-get remove grafana
```
1. To uninstall Grafana Enterprise:
```shell
sudo apt-get remove grafana-enterprise
```
1. Optional: To remove the Grafana repository:
```bash
sudo rm -i /etc/apt/sources.list.d/grafana.list
```
2019-12-06 02:51:08 +08:00
## Next steps
2015-05-11 04:15:34 +08:00
2025-03-06 20:59:08 +08:00
- [Start the Grafana server ](../../start-restart-grafana/ )