Legacy Knowledge Base
Published Sep. 10, 2025

Files in the document_library folder are owned by the root user

Written By

Gustavo Vasconcelos

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • After executing the portal with the Linux root superuser, some files and folders in the $LIFERAY_HOME/data/document_library folder are now owned by the root user and can't be accessed by the portal when running it with the original portal user (e.g. liferay).

Environment

  • Any Liferay Portal or DXP version running under Linux (or other POSIX-compliant operating system)

Resolution

  • Linux and other POSIX system specifies than any files created by an application will be owned by the user running such application. The same command ran by root, liferay or bchan users will create files and directories owned by the root, liferay and bchan users respectively.
  • Sometimes, specially in maintenance windows, the system administrator can run the portal with a different user, such as root. In those cases, any files added to the document library will have their permissions and ownership set to the root user. While the portal will behave normally under this conditions, if it is stopped and started again with the original, non-superuser user, those files won't be able to be accessed by the portal anymore and will cause issues.
  • The fix for this behavior is to manually change the ownership of the files in the $LIFERAY_HOME/data/document_library (or other DLStore folder you might have configured specifically) back to the original, regular, portal user (e.g.: liferay), using the operating system shell:
# chown -Rv liferay.liferay $LIFERAY_HOME/data/document_library/*

 

Additional Information

  • IMPORTANT: if at any moment the portal is executed by a different user, aside from the document_library files and folder, other system data can be created with incorrect ownership, such as (but not limited to) logs files, temporary files and JVM runtime binaries. You MUST review the whole portal installation folder and manually fix any files or folder than do not belong to the portal regular user.
  • Understanding Linux File Permissions and Ownership (Linux Community Article)

 

Did this article resolve your issue ?

Legacy Knowledge Base