Skip to content
Latchkey

grafana-cli: Usage, Options & Common CI Errors

grafana-cli installs Grafana plugins and runs admin tasks from the shell.

grafana-cli is mostly used in CI to bake plugins into a Grafana image. The classic snag is the plugins directory: the CLI and the server must agree on where plugins live.

What it does

grafana-cli manages Grafana plugins (install, update, remove, list) and offers admin utilities like resetting the admin password. In image builds it pre-installs the plugins a dashboard depends on.

Common usage

Terminal
grafana-cli plugins install grafana-piechart-panel
grafana-cli plugins install grafana-clock-panel 2.1.3   # pin a version
grafana-cli --pluginsDir /var/lib/grafana/plugins plugins install grafana-worldmap-panel
grafana-cli plugins list-remote
grafana-cli admin reset-admin-password ${NEW_PASS}

Options

Subcommand / flagWhat it does
plugins install <id> [version]Install (optionally a specific version)
plugins update-allUpdate every installed plugin
plugins list-remoteList installable plugins
--pluginsDir <path>Where to install plugins
--pluginUrl <url>Install from a custom URL/zip
admin reset-admin-passwordReset the admin user password

Common errors in CI

"Error: ✗ Failed to send request: ... no such host" or a timeout means the runner cannot reach grafana.com - use --pluginUrl with a vendored zip in air-gapped CI. "permission denied" writing the plugins dir: the build user lacks write access; chown the dir or pass --pluginsDir to a writable path. Installing into the wrong directory means the running server (different GF_PATHS_PLUGINS) never sees the plugin. Pin versions ("plugins install id X.Y.Z") so builds are reproducible.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →