Do you need antivirus on Linux? An honest answer
Ask this question in any Linux forum and you get two answers: “Linux doesn’t get viruses” and “Of course you need one”. Both are too simple. Whether a virus scanner helps depends on what you do with the machine, and on what you expect the scanner to do.
We build ClamUI, a desktop app for ClamAV, so we have a stake in this. We still think the honest answer for many desktops is “not really”. Here is how to tell which group you are in.
Why Linux desktops get by with less
Section titled “Why Linux desktops get by with less”A typical Linux desktop has a few things going for it:
- Software comes from signed repositories. Most programs are installed through the distribution’s package manager, which checks signatures from a source you already trust. You rarely download and run random installers.
- You don’t work as root. A program you start runs with your user rights. It can still damage your own files, but changing the system needs
sudoand your password. - Sandboxed apps. Flatpak apps run in a sandbox with only the permissions they declare. That limits what a bad app can reach.
- Fewer targets. Most desktop malware is written for Windows. That is not protection, but it does change the odds.
None of this makes Linux immune. It means the usual way malware arrives on Windows, a downloaded installer run with admin rights, is less common.
Where a scanner makes sense
Section titled “Where a scanner makes sense”A scanner earns its place when files reach your machine from outside the trusted channels, or pass through it to other people:
- Files you pass on to Windows or macOS users. A Windows virus does nothing on your Linux machine, but it will run on your colleague’s laptop when you forward the attachment or share the folder. Scanning protects them, not you.
- File servers and shared folders. If your machine serves files over Samba or NFS, or syncs a shared Nextcloud folder, you are a distribution point for whatever lands there.
- Mail servers. This is what ClamAV was built for. Its own documentation describes it as “designed especially for e-mail scanning on mail gateways”.
- Downloads outside the package manager. AppImages, binaries from project pages, game mods, archives from forums, scripts you are about to run. Scanning them before you open them is cheap.
- USB drives and external disks. Especially ones that also go into other computers.
- Rules you have to follow. Some company policies and compliance frameworks require malware scanning on every system, Linux included. A scanner with logs and scheduled scans gives you something to show.
If none of these fit, an occasional scan of your downloads folder is a reasonable middle ground.
What a scanner cannot do
Section titled “What a scanner cannot do”This part matters more than the yes or no. ClamAV is a signature-based scanner. It compares files against a database of known malware. The project is clear that it “is not a traditional anti-virus or endpoint security suite”.
In practice that means:
- It does not stop phishing. A fake login page steals your password without a single malicious file. The best defence there is a password manager that only fills in on the real domain, and two-factor authentication.
- It does not catch everything new. A signature has to exist before a file can match it. Freshly made or targeted malware often has none yet.
- It does not watch what programs do. ClamAV checks files. It does not monitor running processes for suspicious behaviour.
- It does not replace updates. Most real attacks on Linux use known security holes in software that was not updated. Installing updates protects you far more than any scanner.
- It does not scan in real time by default. On-access scanning exists, but you have to set it up. Without it, ClamAV only checks what you ask it to.
A scanner is one layer. Updates, a firewall, careful sudo use, sandboxed apps and backups are the others, and most of them matter more.
A short checklist
Section titled “A short checklist”Before you install anything, check the basics:
- Updates install automatically, or you install them regularly.
- A firewall is active, especially on laptops in public networks.
- You have backups that a compromised account cannot delete.
- You use a password manager and two-factor authentication.
Then decide on scanning:
- You share files with Windows users, run a server, or must follow a policy: set up regular scans, and consider on-access scanning for download and shared folders.
- You download a lot outside the package manager: scan those files before opening them.
- Neither: you are fine without a scanner. An occasional manual scan does no harm.
Where ClamUI fits
Section titled “Where ClamUI fits”ClamUI is a desktop front end for ClamAV. It does not add its own detection engine. It makes the parts above easier to use: scanning files and folders, keeping the database current, scheduling scans, setting up on-access scanning, and handling quarantine. Its security audit also checks the other layers from the checklist, such as automatic updates and the firewall.
If you decided you need a scanner, getting started walks you through your first scan. If you want to know how ClamAV is put together first, read how ClamAV actually works on your desktop.
Comments
Comments use giscus and a GitHub account. They are stored as GitHub Discussions in linx-systems/clamui-blog-comments.