Type to search.

elasticsearch-plugin

Self-managed

Self-managed deployments are Elastic Stack deployments managed without the assistance of an orchestrator.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The elasticsearch-plugin command installs, lists, and removes Elasticsearch plugins.

Shell
bin/elasticsearch-plugin
( [list]
| [install [-b, --batch] (<plugin_id>)+]
| [remove [-p, --purge] (<plugin_id>)+]
) [-h, --help] ([-s, --silent] | [-v, --verbose])

A plugin is only available to the node it was installed on, so run this command on every node in the cluster, then restart each node to load the plugin.

Plugins are installed into the node's plugins directory, whose location depends on the Elasticsearch package you installed:

Every plugin records the Elasticsearch version it was built against, and Elasticsearch checks that version both when you install the plugin and when the node starts. A node refuses to start if the check fails. Most plugins must match the running version exactly, so you have to install a new build for every upgrade, including patch releases. Text analysis plugins built against the stable plugin API only need to match the major version, so one artifact stays valid across upgrades within that major version, provided you do not downgrade a node below the version the plugin was built against.

To prevent a node from starting when a plugin you depend on is missing, use the plugin.mandatory setting.

Important - Running as root

If Elasticsearch was installed using the deb or rpm package, then run /usr/share/elasticsearch/bin/elasticsearch-plugin as root so it can write to the appropriate files on disk. Otherwise, run bin/elasticsearch-plugin as the user that owns all of the Elasticsearch files.

Note - Docker installations

If you run Elasticsearch using the official Elasticsearch Docker images, manage plugins with the declarative elasticsearch-plugins.yml configuration file instead. The install and remove commands are disabled when that file is present.

-b, --batch
Used with the install command. Skips the confirmation prompt shown for plugins that request privileges beyond those granted by default, automatically granting all requested permissions. The command detects when it is not being run from a console and enables batch mode for you; specify this parameter when that detection fails, such as when installing from an automation script.
-h, --help
Returns all of the command parameters.
install (<plugin_id>)+
Installs one or more plugins. Each <plugin_id> can be the name of a core plugin or a custom location, as described in Plugin IDs. Installing several plugins in one invocation is treated as a single transaction, so either all of them are installed, or none are if any one installation fails.
list
Lists the plugins installed on this node. To find out which plugins are installed on every node in the cluster, use the node info API instead.
-p, --purge
Used with the remove command. Deletes the plugin's configuration files along with the plugin. Configuration files are preserved by default so that they survive a plugin upgrade. You can also run remove --purge for a plugin you have already removed, to clear configuration files it left behind.
remove (<plugin_id>)+
Removes one or more plugins. After removing a Java plugin, restart the node to complete the removal. You can also remove a plugin manually by deleting its directory under plugins/.
-s, --silent
Turns off all output, including the progress bar.
-v, --verbose
Outputs more debug information.

The install command accepts the following forms of <plugin_id>.

Core plugin name

Install a core plugin by name. The command installs the version matching your Elasticsearch version and shows a progress bar while downloading.

Shell
sudo bin/elasticsearch-plugin install analysis-icu
URL

Install a plugin from any valid URL. The plugin name is taken from its descriptor rather than the URL.

Shell
sudo bin/elasticsearch-plugin install [url]
Unix file system

To install a plugin from your local file system at /path/to/plugin.zip:

Shell
sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip
Windows file system

To install a plugin from your local file system at C:\path\to\plugin.zip:

Shell
bin\elasticsearch-plugin install file:///C:/path/to/plugin.zip
Note

Any path that contains spaces must be wrapped in quotes!

Note

If you are installing a plugin from the filesystem the plugin distribution must not be contained in the plugins directory for the node that you are installing the plugin to or installation will fail.

HTTP

To install a plugin from an HTTP URL:

Shell
sudo bin/elasticsearch-plugin install <EXAMPLE_PLUGIN_HOST_URL>/plugin.zip

The plugin script will refuse to talk to an HTTPS URL with an untrusted certificate. To use a self-signed HTTPS cert, add the CA cert to a local Java truststore and pass the location to the script as follows:

Shell
sudo CLI_JAVA_OPTS="-Djavax.net.ssl.trustStore=/path/to/trustStore.jks" bin/elasticsearch-plugin install <MY_HOST_URL>/plugin.zip

If your elasticsearch.yml config file is in a custom location, specify the path to the config file when using the plugin script. You can do this as follows:

Shell
sudo ES_PATH_CONF=/path/to/conf/dir bin/elasticsearch-plugin install <plugin name>

To install a plugin via a proxy, you can add the proxy details to the CLI_JAVA_OPTS environment variable with the Java settings http.proxyHost and http.proxyPort (or https.proxyHost and https.proxyPort):

Shell
sudo CLI_JAVA_OPTS="-Dhttp.proxyHost=host_name -Dhttp.proxyPort=port_number -Dhttps.proxyHost=host_name -Dhttps.proxyPort=https_port_number" bin/elasticsearch-plugin install analysis-icu

Or on Windows:

Shell
set CLI_JAVA_OPTS="-Dhttp.proxyHost=host_name -Dhttp.proxyPort=port_number -Dhttps.proxyHost=host_name -Dhttps.proxyPort=https_port_number"
bin\elasticsearch-plugin install analysis-icu
0
everything was OK
64
unknown command or incorrect option parameter
70
any other error
74
IO error
Shell
sudo bin/elasticsearch-plugin install analysis-icu
Shell
sudo bin/elasticsearch-plugin install analysis-icu analysis-kuromoji
Shell
sudo bin/elasticsearch-plugin install --batch [pluginname]
Shell
sudo bin/elasticsearch-plugin list
Shell
sudo bin/elasticsearch-plugin remove --purge [pluginname]
Shell
sudo bin/elasticsearch-plugin remove [pluginname] [pluginname] ... [pluginname]

Plugins cannot be updated in place. Remove the plugin and install it again:

Shell
sudo bin/elasticsearch-plugin remove [pluginname]
sudo bin/elasticsearch-plugin install [pluginname]