How to set up antivirus scanning of files uploaded to Liferay Documents & Media in Liferay PaaS


  • Customers who aren't familiar with Docker can't easily setup ClamAV in Liferay PaaS.
  • How to setup ClamAV in Liferay PaaS to antivirus scan files uploaded to Liferay Documents & Media.


  • Liferay PaaS (Formerly LXC-SM)


  1. Contact your sales representative:
    • "Customers who wish to enable the use custom services on their Liferay Cloud environments must first contact their sales representative in order to enable this functionality and ensure that their environments are provisioned accordingly."
    • Ensure that sufficient resources are available (i.e. memory and CPU) for the custom service to run. Check with the sales representative if unsure of the quotas available.
  2. Add the Custom Service definition in the Liferay PaaS Liferay Workspace repository. Create a new folder called antivirus in the root of the repository (at the same level as the other service folders) and within it upload the attached LCP.json file.
  3. Add the following portal property (either in a properties file in the Liferay PaaS Liferay Workspace repository or as an Environment variable within the environments Liferay service (using the appropriate naming syntax):
  4. Deploy the newly created build that contains the changes above to the target environment and verify that all of the services start as expected.
  5. Login as an Omni Administrator and go to Control Panel > System Settings > Security > Antivirus > Antivirus Clamd Scanner, enter the hostname as antivirus and Save. (This assumes the service name is antivirus and the service is using the default port of 3310.)
  6. Test that files can be uploaded successfully and review the Liferay DXP service logs etc.

NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.


Additional Information


Was this article helpful?
2 out of 2 found this helpful