On this pageWhat server malware looks like
Servers get infected differently from laptops. Nobody double-clicks an email attachment on a web server. Instead, a vulnerable plugin lets an attacker drop a PHP web shell, an exposed Docker API starts a cryptominer, or users upload infected files that the server then hands to everyone else. Antivirus on a server therefore has three distinct jobs: scanning files that other people will download, finding backdoors in web roots, and protecting Windows servers the way Defender protects desktops. This guide covers the free tools that do each job well, merges the cPanel-specific options into the same picture, and is honest about what scanning cannot do.
What server malware looks like
| Threat | Typical way in | What finds it |
|---|---|---|
| Web shell or injected PHP | Vulnerable CMS plugin, stolen FTP or panel password | Linux Malware Detect, ImunifyAV, file integrity monitoring |
| Cryptominer | Exposed service, weak SSH password, unpatched app | CPU monitoring, process audits, EDR agents |
| Infected uploads and attachments | File shares, contact forms, mail | ClamAV in the upload or mail path |
| Rootkit | Full root compromise | Offline disk analysis; rkhunter for known samples |
| Ransomware on Windows | Exposed RDP, phishing, stolen credentials | Microsoft Defender or an EDR product, plus offline backups |
ClamAV: the open-source engine
ClamAV is maintained by Cisco Talos and licensed under GPL-2.0. It is signature-based and fits best where files pass through: mail gateways, file-sharing apps and upload forms. Integrations exist for most of them, from mail filters to Nextcloud's antivirus app, usually talking to the clamd daemon.
Plan the memory first. ClamAV's documentation recommends at least 3 GiB of RAM for the Linux server edition with the standard signature database, because the daemon keeps signatures in memory. On a small VPS, run on-demand scans instead of the daemon, or give scanning its own server.
On Debian and Ubuntu:
sudo apt install clamav clamav-daemon
sudo systemctl enable --now clamav-freshclam clamav-daemon
clamdscan --fdpass --multiscan /srv/uploads
clamscan -r --infected /var/www
freshclam keeps signatures current, clamdscan hands files to the running daemon, and clamscan works without it, at the cost of loading the database for every run. On RHEL-family systems the packages come from EPEL and the service names differ, so check the package documentation.
Linux Malware Detect
Linux Malware Detect (LMD, command maldet) from R-fx Networks targets the threats common on shared hosting: PHP shells, injected code and malicious scripts, with signatures drawn from real incidents. It is GPL-2.0, uses the ClamAV engine when present for speed and coverage, can monitor directories in real time through inotify, and quarantines what it finds. Version 2.0.1, released in April 2026, added native YARA scanning and DEB and RPM packaging.
git clone --depth 1 --branch v2.0.1 https://github.com/rfxn/linux-malware-detect.git
cd linux-malware-detect && sudo ./install.sh
sudo maldet -u
sudo maldet -a /var/www
sudo maldet -e list
The installer adds a daily cron job that scans recently changed files. Review a report with maldet -e SCANID before quarantining its hits with maldet -q SCANID, because a false positive in a live site's code is an outage of your own making.
cPanel, Plesk and DirectAdmin servers
Hosting panels concentrate many websites, and many CMS installs, on one server, which makes scanning worth more there than anywhere else. The free options:
- ClamAV for cPanel. Installed from WHM's plugin manager, it gives each cPanel user a virus scanner for their own files.
- ImunifyAV. CloudLinux's malware scanner integrates with cPanel, Plesk and DirectAdmin and is free to use. The paid ImunifyAV+ adds automatic cleanup, and Imunify360 is the full suite with a firewall, a WAF and proactive defense.
- LMD. Works alongside the panel and picks up its ClamAV engine automatically.
CloudSat offers cPanel as a one-click app; if you start from it, set up a scanner on day one, before the first customer site goes live.
Windows Server: Microsoft Defender Antivirus
Defender Antivirus is built into Windows Server 2016 and later and runs by default. Manage it from PowerShell:
Get-MpComputerStatus | Select-Object AMServiceEnabled, RealTimeProtectionEnabled, AntivirusSignatureLastUpdated
Update-MpSignature
Start-MpScan -ScanType QuickScan
Get-MpThreatDetection
On Windows Server, Defender applies automatic exclusions for installed server roles. Add further exclusions only where a vendor documents them, such as database data files, and keep them as narrow as possible: a broad folder exclusion is a gift to an attacker.
For central visibility across many servers, endpoint detection and response (EDR) products go further than antivirus: Microsoft Defender for Endpoint, CrowdStrike Falcon, SentinelOne, Sophos and ESET all offer agents for Windows and Linux servers. The open-source Wazuh covers part of the same ground with file integrity monitoring, log analysis and vulnerability detection.
Free or paid?
| Need | Free option | When paying makes sense |
|---|---|---|
| Scan uploads and mail | ClamAV | High mail volume where detection rates cost real money |
| Many websites on one panel | LMD, ImunifyAV | Automatic cleanup across hundreds of sites |
| Windows servers | Defender Antivirus, included | You need central alerting, investigation and response |
| A fleet of mixed servers | Wazuh | A team without time to tune and run its own platform |
Paying is worth it when the product saves hours you would otherwise spend cleaning, correlating or responding. It is not worth it as a substitute for patching.
What scanners miss
A signature scanner finds what someone has already seen. A freshly written or obfuscated web shell often passes, and no scanner closes the hole it came through. Combine scanning with the controls that prevent infection or expose it quickly:
- Patching. Turn on
unattended-upgradesordnf-automaticfor the operating system, and update CMS plugins weekly. - File permissions. The web server user should not be able to write to its own code directories. Most web shells depend on that write access.
- File integrity monitoring. AIDE or Wazuh records file hashes and reports changes to code and configuration.
- Outbound filtering. A server that cannot open arbitrary outbound connections is a poor cryptominer and a poor spam relay.
- Backups. A clean copy from before the infection is the fastest cleanup tool there is.
When a scanner does find something, treat it as an incident rather than a deleted file: something let it in. The first 24 hours of incident response apply here too.
FAQ
Do Linux servers need antivirus?
If they store or serve files for other people, or host many websites, yes. A single-purpose application server gains more from patching, integrity monitoring and an EDR or Wazuh agent than from a nightly signature scan.
Will ClamAV run on a 1 GB VPS?
Not comfortably as a daemon, given the 3 GiB recommendation. Use scheduled clamscan runs on the directories that matter, let LMD use its own scanner, or move scanning to a larger server.
Can I scan a server I think is already compromised?
You can, but do not trust the result. Malware running as root can hide files and processes from tools on the same system. Snapshot the disk, attach or restore the copy to a clean machine, and scan it from there.
Is rkhunter still worth running?
As a supplementary check, perhaps. It looks for known rootkits and suspicious file changes, but it produces false positives and cannot detect anything new. Treat its output as a prompt to investigate, not as a verdict.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




