Error: Failed to install plugin / Plugin not found (packer init)
Fixes packer init failing to find a plugin. For engineers whose required_plugins block names a plugin Packer cannot locate, covering source addresses and version constraints.
Error: Failed to install plugin / Plugin not found (packer init)
TL;DR
Packer cannot find the plugin your template requires. Run packer init in the template directory, verify the source address and version constraint in required_plugins, and check network access to the plugin registry.
The error
Error: Failed to install plugin
Plugin not foundFix it
- Run
packer init(orpacker init [dir]) in the directory containing your templates beforepacker build.
- Success check: plugins download into the Packer plugin directory.
- Verify the
required_pluginsblock:sourcemust be a valid address likegithub.com/hashicorp/amazon, andversionmust match a released version.
- Success check: no typos in the source address; the version constraint is satisfiable.
- Check network access from the build machine to
github.com(plugin releases live there).
- Success check:
curl -sI https://github.comsucceeds.
- In CI, cache
~/.packer.d/pluginsbetween runs to avoid re-downloading.
- Success check: subsequent runs skip the download.
When to use this
You hit this on packer init or at build start when a required plugin cannot be installed.
When NOT to use this
Do not use this for Failed to initialize build "[builder]" (plugin installed but builder unknown) or for checksum mismatches on downloaded plugins.
Compatibility
Packer 1.7+ with the plugin framework (mandatory plugin installs since 1.10 for previously bundled builders).
Variants
Error: Failed to install pluginnaming a specific plugin and version- Init succeeding locally but failing in CI (network or cache issue)
Root cause
Since Packer 1.10, builders that used to ship with Packer (like amazon-ebs) require explicit plugin installation. A missing packer init, a wrong source address, or no network produces this failure.
Edge cases
packer plugins install github.com/hashicorp/amazoninstalls one plugin directly without a template; useful for debugging.- Version constraints like
>= 1.0.0, < 2.0.0can fail if no release satisfies both. Loosen or pin explicitly.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.