ClamAV antivirus

ClamAV is an open source (GPL) antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats. It is the de facto standard for mail gateway scanning. It provides a high performance mutli-threaded scanning daemon, command line utilities for on demand file scanning, and an intelligent tool for automatic signature updates. The core ClamAV library provides numerous file format detection mechanisms, file unpacking support, archive support, and multiple signature languages for detecting threats.

Install from the RPMs

1. Move to install directory:

cd /usr/src

2. Download the ClamAV installation package, ClamAV database, ClamAV development libraries and ClamAV daemon for your operating system type (32 bit of 64 bit):

For 32 bit:


For 64 bit:


3. Install ClamAV

rpm -Uvh clam*


Install via epel repository.

1. Install the EPEL package

cd /usr/local/src
wget  // for centos 6
rpm -ivh epel-release-6-7.noarch.rpm
wget  // for centos 5
rpm -ivh epel-release-5-4.noarch.rpm

2. Install ClamAV

yum install clamd

Updating the ClamAV

Run Freshclam to download the newest pattern files:

/usr/bin/freshclam -v

Setting up the cronjob

1. Create the log file.

touch /var/log/freshclam.log
chmod 600 /var/log/freshclam.log
chown clamav /var/log/freshclam.log

2. Create /etc/cron.daily/clamav-scan with the following contents.

/usr/bin/clamscan -ri /

3. Set the permissions.

chmod +x /etc/cron.weekly/clamav-scan

Now you have installed ClamAV in your server and setup a cronjob that will update the ClamAV and scan the server everyday.