Skip to main content

Debian/Ubuntu Installation

This guide covers installing Grafana on Debian or Ubuntu Linux systems using the APT repository or standalone DEB packages.

Installation Methods

You can install Grafana on Debian/Ubuntu using:
  • APT repository (recommended): Automatic updates via apt-get update
  • DEB package: Manual installation from downloaded package
  • Standalone binary: Manual installation from tarball

Install from APT Repository

Installing from the APT repository enables automatic updates when you run apt-get update.

Available Repositories

EditionPackageRepository
Grafana Enterprisegrafana-enterprisehttps://apt.grafana.com stable main
Grafana Enterprise (Beta)grafana-enterprisehttps://apt.grafana.com beta main
Grafana OSSgrafanahttps://apt.grafana.com stable main
Grafana OSS (Beta)grafanahttps://apt.grafana.com beta main
Grafana Enterprise is the recommended edition. It’s free and includes all OSS features, with the option to upgrade to the full Enterprise feature set.
1
Install prerequisite packages
2
sudo apt-get install -y apt-transport-https wget gnupg
3
Import the GPG key
4
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
5
Add the repository
6
For stable releases:
7
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
8
For beta releases:
9
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
10
Update package list
11
sudo apt-get update
12
Install Grafana
13
For Grafana OSS:
14
sudo apt-get install grafana
15
For Grafana Enterprise:
16
sudo apt-get install grafana-enterprise

Install from DEB Package

Manual installation using DEB packages requires you to manually update Grafana for each new version.
1
Download the package
2
Visit the Grafana download page and:
3
  • Select your Grafana version
  • Choose your Edition (Enterprise or Open Source)
  • Select the Linux or ARM tab
  • Copy the download URL
  • 4
    Install the package
    5
    sudo apt-get install -y adduser libfontconfig1 musl
    wget <deb-package-url>
    sudo dpkg -i grafana_<version>_amd64.deb
    
    6
    Example:
    7
    wget https://dl.grafana.com/enterprise/release/grafana-enterprise_11.0.0_amd64.deb
    sudo dpkg -i grafana-enterprise_11.0.0_amd64.deb
    

    Install as Standalone Binary

    For manual installation with full control over file locations:
    1
    Download and extract
    2
    Download the tarball from the Grafana download page and extract it:
    3
    wget <tarball-url>
    tar -zxvf grafana-<version>.linux-amd64.tar.gz
    
    4
    Create Grafana user
    5
    sudo useradd -r -s /bin/false grafana
    
    6
    Move to installation directory
    7
    sudo mv grafana-<version> /usr/local/grafana
    
    8
    Set ownership
    9
    sudo chown -R grafana:users /usr/local/grafana
    
    10
    Create systemd service file
    11
    sudo touch /etc/systemd/system/grafana-server.service
    
    12
    Add the following content:
    13
    [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
    
    14
    Initialize data directory
    15
    Manually start Grafana once to create the data directory:
    16
    /usr/local/grafana/bin/grafana server --homepath /usr/local/grafana
    
    17
    Press Ctrl+C to stop, then update ownership:
    18
    sudo chown -R grafana:users /usr/local/grafana
    
    19
    Enable and start service
    20
    sudo systemctl daemon-reload
    sudo systemctl enable grafana-server
    sudo systemctl start grafana-server
    

    Start Grafana Server

    Using systemd

    Start the Grafana server:
    sudo systemctl start grafana-server
    
    Enable Grafana to start at boot:
    sudo systemctl enable grafana-server
    
    Check service status:
    sudo systemctl status grafana-server
    

    Using init.d

    Start Grafana:
    sudo service grafana-server start
    
    Enable at boot:
    sudo update-rc.d grafana-server defaults
    

    Configuration

    After installation, Grafana uses these default paths:
    PathDescription
    /etc/grafana/grafana.iniConfiguration file
    /var/lib/grafanaData directory (SQLite database, plugins)
    /var/log/grafanaLog files
    /usr/share/grafanaInstallation directory
    /etc/grafana/provisioningProvisioning directory
    /etc/default/grafana-serverEnvironment variables

    Environment Variables File

    The systemd service reads environment variables from /etc/default/grafana-server:
    CONF_FILE=/etc/grafana/grafana.ini
    DATA_DIR=/var/lib/grafana
    LOG_DIR=/var/log/grafana
    PID_FILE_DIR=/run/grafana
    PLUGINS_DIR=/var/lib/grafana/plugins
    PROVISIONING_CFG_DIR=/etc/grafana/provisioning
    

    Systemd Service Configuration

    The Grafana systemd service includes security hardening:
    • Runs as non-root grafana user (UID 472)
    • Capability restrictions with CapabilityBoundingSet=
    • Protected system directories
    • Restricted system calls
    • File open limit: 10,000
    • Stop timeout: 20 seconds

    Access Grafana

    After starting the server, access Grafana:
    1. Open your browser to http://localhost:3000
    2. Sign in with default credentials:
      • Username: admin
      • Password: admin
    3. Change the password when prompted

    Uninstall Grafana

    1
    Stop the service
    2
    For systemd:
    3
    sudo systemctl stop grafana-server
    
    4
    For init.d:
    5
    sudo service grafana-server stop
    
    6
    Remove the package
    7
    For Grafana OSS:
    8
    sudo apt-get remove grafana
    
    9
    For Grafana Enterprise:
    10
    sudo apt-get remove grafana-enterprise
    
    11
    Remove the repository (optional)
    12
    sudo rm -i /etc/apt/sources.list.d/grafana.list
    
    13
    Remove data (optional)
    14
    sudo rm -rf /var/lib/grafana
    sudo rm -rf /var/log/grafana
    sudo rm -rf /etc/grafana
    

    Troubleshooting

    View logs

    sudo journalctl -u grafana-server -f
    
    Or check log files:
    sudo tail -f /var/log/grafana/grafana.log
    

    Check service status

    sudo systemctl status grafana-server
    

    Verify installation

    grafana-server -v
    

    Port already in use

    If port 3000 is already in use, edit /etc/grafana/grafana.ini:
    [server]
    http_port = 3001
    
    Restart Grafana:
    sudo systemctl restart grafana-server
    

    Next Steps

    • Configure data sources
    • Set up authentication (LDAP, OAuth, SAML)
    • Configure SMTP for email notifications
    • Set up provisioning for dashboards and data sources
    • Configure an external database (MySQL or PostgreSQL)

    Build docs developers (and LLMs) love