Skip to content
Latchkey

grafana-cli plugins install in CI Images

grafana-cli plugins install <plugin-id> downloads and installs a Grafana plugin, used when baking a custom Grafana image in CI.

When you build a Grafana container with extra panels or data sources, grafana-cli plugins install fetches them at build time so the running instance ships with the plugins already present.

What it does

grafana-cli plugins install fetches a plugin by id (optionally a specific version) from the Grafana catalog and unpacks it into the plugins directory. In a Dockerfile you run it during build so the image is self-contained.

Common usage

Dockerfile
grafana-cli plugins install grafana-piechart-panel
# pin a version
grafana-cli plugins install grafana-clock-panel 2.1.3
# explicit plugins dir (common in custom images)
grafana-cli --pluginsDir /var/lib/grafana/plugins \
  plugins install grafana-worldmap-panel

Options

Flag / argWhat it does
plugins install <id> [version]Install a plugin, optionally pinned
--pluginsDir <dir>Target plugins directory
--pluginUrl <url>Install from a direct zip URL
--insecureSkip TLS verification (avoid)
plugins list-remoteList installable plugins

In CI

Pin every plugin version so image builds are reproducible; an unpinned install pulls the latest and can change behavior between builds. The official grafana/grafana image also reads GF_INSTALL_PLUGINS to install at container start, which is an alternative to running grafana-cli in the Dockerfile.

Common errors in CI

"Error: ✗ Failed to send request: ... no such host" means the build had no network or the catalog is blocked. "Error: ✗ Plugin not found" means a wrong plugin id or a version that does not exist. "Error: ✗ Permission denied" writing to the plugins dir means the build user cannot write --pluginsDir; install as the grafana user or fix the directory permissions.

Related guides

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