Enabling Antivirus Scanning for Uploaded Files
Subscription
DXP 7.3 SP 1+, Portal 7.3 GA7+, and DXP 7.2 FP 9+
This feature is not currently available on Portal 7.2 and earlier versions.
You can automatically scan any file uploaded to Liferay DXP for viruses. When enabled, the scanner checks every file upon upload, including Documents & Media file creations, Objects attachment fields, and more.

Liferay integrates with the ClamAV Daemon (Clamd). For best performance, run Clamd on a separate server.
Here’s how to enable the antivirus scanning:
-
On a separate server, configure and start Clamd.
ImportantLoad your ClamAV database before starting Clamd.
-
Enable antivirus for your File Store (Document Library) by setting the following portal property or Docker environment variable.
Portal property:
dl.store.antivirus.enabled=trueDocker environment variable:
-e LIFERAY_DL_PERIOD_STORE_PERIOD_ANTIVIRUS_PERIOD_ENABLED=true -
Start your Liferay server.
-
Go to Control Panel → System Settings and select Antivirus in the Security category.
-
Select Antivirus Clamd Scanner in the menu.

-
Enter the Clamd server’s hostname or IP address, port, and a connection timeout time (milliseconds).
-
Click Save.
Now files are scanned when uploaded to Liferay applications. If a virus is detected, the scanner reports the infected file and cancels the upload.
