$linuxjunkies
>

grafana-cli(1)

Command-line utility for managing Grafana server configuration, plugins, and authentication.

UbuntuDebianFedoraArch

Synopsis

grafana-cli [OPTIONS] COMMAND [ARGS]...

Description

grafana-cli is the command-line interface tool for Grafana, an open-source visualization and monitoring platform. It allows administrators to manage plugins, configure datasources, set up authentication, and perform administrative tasks without accessing the web UI.

The tool must be run on the same server where Grafana is installed and has access to the Grafana configuration and data directories. Common use cases include installing/updating plugins, managing provisioning, resetting admin passwords, and automating Grafana setup in containerized environments.

Common options

FlagWhat it does
--configPath to the Grafana config file (custom.ini)
--homepathPath to the Grafana home directory containing conf and data subdirectories
--pluginsDirDirectory where Grafana plugins are installed
--configOverridesOverride Grafana config options as key=value pairs
--versionShow grafana-cli version
--helpDisplay help information and available commands

Examples

Install the clock panel plugin from Grafana repository

grafana-cli plugins install grafana-clock-panel

List all available plugins in the Grafana plugin repository

grafana-cli plugins list-remote

Update all installed plugins to their latest versions

grafana-cli plugins update-all

Reset the Grafana admin user password (useful for locked-out scenarios)

grafana-cli admin reset-admin-password newpassword

List installed plugins with custom Grafana home directory

grafana-cli --homepath /var/lib/grafana plugins ls

Install a plugin from a custom URL instead of official repository

grafana-cli plugins install grafana-piechart-panel --pluginUrl https://custom-repo.com/plugin.zip

Remove an installed plugin

grafana-cli plugins uninstall grafana-clock-panel

Encrypt stored datasource passwords in Grafana database

grafana-cli admin data-migration encrypt

Related commands