Install ClamAV on DirectAdmin | Free Antivirus

In this article, we want to teach you How To Install ClamAV on DirectAdmin. Clam AntiVirus (ClamAV) is a free software, cross-platform, and open-source antivirus software toolkit able to detect many types of malicious software, including viruses.

It includes a number of utilities: a command-line scanner, an automatic database updater, and a scalable multi-threaded daemon, running on an anti-virus engine from a shared library. One of its main uses is on mail servers as a server-side email virus scanner.

DirectAdmin is web hosting control panel software, similar to cPanel, that lets you administer your website and hosting options using a graphical, web-based interface.

You can now proceed to the guide steps below on the Orcacore website to set up ClamAV for DirectAdmin Panel.

How To Install ClamAV on DirectAdmin?

In this guide, you learn to install ClamAV on DirectAdmin with easy steps. To do this, follow the steps below.

Setting Up ClamAV For DirectAdmin

Setting Up ClamAV For DirectAdmin

First, you need to log in to your server as a root user via SSH. Then, you need to switch to your DirectAdmin “cutombuild” directory with the command below:

cd /usr/local/directadmin/custombuild

Here you can compile your ClamAV with the following commands:

# ./build update
# ./build set clamav yes
# ./build clamav

This will take some time to complete.

When your installation is completed, run the command below to update the ClamAV virus database:

freshclam

freshclam is the automatic database update tool for Clam AntiVirus.

Now you can start your ClamAV service on your server with the command below:

service clamd start

At this point, you can start to scan your whole server or specific directory with the following commands:

# clamscan -r -i / (full scan)
# clamscan -r -i /home/admin/domains/domain.com/ (to specific directory)

Note: ClamAV (or any virus scanner) is a memory hog service. You need to make sure to have enough swap memory in your server, otherwise, you will likely see ‘Killed’ output while scanning.

To increase the swap file you can use the commands below:

# swapoff -a
# dd if=/dev/zero of=/swapfile count=4096 bs=1MiB
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile

Then, you can use the command below to verify the increasing the swap file:

free -m

After that, you can start to scan your server by using the ClamAV.

Conclusion

At this point, you have learned to easily Install ClamAV on DirectAdmin with Linux commands. It helps you to detect many types of malicious software, including viruses.

Hope you enjoy it. Please subscribe to us on Facebook, YouTube, and X.

Also, you may like to read the following articles:

Installing DirectAdmin on AlmaLinux 8

How to Change Web Server Settings on DirectAdmin

Installing CloudLinux on DirectAdmin

Add a User and a Reseller on DirectAdmin

FAQs

Does ClamAV slow down the server?

ClamAV is lightweight, but full scans can use CPU resources. Running scans during low-traffic hours is recommended.

Can ClamAV remove infected files automatically?

Yes, add the –remove flag to the scan command: clamscan -r --remove /home

Does ClamAV scan incoming emails in DirectAdmin?

Yes, if configured properly, ClamAV can scan emails for viruses and malware.

Is ClamAV free to use in DirectAdmin?

Yes, ClamAV is completely free and open-source, making it a great security tool for DirectAdmin users.

Can ClamAV automatically scan files in DirectAdmin?

Yes, you can set up cron jobs to schedule automatic scans. For Example:
0 2 * * * clamscan -r /home >> /var/log/clamav/scan.log

Share your love

Stay informed and not overwhelmed, subscribe now!