Installing ClamAV on ubuntu
In this guide, I will talk about how to install ClamAV tools in Ubuntu. Additionally, how to use those tools to scan for local files/folders or using a node environment.
On Ubuntu (v
The first step is to install the packages
sudo apt-get install clamav clamav-daemon
clamav installs other dependencies along with it like
Next, you will need to start the
clamav-freshclam service by running the following command:
sudo service clamav-freshclam restart
sudo service clamav-freshclam status // to verify
This creates a signature file which is required for the next step.
clamav-freshclamis started for the first time, creation of the signature file takes about 1–3 mins.
Once the signature file is created, you can then start the
clamav-daemon service by running the command:
sudo service clamav-daemon start
sudo service clamav-daemon status // to verify
This step creates the clamd socket file (default location is
/var/run/clamav/clamd.ctl). Make sure you verify the status of the
clamav-daemon. It should not be showing ‘condition failed’ or ‘inactive’ or ‘failed’.
If needed, you can edit the
clamd.ctlfile to change configuration properties like log location, socket IP etc based on your requirements.
Once the setup is successfully done, you can use
clamdscan to run anti-virus checks on your machine.
As you can see,
clamdscan takes considerably less time compared to as
clamscan and is recommended to use.
ClamAV + Node.js
Since, this is quite a big topic, I have written a separate blog for it which can be found here.