Technical Guides

How to install ImunifyAV in CyberPanel?

Step-by-step guide to installing ImunifyAV antivirus scanner in CyberPanel, including troubleshooting common directory creation issues.

cyberpanelimunifyavantivirussecurityinstallation

ImunifyAV is a powerful antivirus scanner that can be integrated with CyberPanel to provide additional security for your web hosting environment. This guide will walk you through the installation process and address common issues.

Prerequisites

Before installing ImunifyAV, ensure you have:

  • SSH access to your CyberPanel server
  • Root or sudo privileges
  • A working CyberPanel installation

Installation Steps

Step 1: Create the Required Directory

SSH into your CyberPanel server and execute the following command to create the necessary directory:

mkdir -p /usr/local/CyberCP/public/imunifyav

Important Note: With the latest version of CyberPanel, the ImunifyAV script is currently unable to create the necessary directory on its own. This is why we need to create it manually first.

Step 2: Download and Execute the Installation Script

Next, run this command to download and execute the ImunifyAV deployment script:

wget https://repo.imunify360.cloudlinux.com/defence360/imav-deploy.sh && bash imav-deploy.sh

This command will:

  1. Download the ImunifyAV deployment script from the official CloudLinux repository
  2. Execute the script to install ImunifyAV on your server

Common Issues and Troubleshooting

Directory Creation Warning

You may encounter the following warning if the directory isn’t created beforehand:

[2024-09-14 09:53:08] WARNING: /usr/local/CyberCP/public/imunifyav is not a directory (it should be created by the imunify deploy script). UI will not be installed.

This warning indicates that the ImunifyAV user interface will not be accessible through CyberPanel, resulting in a 404 error on the ImunifyAV endpoint.

Solution

To resolve this issue, simply create the directory before running the installation script, as shown in Step 1 above.

Uninstallation (If Needed)

If you have already executed the script and need to uninstall ImunifyAV, you can do so with the following command:

bash imav-deploy.sh -c

Important: If the directory was created during the previous installation, it will be removed upon uninstallation. Therefore, you will need to recreate the directory manually before running the installation script again.

Post-Installation

After successful installation:

  1. Verify Installation: Check that ImunifyAV is running:

    systemctl status imunify-antivirus
  2. Access ImunifyAV UI: The ImunifyAV interface should be accessible through your CyberPanel dashboard.

  3. Configure Scanning: Set up your preferred scanning schedules and policies through the ImunifyAV interface.

Additional Notes

  • The underlying reason for the directory creation issue has not been thoroughly investigated by the CyberPanel development team
  • This is a known workaround for current CyberPanel versions
  • Always ensure you have backups before making system-level changes
  • ImunifyAV provides real-time protection and scheduled scanning capabilities

Verification

To verify that ImunifyAV is working correctly:

# Check ImunifyAV service status
systemctl status imunify-antivirus

# View ImunifyAV logs
journalctl -u imunify-antivirus -f

# Check ImunifyAV version
imunify-antivirus version

This installation method ensures that ImunifyAV integrates properly with your CyberPanel installation and provides comprehensive antivirus protection for your hosting environment.

Related Articles