grafana-cli(1)
Command-line utility for managing Grafana server configuration, plugins, and authentication.
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
| Flag | What it does |
|---|---|
--config | Path to the Grafana config file (custom.ini) |
--homepath | Path to the Grafana home directory containing conf and data subdirectories |
--pluginsDir | Directory where Grafana plugins are installed |
--configOverrides | Override Grafana config options as key=value pairs |
--version | Show grafana-cli version |
--help | Display help information and available commands |
Examples
Install the clock panel plugin from Grafana repository
grafana-cli plugins install grafana-clock-panelList all available plugins in the Grafana plugin repository
grafana-cli plugins list-remoteUpdate all installed plugins to their latest versions
grafana-cli plugins update-allReset the Grafana admin user password (useful for locked-out scenarios)
grafana-cli admin reset-admin-password newpasswordList installed plugins with custom Grafana home directory
grafana-cli --homepath /var/lib/grafana plugins lsInstall a plugin from a custom URL instead of official repository
grafana-cli plugins install grafana-piechart-panel --pluginUrl https://custom-repo.com/plugin.zipRemove an installed plugin
grafana-cli plugins uninstall grafana-clock-panelEncrypt stored datasource passwords in Grafana database
grafana-cli admin data-migration encrypt