Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

ClamAV

Security covered Under active development 11,723 sites

This module integrates with the ClamAV virus scanner to check uploaded files for viruses and prevent infected files from being saved. It does not provide the anti-virus scanning engine itself.

Drupal integration with the ClamAV virus scanner.

ClamAV module is DrupalSouth 2025 Splash award nominee in Open Source category.

This module will verify that files uploaded to a site are not infected with a virus, and prevent infected files from being saved.

NB: The module integrates with ClamAV, it does not provide an anti-virus scanner engine.

Drupal 11+

For Drupal 11, the ClamAV module is likely to become a plugin for the Antivirus module.

  • ClamAV (based on Antivirus) 4.0.x
  • ClamAV standalone 2.1.x
  • ClamAV legacy 2.0.x

Please try the Drupal 11 dev branches in non-production environments and share your feedback.

Installation

Comprehensive documentation can be found on the Installing ClamAV page. In general, the Drupal module doesn't have any specific requirements for how ClamAV is installed.

  1. First install the clamscan program:
    • Ubuntu:
      sudo apt-get install clamav clamav-daemon
    • Redhat / CentOS:
      1. Enable the EPEL repo
      2. yum install clamav
      3. yum install clamd
    • OS-X (via homebrew): brew install clamav
  2. Then enable and configure the ClamAV Drupal module
  3. Done!

Post-installation

Once the ClamAV module is installed and configured, it's good practice to verify that it's detecting viruses properly. You can do this safely by trying to add content to your site, attaching the Eicar test virus to the content. The file upload should be blocked, and you should find a message recording this in the Watchdog logs.

Configuration

The Drupal configuration page is at /admin/config/media/clamav.

"Daemon mode" is recommended. "Executable mode" is significantly slower, and in some configurations, the ClamAV service may need to run under the same group as the webserver process.

In performance-testing, the mean scan-time for each configuration was as follows:

  • Executable: 10.3 seconds
  • Daemon-mode (unix socket): 0.0009 seconds
  • Daemon-mode (TCP/IP): 0.0010 seconds

Daemon-mode came out 10,000 times faster than executable mode.

Documentation

The best resource is the ClamAV documentation.

For issues that are Drupal-specific or will affect most users of the Drupal ClamAV module, please raise and discuss them in the ClamAV module issue queue.

Related modules

  • ClamAV Queue provides asynchronous queued scanning of uploaded files (for a specific use-case).

Acknowledgements

More acknowledgements below.

Drupal 10–11

Ask your assistant about ClamAV

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Aug 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 6
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.1.0 Stable 10–11 Jan 25, 2025
2.0.3 Stable 8–10 Jan 25, 2025
4.0.x-dev Dev 10–11 Jan 25, 2025
2.1.x-dev Dev 10–11 Jan 25, 2025
2.0.x-dev Dev 8–10 Nov 24, 2024
4.x-dev Dev 10–11 Oct 27, 2024
2.0.2 Stable 8–10 Aug 22, 2023