Install Wazuh agent with RPM packages

The RPM package is suitable for installation on Red Hat, CentOS and other RPM-based systems.

Note

Many of the commands described below need to be executed with root user privileges.

Adding the Wazuh repository

The first step to installing the Wazuh agent is to add the Wazuh repository to your server. Alternatively, if you want to download the wazuh-agent package directly, or check the compatible versions, you can do it from here.

Set up the repository by running the following commands according to your distribution:

CentOS 6/RHEL 6, CentOS 7/RHEL 7, Fedora 22 or greater and Amazon Linux

# cat > /etc/yum.repos.d/wazuh.repo <<\EOF
[wazuh_repo]
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1
name=Wazuh repository
baseurl=https://packages.wazuh.com/3.x/yum/
protect=1
EOF

CentOS 5/RHEL 5

# cat > /etc/yum.repos.d/wazuh.repo <<\EOF
[wazuh_repo]
gpgcheck=1
gpgkey=http://packages.wazuh.com/key/GPG-KEY-WAZUH-5
enabled=1
name=Wazuh repository
baseurl=http://packages.wazuh.com/3.x/yum/5/$basearch/
protect=1
EOF

SUSE 12

# rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH
# cat > /etc/zypp/repos.d/wazuh.repo <<\EOF
[wazuh_repo]
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1
name=Wazuh repository
baseurl=https://packages.wazuh.com/3.x/yum/
protect=1
EOF

SUSE 11

# rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH-5
# cat > /etc/zypp/repos.d/wazuh.repo <<\EOF
[wazuh_repo]
gpgcheck=1
gpgkey=http://packages.wazuh.com/key/GPG-KEY-WAZUH-5
enabled=1
name=Wazuh repository
baseurl=http://packages.wazuh.com/3.x/yum/5/$basearch/
protect=1
EOF

Installing Wazuh agent

  1. On your terminal, install the Wazuh agent as follows:

  • Using the yum package manager:

    # yum install wazuh-agent-3.7.2-1
    
  • Using the zypper package manager:

    # zypper install wazuh-agent-3.7.2-1
    
  1. (Optional) Disable the Wazuh repository:

It is recommended that the Wazuh repository be disabled in order to prevent accidental upgrades. To do this, use the following command:

  • Using the yum package manager:

    # sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo
    
  • Using the zypper package manager:

    # sed -i "s/^enabled=1/enabled=0/" /etc/zypp/repos.d/wazuh.repo
    

Note

Now that the agent is installed, the next step is to register and configure it to communicate with the manager. For more information about this process, please visit the user manual.