You can view the documentation below, or browse our GitHub Repository, where you can contribute to user manual and FAQ.
General | Installing ClamAV | How to Report A Bug | Miscellaneous FAQ | ClamAV Virus Database FAQ | End of Life Policy (EOL) | Potentially Unwanted Applications (PUA) | Mailing Lists FAQ | Troubleshooting FAQ | Safebrowsing | Upgrading ClamAV | ClamAV on Microsoft Windows FAQ | Which Version of ClamAV should I use? | Uninstalling ClamAV | ClamAV Overview | Interpreting Scan Alerts FAQ | Freshclam FAQ | How do I ignore a ClamAV signature?
Manual | Clam AntiVirus User Manual
Manual | UserManual | Installing ClamAV on Unix / Linux / macOS from Source | Installing ClamAV on Windows | Introduction | LibClamAV | On-Access Scanning | Creating signatures for ClamAV | Usage | ClamAV Development
Manual | UserManual | Installation-Unix | Installation on Debian and Ubuntu Linux Distributions | Installation on macOS (Mac OS X) | Installation on Redhat and CentOS Linux Distributions
Manual | UserManual | Signatures | Trusted and Revoked Certificates | Body-based Signature Content Format | Bytecode Signatures | Signatures based on container metadata | Database Info | Dynamic Configuration (DCONF) | Passwords for archive files \[experimental\] | Extended signature format | File Type Magic | ClamAV File Types | Functionality Levels (FLEVELs) | File hash signatures | Logical signatures | PhishSigs | Using YARA rules in ClamAV | Allow list databases
Manual | UserManual | Usage | Configuration | Scanning | Signature Testing and Management
Additional | Microsoft Authenticode Signature Verification | Private Local Mirrors
The following is an overview of the tools, libraries, and steps needed to build ClamAV.
Required tools:
gcc
or clang
gmake
on UNIX systems)Recommended tools:
check
unit testing frameworkRequired libraries (including development sources (i.e. ...-dev
or ...-devel
)):
Recommended libraries (including development sources (i.e. ...-dev
or ...-devel
)):
Optional libraries (including development sources (i.e. ...-dev
or ...-devel
)):
ClamAV may execute Bytecode signatures using:
ClamAV’s built-in version of LLVM 2.8
*The performance difference between using LLVM and using the interpeter is negligible. If you prefer to use LLVM / JIT for bytecode signature execution, be advised that we presently only support up to LLVM version 3.6.
The following are thus optional, but required to use system-LLVM in place of the built-in LLVM or the bytecode interpeter:
Certain versions on certain OSes will cause failures loading virus database:
To install ClamAV locally on an unprivileged shell account you need not create any additional users or groups. Assuming your home directory is /home/gary
you should build it as follows:
./configure --prefix=/home/gary/clamav --disable-clamav make; make install
The --disable-clamav
switch disables the check for existence of the clamav
user and group but clamscan
would still require an unprivileged account to work in a superuser mode.
If installing to the system, it is recommended to set up at least one special user account to run freshclam
and clamd
. You may choose to set up two separate accounts, one for each. You only need to create these accounts the first time you install ClamAV.
These are instructions specific to some popular operating systems:
If your operating system isn’t specified above, and your OS does not have the groupadd
and useradd
utilities, consult a system manual. Don’t forget to lock access to the account!
Once you have created the clamav user and group, please extract the archive:
tar xzf clamav-[ver].tar.gz cd clamav-[ver]
Assuming you want to install the configuration files in /etc
, configure and build the software as follows:
./configure --sysconfdir=/etc make su -c "make install"
In the last step, the software is installed into the /usr/local
directory and the config files into /etc
. WARNING: Never enable the SUID or SGID bits for Clam AntiVirus binaries.
First, create a database directory. This would be located under the install path share/clamav
. For example:
/usr/local/share/clamav
~/clamav/share/clamav
You will need to create freshclam.conf
and clamd.conf
files in the config directory. In the above example, we chose /etc
, so run the following.
sudo cp /etc/freshclam.conf.sample /etc/freshclam.conf sudo cp /etc/clamd.conf.sample /etc/clamd.conf
At a minimum, you will need to edit each file and remove or comment-out the Example
line. In addition, for clamd.conf
you will need to enable either LocalSocket
or TCPSocket
.
For additional recommendations, please read:
To test your local installation execute:
~/clamav/bin/freshclam ~/clamav/bin/clamscan ~
To test your system installation execute:
sudo freshclam sudo clamscan ~
The libmilter
package and its development files are required. To enable clamav-milter, configure ClamAV with
./configure --enable-milter
To configure ClamAV to use a system-installed LLVM library:
./configure --with-system-llvm=/myllvm/bin/llvm-config make sudo make install
The argument to --with-system-llvm
indicates the path name of the LLVM configuration utility (llvm-config). Alternatively, you may use --enable-llvm
and ./configure
will search for LLVM in /usr/local/ and then /usr.
Recommended versions of LLVM are 3.2 - 3.6. Some installations have reported problems using earlier LLVM versions. Versions of LLVM beyond 3.6 are not currently supported in ClamAV.
ClamAV includes unit tests that allow you to test that the compiled binaries work correctly on your platform.
The first step is to use your OS’s package manager to install the check
package. If your OS doesn’t have that package, you can download it from SourceForge, build it and install it.
To help clamav’s configure script locate check
, it is recommended that you install pkg-config
, preferably using your OS’s package manager, or from FreeDesktop.org.
The recommended way to run unit-tests is the following, which ensures you will get an error if unit tests cannot be built:
./configure --enable-check make make check
When make check
is finished, you should get a message similar to this:
================== All 8 tests passed ==================
If a unit test fails, you get a message similar to the following. Note that in older versions of make check may report failures due to the absence of optional packages. Please make sure you have the latest versions of the components noted in section /refsec:components. See the next section on how to report a bug when a unit test fails.
======================================== 1 of 8 tests failed Please report to https://bugzilla.clamav.net/ ========================================
If unit tests are disabled (and you didn’t use --enable-check
), you will get this message:
*** Unit tests disabled in this build *** Use ./configure --enable-check to enable them SKIP: check_clamav PASS: check_clamd.sh PASS: check_freshclam.sh PASS: check_sigtool.sh PASS: check_clamscan.sh ====================== All 4 tests passed (1 tests were not run) ======================
Running ./configure --enable-check
should tell you why.
If make check
reports failed tests, we encourage you to report a bug on bugzilla.
When writing a bug report regarding failed unit tests, please provide the following:
make check
uname -mrsp
config.log
unit_tests/
directory:
test.log
clamscan.log
clamdscan.log
/tmp/clamd-test.log
if it existspkg-config check --cflags --libs
valgrind
is available on your platform, the output of the following:
make check CK_FORK=no ./libtool --mode=execute valgrind unit_tests/check_clamav
Before you can run clamd
, clamdscan
, or clamscan
, you must have ClamAV Virus Database (.cvd) file(s) installed in the appropriate location on your system. The default location for these database files are /usr/local/share/clamav
.
Here is a listing of currently available ClamAV Virus Database Files:
These files should be downloaded using the freshclam
utility on a periodic basis. While using HTTPS to directly download the CVDs is possible, using freshclam
is the preferred method of keeping the ClamAV virus database files up to date. freshclam
can download database difference files (.cdiff
) to get the latest signature definitions without downloading whole CVD files. This saves a considerable amount of bandwidth.
Please see the freshclam usage section for additional details on freshclam).
As an alternative to building and installing from source, most Linux package managers provide pre-compiled ClamAV packages.
For more information about installing ClamAV via a Package Manager, please visit the “other versions” section on the ClamAV.net Downloads page.