Type to search.

Upgrade standalone Elastic Agents

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

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 upgrade method depends on how you installed Elastic Agent:

To upgrade a standalone Elastic Agent installed from a TAR or ZIP archive:

  1. Make sure the elastic-agent service is running.

  2. From the directory where Elastic Agent is installed, run the upgrade command to upgrade to a new version. Not sure where the agent is installed? Refer to Installation layout.

    For example, to upgrade the agent to 9.5.6:

    Shell
    sudo elastic-agent upgrade 9.5.6
    
    Shell
    sudo elastic-agent upgrade 9.5.6
    

    As an Administrator, run:

    Shell
    .\elastic-agent.exe upgrade 9.5.6
    

This command upgrades the binary. Your agent policy should continue to work, but you might need to upgrade it to use new features and capabilities.

For more command-line options, check the help for the upgrade command.

When upgrading an agent from a version earlier than 9.4.0 in unprivileged mode, you might encounter registry permission issues.

The upgraded agent might not have permission to create the Windows Add/Remove Programs registry entry because agent versions earlier than 9.4.0 didn't configure the required access control list (ACL). Additionally, if you originally installed the agent using MSI, a stale MSI entry might remain in the Add/Remove Programs list.

Run elastic-agent windows registry update once after the upgrade to create the entry, set the correct permissions, and remove any stale MSI entries.

Note

TAR/ZIP installations are recommended over system-managed packages because they can be enrolled and managed in Fleet.

For Elastic Agents installed using DEB or RPM packages, you must use your system's package manager to upgrade. The elastic-agent upgrade command is not supported for system-managed packages.

  1. Download the Elastic Agent Debian install package for the release and architecture that you want to upgrade to. For example, to upgrade to 9.5.6:

    For x86_64 (64-bit Intel/AMD):

    Shell
    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.5.6-amd64.deb
    

    For ARM64 (aarch64):

    Shell
    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.5.6-arm64.deb
    
  2. Upgrade Elastic Agent to the target release. Replace the filename with the package you downloaded:

    Shell
    sudo dpkg -i elastic-agent-9.5.6-amd64.deb
    
  3. Restart the Elastic Agent service:

    Shell
    sudo systemctl restart elastic-agent
    
  1. Download the Elastic Agent RPM install package for the release and architecture that you want to upgrade to. For example, to upgrade to 9.5.6:

    For x86_64 (64-bit Intel/AMD):

    Shell
    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.5.6-x86_64.rpm
    

    For ARM64 (aarch64):

    Shell
    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.5.6-aarch64.rpm
    
  2. Upgrade Elastic Agent to the target release. Replace the filename with the package you downloaded:

    Shell
    sudo rpm -U elastic-agent-9.5.6-x86_64.rpm
    
  3. Restart the Elastic Agent service:

    Shell
    sudo systemctl restart elastic-agent
    

The basic upgrade scenario should work for most use cases. However, in an air-gapped environment Elastic Agent is not able to access the Elastic Artifact Registry at artifacts.elastic.co directly.

As an alternative, you can do one of the following:

As well, starting from version 8.9.0, during the upgrade process Elastic Agent needs to download a PGP/GPG key. Refer to Configure Elastic Agents to download a PGP/GPG key from Fleet Server for the steps to configure the key download location in an air-gapped environment.

Refer to Air-gapped environments for more details.

Standalone Elastic Agent verifies each package that it downloads using publicly available SHA hash and .asc PGP signature files. The SHA file is used to verify that the package has not been modified, and the .asc file is used to verify that the package was released by Elastic. For this purpose, the Elastic public GPG key is embedded in Elastic Agent itself.

At times, the Elastic private GPG key may need to be rotated, either due to the key expiry or due to the private key having been exposed. In this case, standalone Elastic Agent upgrades can fail because the embedded public key no longer works.

In the event of a private GPG key rotation, you can use the following options with the upgrade command to either skip the verification process (not recommended) or force Elastic Agent to use a new public key for verification:

--skip-verify

Skip the package verification process. This option is not recommended as it is insecure.

Example:

YAML
./elastic-agent upgrade 9.5.6 --skip-verify
--pgp-path <string>

Use a locally stored copy of the PGP key to verify the upgrade package.

Example:

YAML
./elastic-agent upgrade 9.5.6 --pgp-path /home/elastic-agent/GPG-KEY-elasticsearch
--pgp-uri <string>

Use the specified online PGP key to verify the upgrade package.

Example:

YAML
./elastic-agent upgrade 8.7.0-SNAPSHOT --pgp-uri "https://artifacts.elastic.co/GPG-KEY-elasticsearch"

Under the basic upgrade scenario standalone Elastic Agent automatically fetches the most current public key, however in an air-gapped environment or in the event that the Elastic Artifact Registry is otherwise inaccessible, these commands can be used instead.

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack 9.3+

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available since 9.3

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

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.

We have you covered in the unusual case that you need to rollback an upgrade for a standalone agent.

Elastic subscription

The manual rollback feature for Elastic Agent is available only for some Elastic subscription levels.

Manual rollback. The manual rollback feature expands the time window for rollbacks, giving you the ability to roll back to the previous version within seven days.

To roll back a recent upgrade to the previously installed version (if it is still available on disk):

Shell
sudo elastic-agent upgrade --rollback
Shell
sudo elastic-agent upgrade --rollback

As an Administrator, run:

Shell
.\elastic-agent.exe upgrade --rollback
Note

The manual rollback feature is not available for system-managed packages such as DEB and RPM.

These limitations apply for the manual rollback feature:

  • Rollback is limited to the version running before the upgrade. Both the previously and currently running versions must be 9.3.0 or later for this functionality to be available.
  • Data required for the rollback is stored on disk for seven days, which can impact available disk space.
  • Rollback must be performed within seven days of the upgrade. Rollback data is automatically cleaned up after seven days and becomes unavailable.
  • Manual rollback is not available for system-managed packages such as DEB and RPM.
  • Some data might be re-ingested after rollback.

If no version is available on disk to rollback to, you get an error. This situation can happen if:

  • the version you upgraded from is earlier than 9.3.0, as the feature was not implemented in earlier versions.

  • the rollback window has ended (typically more than seven days). When the rollback window ends, the files from the previous version are removed to free up disk space.