Deploy a plugin
Build your plugin distribution and deploy it to a running Besu installation.
Prerequisites
- A completed Besu plugin. See how to set up a plugin project.
- A Besu installation.
Steps
1. Build the distribution
Run the distZip task provided by the Gradle plugin
to package your plugin:
./gradlew distZip
The output archive at build/distributions/<project-name>.zip contains only your plugin JAR and
any extra runtime dependencies that Besu does not already provide.
JARs already in Besu's lib directory are excluded from the ZIP.
If your plugin has no extra dependencies, the ZIP contains a single JAR.
To inspect the contents of the archive before deploying:
unzip -l build/distributions/<project-name>.zip
2. Deploy to Besu
Deploy your plugin via a standard Besu installation or Besu Docker image.
Standard installation
Create a plugins directory at the root of your Besu installation if it doesn't already exist,
then unzip the archive into it.
The -j flag flattens the ZIP so all JARs land directly in plugins/:
unzip -j build/distributions/<project-name>.zip -d /path/to/besu/plugins/
Start Besu.
By default, Besu loads all JARs found in the plugins directory automatically.
To load only specific plugins, pass a comma-separated list to
--plugins.
Docker
The Besu Docker image doesn't include a plugins directory.
Use a bind mount to inject your plugin JARs into the container at /opt/besu/plugins:
# Unzip the distribution into a local directory.
unzip -j build/distributions/<project-name>.zip -d /host/path/to/plugins/
# Mount that directory when starting the container.
docker run \
-v /host/path/to/plugins:/opt/besu/plugins \
hyperledger/besu:latest
To use a different path inside the container, override the plugins directory using the
besu.plugins.dir system property via BESU_OPTS:
docker run \
-e BESU_OPTS="-Dbesu.plugins.dir=/data/plugins" \
-v /host/path/to/plugins:/data/plugins \
hyperledger/besu:latest
3. Verify startup
Check the Besu startup logs to confirm your plugin was detected and registered. Besu logs a plugin registration summary that lists registered plugins and any plugins that were detected but skipped.
Use --plugins-verification-mode
to control how Besu handles plugin verification failures:
NONE(default) logs a warning and continues.FULLlogs an error and stops Besu.
Next steps
Troubleshoot common issues.