Skip to content

ClamAV on cPanel — useful integration, careful tuning

Where ClamAV adds value on cPanel (mostly mail), the memory cost, and the integration paths that work versus the ones that waste CPU.

ClamAV is the free open-source AV scanner. On cPanel, it integrates with Exim to scan inbound mail attachments and is available as a cPanel plugin for on-demand file scans. The questions are: is it worth the 1 GB of RAM for the daemon, and where exactly does it earn that. Short answer: yes for inbound mail, no for general filesystem scanning if you also have Imunify.

What’s happening

cPanel’s ClamAV plugin installs clamd (the daemon, which loads signature definitions into memory and serves scan requests fast) and freshclam (which updates signatures). The Exim integration scans every inbound message attachment against the signature database. The filesystem scan path is exposed in cPanel > Virus Scanner. On a multi-tenant host, ClamAV plus Imunify duplicates effort; Imunify has more current signatures for web malware.

How to verify

clamd --version
systemctl status clamd
ls -la /usr/local/cpanel/3rdparty/etc/clamd.conf 2>/dev/null
freshclam -V
exiqgrep -i -X | head # check Exim ACL for av_scanner
grep "av_scanner" /etc/exim.conf /var/cpanel/exim_*.conf 2>/dev/null

av_scanner in Exim config tells you whether ClamAV is integrated with mail flow.

The fix

  1. Install via the cPanel plugin: WHM > Manage Plugins > ClamAV Scanner > Install. cPanel handles the daemon and freshclam setup.
  2. Memory cost: clamd loads the full signature DB into memory — 1–2 GB. Verify the host has the headroom. If not, do not run clamd, use the on-demand clamscan only.
  3. Exim integration: WHM > Exim Configuration Manager > Mail > Scan outgoing messages for viruses and the inbound equivalent. Enable both. Exim’s ACL will block messages where ClamAV signals known malware.
  4. Daily definition updates: freshclam runs via the cPanel plugin’s cron; verify with cat /etc/cron.d/freshclam. Out-of-date signatures are the most common failure mode.
  5. On-demand filesystem scans: cPanel > Virus Scanner is per-account. Useful for “is this account clean” spot checks. Not a substitute for Imunify.
  6. If you have Imunify360: turn off ClamAV’s filesystem scanning, keep its mail integration. Two malware scanners on the filesystem fight over the same CPU.
  7. False positives: ClamAV occasionally flags compiled PHP cache files or JavaScript libraries. Whitelist via /usr/local/cpanel/3rdparty/etc/clamd.conf ExcludePath lines.

Stack Harbor sizes ClamAV against Imunify on each host under WHM server management.