Upgrade NGINX Agent package

Overview

Learn how to upgrade NGINX Agent.

Upgrade NGINX Agent from version v2.31.0 or greater

Note:
Starting from version v2.31.0, NGINX Agent will automatically restart itself during an upgrade.

To upgrade NGINX Agent, follow these steps:

  1. Open an SSH connection to the server where you’ve installed NGINX Agent and log in.

  2. Make a backup copy of the following locations to ensure that you can successfully recover if the upgrade has issues:

    • /etc/nginx-agent
    • config_dirs values for any configuration specified in /etc/nginx-agent/nginx-agent.conf
  3. Install the updated version of NGINX Agent:

    • CentOS, RHEL, RPM-Based

      sudo yum -y makecache
      sudo yum update -y nginx-agent
      
    • Debian, Ubuntu, Deb-Based

      sudo apt-get update
      sudo apt-get install -y --only-upgrade nginx-agent -o Dpkg::Options::="--force-confold"
      

Upgrade NGINX Agent from a version less than v2.31.0

To upgrade NGINX Agent, take the following steps:

  1. Open an SSH connection to the server where you’ve installed NGINX Agent and log in.

  2. Make a backup copy of the following locations to ensure that you can successfully recover if the upgrade has issues:

    • /etc/nginx-agent
    • config_dirs values for any configuration specified in /etc/nginx-agent/nginx-agent.conf
  3. Stop NGINX Agent:

    sudo systemctl stop nginx-agent
    
  4. Install the updated version of NGINX Agent:

    • CentOS, RHEL, RPM-Based

      sudo yum -y makecache
      sudo yum update -y nginx-agent
      
    • Debian, Ubuntu, Deb-Based

      sudo apt-get update
      sudo apt-get install -y --only-upgrade nginx-agent -o Dpkg::Options::="--force-confold"
      
  5. Start NGINX Agent:

    sudo systemctl start nginx-agent