---
title: "Install Grafana on Debian or Ubuntu | Grafana documentation"
description: "Install guide for Grafana on Debian or Ubuntu"
---

# Install Grafana on Debian or Ubuntu

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.

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.

> Note
> 
> If you install via the `.deb` package or `.tar.gz` file, then you must manually update Grafana for each new version.

The following video demonstrates how to install Grafana on Debian and Ubuntu as outlined in this document:

## Install from APT repository

If you install from the APT repository, Grafana automatically updates when you run `apt-get update`.

Expand table

| 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`   |

> 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](/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).

Complete the following steps to install Grafana from the APT repository:

1. Install the prerequisite packages:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   sudo apt-get install -y apt-transport-https wget gnupg
   ```
2. Import the GPG key:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   sudo mkdir -p /etc/apt/keyrings
   sudo wget -O /etc/apt/keyrings/grafana.asc https://apt.grafana.com/gpg-full.key
   sudo chmod 644 /etc/apt/keyrings/grafana.asc
   ```
3. To add a repository for stable releases, run the following command:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   echo "deb [signed-by=/etc/apt/keyrings/grafana.asc] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
   ```
4. To add a repository for beta releases, run the following command:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   echo "deb [signed-by=/etc/apt/keyrings/grafana.asc] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
   ```
5. Run the following command to update the list of available packages:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   # Updates the list of available packages
   sudo apt-get update
   ```
6. To install Grafana OSS, run the following command:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   # Installs the latest OSS release:
   sudo apt-get install grafana
   ```
7. To install Grafana Enterprise, run the following command:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   # Installs the latest Enterprise release:
   sudo apt-get install grafana-enterprise
   ```

## Install Grafana using a deb package

If you install Grafana manually using the deb package, then you must manually update Grafana for each new version.

Complete the following steps to install Grafana using a deb package:

1. Navigate to the [Grafana download page](/grafana/download).
2. 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.
3. 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.
4. Depending on which system you are running, click the **Linux** or **ARM** tab on the [download page](/grafana/download).
5. Copy and paste the code from the [download page](/grafana/download) into your command line and run.

## Install Grafana as a standalone binary

Complete the following steps to install Grafana using the standalone binaries:

01. Navigate to the [Grafana download page](/grafana/download).
02. 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.
03. 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.
04. Depending on which system you are running, click the **Linux** or **ARM** tab on the [download page](/grafana/download).
05. Copy and paste the code from the [download page](/grafana/download) page into your command line and run.
06. Create a user account for Grafana on your system:
    
    shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```shell
    sudo useradd -r -s /bin/false grafana
    ```
07. Move the unpacked binary to `/usr/local/grafana`:
    
    shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```shell
    sudo mv <DOWNLOAD PATH> /usr/local/grafana
    ```
08. Change the owner of `/usr/local/grafana` to Grafana users:
    
    shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```shell
    sudo chown -R grafana:users /usr/local/grafana
    ```
09. Create a Grafana server systemd unit file:
    
    shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```shell
    sudo touch /etc/systemd/system/grafana-server.service
    ```
10. Add the following to the unit file in a text editor of your choice:
    
    ini ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```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
    ```
11. Use the binary to manually start the Grafana server:
    
    shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```shell
    /usr/local/grafana/bin/grafana server --homepath /usr/local/grafana
    ```
    
    > 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.
12. Press `CTRL+C` to stop the Grafana server.
13. 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 ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
    
    ```shell
    sudo chown -R grafana:users /usr/local/grafana
    ```
14. [Configure the Grafana server to start at boot time using systemd](/docs/grafana/latest/setup-grafana/start-restart-grafana/#configure-the-grafana-server-to-start-at-boot-using-systemd).

## 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:

1. If you configured Grafana to run with systemd, stop the systemd service for Grafana server:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   sudo systemctl stop grafana-server
   ```
2. If you configured Grafana to run with init.d, stop the init.d service for Grafana server:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   sudo service grafana-server stop
   ```
3. To uninstall Grafana OSS:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   sudo apt-get remove grafana
   ```
4. To uninstall Grafana Enterprise:
   
   shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   sudo apt-get remove grafana-enterprise
   ```
5. Optional: To remove the Grafana repository:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   sudo rm -i /etc/apt/sources.list.d/grafana.list
   ```

## Next steps

- [Start the Grafana server](../../start-restart-grafana/)
