• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero Blog

NameHero Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories

Is It Safe To Disable The Antivirus On Your Linux Server?

Bhagwad Park

Published on: November 24, 2021

Categories: Uncategorized 0

Under what circumstances can we safely disable ClamAV – the ubiquitous antivirus on a Linux server? I recently migrated my site WP-Tweaks to a NameHero “Managed Cloud” VPS. The increased dedicated resources make my site hum along nicely – operations that used to take a long time were near-instantaneous. I’ve often found myself randomly opening my WordPress dashboard just to enjoy seeing it load almost immediately – I’m so used to waiting! However, with so much power comes a responsibility to look after the health of your server.

ClamAV Antivirus Hogging System Memory

Part of this means keeping an eye on system resources, and after the NameHero admin team set up my VPS, I went around kicking the tires of the new InterWorx dashboard and came to a section on “System Graphs”. Here I was able to monitor the various resources of my server – CPU, connections, processes, and more. And to my surprise, there wasn’t as much free memory as I’d expected. It was around 80% full. With 2 GB of RAM, I wondered what was taking up so much space.

So I ran the following command on the SSH terminal to see what was up:

ps -o pid,user,%mem,command ax | sort -b -k3 -r

This Linux command gives you a list of all processes sorted by how much memory they consume, in descending order. Very useful to see which ones are hogging memory!

To my surprise, 42% of the available memory was being used by a service called “clamav”. Upon a little digging, I found that ClamAV is the “de facto” antivirus software installed on Linux servers. The reason it uses up such huge amounts of memory is that it keeps the virus signatures in active RAM, so scanning is fast.

But with 2 GB of RAM quickly getting eaten up ClamAV, I felt I needed to do something.

ClamAV is Mostly Used for E-mail Scanning

Based on my research, I found that the primary purpose of ClamAV is to scan incoming e-mail attachments. The consensus appears to be that the real target of Linux antivirus systems is Windows users who might be vulnerable to malicious e-mail attachments. As a result, Linux servers need to constantly run antivirus software to keep those who receive mail safe and sound.

But I barely use my server for e-mail at all.

Disabling E-mail on the Server

E-mail is one of those messy server functions that I feel is best handled by a 3rd party. There are too many issues to deal with, and spam and viruses are a huge part of that. Not to mention problems like storage, efficient mail delivery, and more. In fact, I’d like to turn off e-mail handling by my server entirely.

So I went to my VPS’s dashboard and systematically disabled all incoming e-mail functionality. I retained the outgoing capability since it’s useful for receiving server notifications. But with nothing coming in, I don’t need to worry about virus attachments and the like.

In my post on e-mail marketing mistakes,

Disabling ClamAV After Disabling Incoming E-mail

Once I’d made sure that I couldn’t receive email from anyone, I went ahead and disabled ClamAV from the InterWorx dashboard:

Disable ClamAV
Disable ClamAV

I also ensure that it couldn’t run on startup:

Ensure ClamAV Doesn't Start on Boot
Ensure ClamAV Doesn’t Start on Boot

Once that was done, I then rechecked my system resources graph to see whether it had made a difference. And it had!

Free System Memory after Disabling ClamAV!
Free System Memory after Disabling ClamAV!

My system’s free memory went from being almost nothing to more than half. And that’s just the way I like it. I suggest everyone tries a similar solution. Find a 3rd party to deliver and accept e-mails on your behalf, and don’t burden your server with the cumbersome antivirus scanning that takes up so much space!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

Speed up your site: solving the WordPress slowdown

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • Website Performance
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Knowledgebase
  • Announcements
  • Affiliates
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 NameHero, LLC. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA