{"id":16243,"date":"2024-10-30T12:41:02","date_gmt":"2024-10-30T12:41:02","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=16243"},"modified":"2024-10-31T09:35:26","modified_gmt":"2024-10-31T09:35:26","password":"","slug":"how-to-install-clamav-for-malware-scanning-on-linux","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/","title":{"rendered":"How to Install ClamAV for Malware Scanning on Amlalinux"},"content":{"rendered":"\n<p>ClamAV is an open-source antivirus software toolkit widely used for detecting malware and viruses on Linux servers. Installing and setting up ClamAV is straightforward, and it provides a powerful tool to scan files and directories for potential threats. Here\u2019s how to install and configure ClamAV on a Linux system for malware scanning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A Linux sever with at least 2GB RAM<\/li>\n\n\n\n<li>Almalinux operating system should be installed on the server<\/li>\n\n\n\n<li>Sudo SSH access to the server (either with user root or a sudo user)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Update Your System<\/strong><\/h3>\n\n\n\n<p>Before installing any software, it\u2019s always good practice to update your package lists:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Install ClamAV<\/strong><\/h3>\n\n\n\n<p>Almalinux base repo does not contain packages for installing Clamv. However, we can get them from the EPEL repo (Extra packages for Enterprise Linux). Hence, add that first.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install epel-release -y\n\nsudo dnf install clamav clamd clamav-update<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"301\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png\" alt=\"\" class=\"wp-image-16249\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-300x88.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-768x226.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670.png 1113w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3:  Add ClamAV user on Rocky Linux or AlmaLinux<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo groupadd clamav\nsudo useradd -g clamav -s \/bin\/false -c \"Clam Antivirus\" clamav<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Update ClamAV Virus Definitions<\/strong><\/h3>\n\n\n\n<p>After installing ClamAV, you should update the virus definitions to ensure ClamAV has the latest signatures for detecting threats.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo freshclam<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Enable LocalSocket<\/strong><\/h3>\n\n\n\n<p>If you are setting up a simple, local clamd instance, then enable the LocalSocket option in its scan configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sed -i 's\/#LocalSocket \\\/run\/LocalSocket \\\/run\/g' \/etc\/clamd.d\/scan.conf<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 6:  Create Systemd file freshclam<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a service file for Freshclam to run as a background service.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/usr\/lib\/systemd\/system\/freshclam.service<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add the following configuration:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription = ClamAV Scanner\nAfter = network.target\n\n&#91;Service]\nType = forking\nExecStart = \/usr\/bin\/freshclam -d -c 1\nRestart = on-failure\nPrivateTmp = true\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save and close the file.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"933\" height=\"327\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-675.png\" alt=\"\" class=\"wp-image-16272\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-675.png 933w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-675-300x105.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-675-768x269.png 768w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 7: Start FreshClam and Clamd scanner services<\/strong><\/h3>\n\n\n\n<p>Starting the <code>clamd<\/code> service allows you to perform scans without initializing ClamAV each time.<\/p>\n\n\n\n<p><strong>Start and Enable freshclam<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start freshclam\nsudo systemctl enable freshclam<\/code><\/pre>\n\n\n\n<p>You can also check its statuses<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status freshclam<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"213\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-673.png\" alt=\"\" class=\"wp-image-16269\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-673.png 811w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-673-300x79.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-673-768x202.png 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/figure>\n\n\n\n<p>In case you want to stop the service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop freshclam<\/code><\/pre>\n\n\n\n<p><strong>Start and Enable Clamd Scanner service\u00a0\u00a0<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start clamd@scan\nsudo systemctl enable clamd@scan<\/code><\/pre>\n\n\n\n<p>You can also check its statuses<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status clamd@scan<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"454\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-674.png\" alt=\"\" class=\"wp-image-16271\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-674.png 972w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-674-300x140.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-674-768x359.png 768w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/figure>\n\n\n\n<p>In case you want to stop the service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop clamd@scan<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 8 : Run a Scan<\/strong><\/h3>\n\n\n\n<p>You can scan directories or specific files with the <code>clamscan<\/code> command.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Scan a file <\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo clamscan filename<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Scan a Directory<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The <code>-r<\/code> flag performs a recursive scan, scanning all subdirectories within the specified path.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>clamscan -r \/path\/to\/directory<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Scan and Remove Infected Files<\/strong>\/<strong>Directories<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The <code>--remove<\/code> option will delete infected files (use with caution).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo clamscan --remove filename\nsudo clamscan -r --remove directoryname<\/code><\/pre>\n\n\n\n<p><strong>Scan and Generate a Log<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This command saves scan output to <code>\/var\/log\/clamav\/scan.log<\/code> for later review.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>clamscan -r \/path\/to\/directory | tee \/var\/log\/clamav\/scan.log<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 9: Schedule Regular Scans (Optional)<\/strong><\/h3>\n\n\n\n<p>To automate scans, set up a cron job. For example, to scan <code>\/home<\/code> daily:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the cron editor:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -e<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add the following line to schedule a scan at midnight each day:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>0 0 * * * \/usr\/bin\/clamscan -r \/home | tee -a \/var\/log\/clamav\/daily_scan.log<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 10: Enable On-Access Scanning (Optional)<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On-Access scanning provides real-time protection by monitoring specific directories for malicious files. Follow the steps below to enable it.<\/li>\n\n\n\n<li>Stop clamd service<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop clamd@service<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Now, enable On-Access in the ClamAV scan configuration file:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sed -i 's\/#OnAccessPrevention yes\/OnAccessPrevention yes\/g' \/etc\/clamd.d\/scan.conf<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"180\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-676-1024x180.png\" alt=\"\" class=\"wp-image-16273\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-676-1024x180.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-676-300x53.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-676-768x135.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-676.png 1042w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>With the above command, we enabled this service in the Scan.conf file. If you want the Scanner to monitor some directory or file, declare that in the Scan.conf file as well by manually editing this file <strong>\/etc\/clamd.d\/scan.con<\/strong>f and declaring your folder\/file in the format below<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>OnAccessIncludePath <em>path-to-folder<\/em><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If not like above, you can also do it as below. Let&#8217;s say I want to enable On-Access scan monitoring for my Home directory.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sed -i 's\/#OnAccessIncludePath \\\/<strong>home<\/strong>\/OnAccessIncludePath \\\/<strong>home<\/strong>\/g' \/etc\/clamd.d\/scan.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You also want to exclude your Clamd user from scanning to make sure it will not get blocked accidentally:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sed -i 's\/#OnAccessExcludeUname clamav\/OnAccessExcludeUname clamscan\/g' \/etc\/clamd.d\/scan.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start Daemon and On-Access Scanner service manually:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su - clamav -c \"\/usr\/local\/bin\/clamd\"\nsudo clamonacc<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run clamd service as well:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start clamd@service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"167\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-677-1024x167.png\" alt=\"\" class=\"wp-image-16274\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-677-1024x167.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-677-300x49.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-677-768x125.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-677.png 1051w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In case you get the following error while starting the Clamd service, then follow the steps further to resolve this error.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start clamd@service Job for clamd@service.service failed because the control process exited with error code. See \"systemctl status clamd@service.service\" and \"journalctl -xeu clamd@service.service\" for details.<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create a New Service Configuration File<\/strong>: If the Clamd service file does not already exist on your system, then create the one using:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/clamd.d\/service.conf<\/code><\/pre>\n\n\n\n<p>Add the following basic configuration and save the file by pressing Ctrl+X, Y, and Enter keys.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Example ClamAV Daemon configuration file\nLogFile \/var\/log\/clamd.service.log\nLogFileMaxSize 2M\nLogTime yes\nLogVerbose yes\nPidFile \/var\/run\/clamd.service.pid\nDatabaseDirectory \/var\/lib\/clamav\nTCPSocket 3310\nTCPAddr 127.0.0.1<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set file correct permissions and ownership<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod 644 \/etc\/clamd.d\/service.conf\nsudo chown clamav:clamav \/etc\/clamd.d\/service.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Update the Systemd Service Unit<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/systemd\/system\/clamd@service.service<\/code><\/pre>\n\n\n\n<p><strong>Make sure it includes this below<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Service]\nExecStart=\/usr\/sbin\/clamd --config-file=\/etc\/clamd.d\/service.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save and close file.<\/li>\n\n\n\n<li>Reload systemd and Restart the Service<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl start clamd@service.service<\/code><\/pre>\n\n\n\n<p>Verify the Service Status<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status clamd@service.service<\/code><\/pre>\n\n\n\n<p><strong>Create clamonacc Service file (optional)<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To ensure the On-Access Scanner service starts automatically after a system reboot, you need to create a systemd file.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/usr\/lib\/systemd\/system\/clamonacc.service<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Copy-paste the below-given line in the file:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=ClamAV On Access Scanner\nRequires=clamd@service\nAfter=clamd.service syslog.target network-online.target\n\n&#91;Service]\nType=simple\nUser=root\nExecStart=\/usr\/bin\/clamonacc -F --log=\/var\/log\/clamonacc --move=\/tmp\/clamav-quarantine\nRestart=on-failure\nRestartSec=7s\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save the file by pressing\u00a0<strong>ESC <\/strong>followed by <strong>:wq<\/strong>\u00a0and then <strong>Enter<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"285\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-679-1024x285.png\" alt=\"\" class=\"wp-image-16276\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-679-1024x285.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-679-300x83.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-679-768x214.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-679.png 1222w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You also need to create a log file and Quarantine directory declared in the above lines:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo touch \/var\/log\/clamonacc\nsudo mkdir \/tmp\/clamav-quarantine<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start and Enable clamonacc service<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl start clamonacc\nsudo systemctl enable clamonacc<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"112\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-680-1024x112.png\" alt=\"\" class=\"wp-image-16277\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-680-1024x112.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-680-300x33.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-680-768x84.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-680.png 1221w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check status of the service<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status clamonacc<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"915\" height=\"207\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-681.png\" alt=\"\" class=\"wp-image-16278\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-681.png 915w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-681-300x68.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-681-768x174.png 768w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can use the command below to check what are services of this Antivirus running on our system, run:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ps -ef | grep clam<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 11: Uninstall (optional)<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you need to uninstall ClamAV from  your AlmaLinux, then run:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf remove clamav clamd clamav-update<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Author&#8217;s final word<\/h4>\n\n\n\n<p>ClamAV provides a robust antivirus solution for Linux systems, and with these steps, you can efficiently configure it to protect your system from malware. Regular updates, scheduled scans, and log reviews ensure comprehensive protection.<\/p>\n\n\n\n<p>To\u00a0learn more about the ClamAV scanner and its commands, you may check their <strong><a href=\"https:\/\/docs.clamav.net\/manual\/Usage\/Scanning.html#clamd\" target=\"_blank\" rel=\"noreferrer noopener\">Official Documentation.<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ClamAV is an open-source antivirus software toolkit widely used for detecting malware and viruses on Linux servers. Installing and setting up ClamAV is straightforward, and it provides a powerful tool to scan files and directories for potential threats. Here\u2019s how to install and configure ClamAV on a Linux system for malware scanning. Prerequisites Step 1: [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,1824,1879,2128],"doc_tag":[],"class_list":["post-16243","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-06","word_count":1193,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install ClamAV for Malware Scanning on Amlalinux -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install ClamAV for Malware Scanning on Amlalinux -\" \/>\n<meta property=\"og:description\" content=\"ClamAV is an open-source antivirus software toolkit widely used for detecting malware and viruses on Linux servers. Installing and setting up ClamAV is straightforward, and it provides a powerful tool to scan files and directories for potential threats. Here\u2019s how to install and configure ClamAV on a Linux system for malware scanning. Prerequisites Step 1: [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-31T09:35:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/\",\"name\":\"How to Install ClamAV for Malware Scanning on Amlalinux -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-670-1024x301.png\",\"datePublished\":\"2024-10-30T12:41:02+00:00\",\"dateModified\":\"2024-10-31T09:35:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-670-1024x301.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-670-1024x301.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-install-clamav-for-malware-scanning-on-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install ClamAV for Malware Scanning on Amlalinux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install ClamAV for Malware Scanning on Amlalinux -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Install ClamAV for Malware Scanning on Amlalinux -","og_description":"ClamAV is an open-source antivirus software toolkit widely used for detecting malware and viruses on Linux servers. Installing and setting up ClamAV is straightforward, and it provides a powerful tool to scan files and directories for potential threats. Here\u2019s how to install and configure ClamAV on a Linux system for malware scanning. Prerequisites Step 1: [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/","article_modified_time":"2024-10-31T09:35:26+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/","name":"How to Install ClamAV for Malware Scanning on Amlalinux -","isPartOf":{"@id":"https:\/\/www.truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png","datePublished":"2024-10-30T12:41:02+00:00","dateModified":"2024-10-31T09:35:26+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-670-1024x301.png"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-install-clamav-for-malware-scanning-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Install ClamAV for Malware Scanning on Amlalinux"}]},{"@type":"WebSite","@id":"https:\/\/www.truehost.com\/support\/#website","url":"https:\/\/www.truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/www.truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/www.truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/www.truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=16243"}],"version-history":[{"count":12,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16243\/revisions"}],"predecessor-version":[{"id":16282,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16243\/revisions\/16282"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=16243"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=16243"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=16243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}