---
title: "How to Install ClamAV on Ubuntu"
description: "ClamAV is a popular open source anti-virus (AV) scanner available for Windows, macOS, and Unix-based systems. ClamAV can quarantine and delete infected files, emails, websites, and more. ClamAV is..."
url: https://www.inmotionhosting.com/support/security/install-clamav-on-ubuntu/
date: 2020-03-10
modified: 2022-03-01
author: "InMotion Hosting Contributor"
categories: ["Security"]
type: post
lang: en
---

# How to Install ClamAV on Ubuntu

![How to Install ClamAV on Ubuntu](https://www.inmotionhosting.com/support/wp-content/uploads/2020/03/clamav-install-ubuntu-1024x538.jpg)

[ClamAV](https://www.clamav.net/) is a popular open source anti-virus (AV) scanner available for Windows, macOS, and Unix-based systems. ClamAV can quarantine and delete infected files, emails, websites, and more. ClamAV is also available as a cPanel server plugin.

Below we’ll cover how to install ClamAV, update the signature database, and run common command-line interface (CLI) commands.

## How to Install and Use ClamAV

You may have to use `sudo` before each command if you’re not already logged in as root (e.g. `sudo apt-get update`).

Installing ClamAV is easy with the Ubuntu APT package.

1. Update your package lists: sudo apt-get update
2. Install ClamAV: sudo apt-get install clamav clamav-daemon -y

After you finish the installation, ensure your ClamAV virus signatures are up to date.

1. Stop the ClamAV process: sudo systemctl stop clamav-freshclam
2. Manually update the ClamAV signature database: sudo freshclam
3. Restart the service to update the database in the background: sudo systemctl start clamav-freshclam

Below are the most common options for using ClamAV clamscan in the terminal.

Scan all files, starting from the current directory:

clamscan -r /

Scan files but only show infected files:

clamscan -r -i /path-to-folder

Scan files but don’t show `OK` files:

clamscan -r -o /path-to-folder

Scan files and send results of infected files to a results file:

clamscan -r /path-to-folder | grep FOUND >> /path-folder/file.txt

Scan files and move infected files to a different directory:

clamscan -r --move=/path-to-folder /path-to-quarantine-folder

You can also create a cron job to run ClamAV scans automatically.

To learn more about clamscan options, check the manual:

man clamscan

Those running Linux on a local machine with a window manager can also install the [ClamTK](https://www.inmotionhosting.com/support/security/clamtk-ubuntu-clamav/) graphical wrapper.

Looking for other ways to improve your server security posture? See if [Sucuri’s web application firewall (WAF) is right for you](https://sucuri.net/lp/promo/inmotion/?clickid=QB5RSwS7RxyLT9tQy%3ASR0UvEUkBWzQxahTDQUQ0). Let us know if you have any further questions.

With our [Cloud Server Hosting](https://www.inmotionhosting.com/cloud-vps), you can deploy a lightning-fast, reliable cloud platform with built-in redundancy – ensuring the availability of your environment!
