Skip to main content

Installing Grafana

Grafana is available in two editions: Grafana Enterprise (recommended) and Grafana Open Source. Grafana Enterprise is free and includes all OSS features, with the option to upgrade to the full Enterprise feature set. This guide covers multiple installation methods to help you get Grafana running quickly.

Prerequisites

Before you begin, ensure you have:
  • A supported operating system (Linux, macOS, Windows, or Docker)
  • Appropriate system permissions for installation
  • Network access to download Grafana packages

Installation Methods

Docker

Run Grafana in a container with persistent storage

Debian/Ubuntu

Install using APT package manager

Standalone Binary

Run Grafana as a standalone application

Docker Compose

Deploy Grafana with docker-compose

Docker Installation

Docker is the fastest way to get Grafana running.

Quick Start

Run the latest Grafana Enterprise version:
Access Grafana at http://localhost:3000 with default credentials admin/admin.
  • docker run - Creates and starts a new container
  • -d - Runs container in detached mode (background)
  • -p 3000:3000 - Maps container port 3000 to host port 3000
  • --name=grafana - Assigns a name to the container for easy reference
  • grafana/grafana-enterprise - The Docker image to use

Persistent Storage with Docker Volumes

By default, Grafana data is lost when the container is removed. Use Docker volumes to persist your data:

Using Bind Mounts

For direct access to Grafana data on your host filesystem:

Environment Variables

Configure Grafana using environment variables:

Installing Plugins

Install plugins at container startup:
To specify a plugin version, use the format: plugin-name@version. Example: grafana-clock-panel@1.0.1

Managing Docker Containers

Docker Compose Installation

Docker Compose simplifies multi-container deployments.

Prerequisites

Verify Docker Compose is installed:

Basic Configuration

Create a docker-compose.yaml file:
docker-compose.yaml

Start and Manage

Debian Ubuntu Installation

Install Grafana on Debian or Ubuntu using the APT package manager.

Install from APT Repository

This method provides automatic updates when you run apt-get update.

Step 1: Install Prerequisites

Step 2: Add Grafana GPG Key

Step 3: Add Grafana Repository

For stable releases:
For beta releases:

Step 4: Update Package List

Step 5: Install Grafana

For Grafana Enterprise (recommended):
For Grafana OSS:

Step 6: Start Grafana Service

Access Grafana at http://localhost:3000 with default credentials admin/admin.

Install Using DEB Package

For manual installation without automatic updates:
  1. Navigate to the Grafana download page
  2. Select your desired version and edition
  3. Copy and run the installation commands provided
Example:

Standalone Binary Installation

Run Grafana as a standalone binary without package managers.

Step 1: Download Binary

Download the appropriate binary from the Grafana download page.

Step 2: Create Grafana User

Step 3: Extract and Move Binary

Step 4: Create Systemd Service

Create /etc/systemd/system/grafana-server.service:
/etc/systemd/system/grafana-server.service

Step 5: Initialize Data Directory

Start Grafana manually once to create the data directory:
Press CTRL+C to stop, then set ownership:

Step 6: Enable and Start Service

First Login

After installation:
  1. Open your browser and navigate to http://localhost:3000
  2. Login with default credentials:
    • Username: admin
    • Password: admin
  3. You’ll be prompted to change the password on first login
Change the default admin password immediately to secure your Grafana instance.

Configuration

Grafana configuration is stored in grafana.ini. Common configuration locations:
  • Docker: Use environment variables prefixed with GF_
  • APT install: /etc/grafana/grafana.ini
  • Standalone: /usr/local/grafana/conf/grafana.ini
Example environment variable mapping:

Uninstalling Grafana

Docker

Debian/Ubuntu

Standalone Binary

Next Steps

Create Your First Dashboard

Learn how to build visualizations

Add Data Sources

Connect Grafana to your data

Troubleshooting

If port 3000 is already occupied, map to a different port:
Access Grafana at http://localhost:3001
Ensure the Grafana user has proper permissions:
Check service logs: