## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Installing ClamAV

- Installing ClamAV
  - Installing with a Package Manager
  - Installing with an Installer
    - Linux (.deb, .rpm)
      - RPM packages (for AlmaLinux, Fedora, openSUSE, etc.)
      - DEB packages (for Debian, Ubuntu, etc.)
    - macOS
    - Windows
  - Official ClamAV Docker Images
  - Installing from Source
  - Verifying ClamAV.net Downloads with GPG
  - What now?

## Installing with a Package Manager

ClamAV is widely available from third party package managers for most operating systems. This is often the quickest way to install ClamAV. It will make also upgrades easier.

Check out the Packages page to find installation instructions for your system.

## Installing with an Installer

Pre-compiled packages provided on the clamav.net downloads page have all external library dependencies statically compiled in.

These installers likely differ from packages provided by other packaging tools in that you will need to create and configure the `freshclam.conf` and `clamd.conf` files. You may also need to add a `clamav` service user account and adjust the permissions on the database directory. We hope to round out these sharp corners in the future and to make setup more convenient, but for now be advised that setup from one of these packages is a little bit more work than you may be used to.

If you’re interested in learning how these packages were built, you can check out these development instructions.

> Note: In the event that a vulnerability is found in one of the dependencies that may impact ClamAV, we will publish new packages with updated dependencies as soon as we’re able.

### Linux (.deb, .rpm)

We offer Debian and RPM packages for x86_64 (64bit) and i686 (32bit) architectures. This will make it easier to get the latest version in the event that a package for your distribution is not readily available and you would prefer not to build ClamAV from source.

> Note: These packages do not presently include `clamav-milter`. You can help help us add `clamav-milter` to the packages by developing a Mussels recipe for building the libmilter.a static library and contributing it to our Mussels cookbook.

#### RPM packages (for AlmaLinux, Fedora, openSUSE, etc.)

These are compiled on AlmaLinux 8. They should be compatible with all RPM-based linux distributions running `glibc` version `2.28` or newer.

To install, download the package for your system use `yum` or `dnf` to install the package. For example:

    sudo dnf install ~/Downloads/clamav-1.4.0.linux.x86_64.rpm

You can verify that the package was installed using:

    dnf info clamav

This package installs to `/usr/local`.

Unlike packages provided by Debian or other distributions, this package does not presently include a preconfigured `freshclam.conf`, `clamd.conf`, database directory, or `clamav` user accounts for FreshClam and ClamD. You can follow these instructions to configure FreshClam and ClamD. You can follow these instructions to create the `clamav` user account for running FreshClam and ClamD services.

And uninstall the package with:

    sudo dnf remove ~/Downloads/clamav-1.4.0.linux.x86_64.rpm

#### DEB packages (for Debian, Ubuntu, etc.)

These are compiled on Ubuntu 18.04, and have all external library dependencies statically compiled in. They should be compatible with all Debian-based linux distributions running `glibc` version `2.27` or newer.

    sudo apt install ~/Downloads/clamav-1.4.0.libnux.x86_64.deb

You can verify that the package was installed using:

    apt info clamav

This package installs to `/usr/local`.

Unlike packages provided by Debian or other distributions, this package does not presently include a preconfigured `freshclam.conf`, `clamd.conf`, database directory, or `clamav` user accounts for FreshClam and ClamD. You can follow these instructions to configure FreshClam and ClamD. You can follow these instructions to create the `clamav` user account for running FreshClam and ClamD services.

And uninstall the package with:

    sudo apt remove clamav

### macOS

We offer a PKG installer for macOS. These are universal binaries built for Intel x86_64 and Apple M1 arm64 processors.

To install, download the macOS `.pkg` installer. Double-click the installer and follow the directions.

This package installs to `/usr/local/clamav`. This is not in the default system `PATH` environment variable. You may wish to add `/usr/local/clamav/bin` and `/usr/local/clamav/sbin` to your `PATH` so you can run the ClamAV programs without entering the full path. To do this add this line to `~/.zshrc`:

    export PATH=/usr/local/clamav/bin:/usr/local/clamav/sbin:$PATH

Then run `source ~/.zshrc` or open a new terminal.

Unlike packages provided by Homebrew, this package does not presently include a preconfigured `freshclam.conf`, `clamd.conf`, or database directory. You can follow these instructions to configure FreshClam and ClamD.

macOS package installers do not provide a mechanism for automatically uninstalling the package. In the future, we hope to add a script to aid with uninstallation. But for now, to make it easier to remove, our macOS installer installs to `/usr/local/clamav`. To uninstall, all you need to do is run:

    sudo rm -rf /usr/local/clamav

### Windows

The ClamAV team provides official ClamAV builds for Windows on the ClamAV downloads page. You can choose between a traditional executable installer or a portable install ZIP package.

To use the executable installer, double-click the installer and follow the instructions.

To install from a ZIP package, unzip the portable install package to any directory.

## Official ClamAV Docker Images

There are now official ClamAV images on Docker Hub. You can find the images on Docker Hub under:

- `clamav/clamav` (Alpine Linux)
- `clamav/clamav-debian` (Debian Linux)

ClamAV is available using a Docker image tag with the specific version number, or using “stable” to get the latest stable release.

We also offer images with builds of the latest development version. We call this “unstable”.

Check out the Docker page to learn how to install and use ClamAV with Docker.

## Installing from Source

If you need, you can also compile and install ClamAV from source:

- Unix/Linux/Mac Instructions
- Windows Instructions

## Verifying ClamAV.net Downloads with GPG

You can verify the authenticity of ClamAV release packages provided on the ClamAV downloads page using GnuPG.

1. Install GnuPG.
2. Download the Cisco Talos GPG public key.
3. Import the key into your local public keyring:

       gpg --import cisco-talos.gpg

4. Download the ClamAV package AND the corresponding `.sig` file to the same directory.
5. Verify that the stable release download is signed with the [Cisco Talos GPG public key]:

       gpg --verify clamav-X.XX.tar.gz.sig

The resulting output should look something like this. The specific details will differ, as we rotate the GPG key every couple of years:

        gpg: Signature made Wed Jan 24 19:31:26 2018 EST
        gpg:                using RSA key F13F9E16BCA5BFAD
        gpg: Good signature from "Talos (Talos, Cisco Systems Inc.) [email address]" [unknown]

## What now?

Now that ClamAV is installed, you will want to customize your configuration and perhaps set up some scanning automation and alerting mechanisms.

Continue on to “Configuration”…