ATS Global

Scaling Liferay DXP: A Technical Guide to Configuring Amazon S3 Document Storage

Learn how to integrate Amazon S3 with Liferay DXP for scalable document storage. This technical guide covers storage architecture, AWS bucket and IAM configuration, Liferay setup, upload and download verification, troubleshooting, and security best practices.

LIFERAY DXPPublished: OCT 16, 20265 min readBy Jyothi N Share
Scaling Liferay DXP: A Technical Guide to Configuring Amazon S3 Document Storage
Scaling Liferay DXP: A Technical Guide to Configuring Amazon S3 Document Storage

Introduction

As your Liferay DXP platform grows, the volume of assets managed through the Documents and Media library—PDFs, images, videos, and enterprise documents—can quickly outgrow local file system storage. Amazon Simple Storage Service (Amazon S3) provides a highly scalable, external object storage backend that integrates natively with Liferay.

When configured correctly, Liferay continues to manage document metadata, folder structures, and user access controls, while offloading the physical file payload to AWS. This guide walks through the technical architecture, configuration steps, and end-to-end verification required to implement the Liferay S3 Store.

1. Understanding the Storage Architecture

It is critical to understand the division of responsibilities between Liferay and AWS. S3 does not replicate your Liferay folder structure; it simply acts as a secure repository for binary data.

  • Liferay DXP: Acts as the application layer. It manages user authentication, document metadata (stored in the Liferay database), versioning, folder hierarchies, and granular access permissions.
  • Amazon S3: Acts as the physical storage layer. It stores the binary file content as objects, retrieved via API calls triggered by Liferay's S3 Store implementation.

The Request Flow

When a user requests a file, Liferay verifies their permissions, looks up the document's metadata in its database to find the internal storage reference, fetches the physical object via the AWS S3 API, and serves the file back to the user's browser.

Technical Note on Object Keys: The filename a user sees in Liferay (e.g., annual-report.pdf) will rarely match the physical object key in the S3 bucket. Liferay generates its own internal identifiers/paths for S3 objects. Do not expect to browse the S3 bucket like a standard file directory.


2. AWS Environment Preparation

Before touching Liferay, you must provision and secure the underlying AWS infrastructure.

Step 1: Provision the S3 Bucket

  1. Log in to the AWS Management Console and navigate to Amazon S3.
  2. Click Create bucket.
  3. Provide a globally unique name (e.g., liferay-atsglobal-test-2026).
  4. Select the appropriate AWS Region (e.g., ap-south-1 for Mumbai). Note: You will need this exact region code for the Liferay configuration.
  5. Security Check: Ensure Block all public access remains enabled. Your files should only be accessed through Liferay's permission-aware UI, never via direct public S3 URLs.

Step 2: Configure IAM Permissions

Do not use AWS root credentials. Create a dedicated Identity and Access Management (IAM) user or role specifically for Liferay. Apply the principle of least privilege by scoping the IAM policy to the specific bucket ARN and object ARN (arn:aws:s3:::your-bucket-name/*).

Liferay requires the following core actions to manage files:

  • s3:ListBucket
  • s3:GetBucketLocation
  • s3:GetObject
  • s3:PutObject
  • s3:DeleteObject

3. Configuring Liferay DXP for Amazon S3

With the AWS infrastructure ready, configure Liferay to route document payloads to S3.

Step 1: Update Portal Properties

Instruct Liferay to use the S3 Store implementation by adding the following line to your portal-ext.properties file:

dl.store.impl=com.liferay.portal.store.s3.S3Store

Restart your Liferay DXP instance to ensure the new storage implementation class is loaded.

Step 2: Apply S3 Credentials in System Settings

Once Liferay is back online, connect it to your bucket:

  1. Log in as a Liferay Administrator.
  2. Navigate to Control Panel → Configuration → System Settings → File Storage.
  3. Select S3 Store.
  4. Populate the following fields:
  5. Bucket Name: Your exact S3 bucket name.
  6. Access Key & Secret Key: The credentials for your dedicated IAM identity. (Note: If your environment uses the AWS default credentials provider chain—such as an EC2 instance profile—you can leave these blank).
  7. S3 Region: The region code (e.g., ap-south-1).
  8. S3 Endpoint: Leave default for standard AWS S3. (Only modify this if using an S3-compatible service like MinIO).
  9. Click Save.

4. End-to-End Verification of the S3 Integration

Saving the configuration does not guarantee a working integration. You must verify both the write (upload) and read (download) paths.

Phase 1: Verify the Write Path (File Upload)

  1. In Liferay, navigate to Site Menu → Content & Data → Documents and Media.
  2. Upload a simple test file (e.g., Testfile.txt containing the text "This is an S3 integration test.").
  3. Log into the AWS Console, open your S3 bucket, and verify that a new object has been created. (Remember, the object key will be a Liferay-generated ID, not Testfile.txt).

Phase 2: Verify the Read Path (File Download)

  1. Return to Liferay Documents and Media.
  2. Download the Testfile.txt document you just uploaded.
  3. Open the downloaded file and confirm the contents match perfectly.

Troubleshooting Common Failures

Symptom                          Where to Investigate
Upload rejected immediately in LiferayLiferay user permissions, file size/type restrictions.
Liferay cannot communicate with S3Network egress rules, incorrect AWS Region string, or invalid AWS Endpoint.
AWS returns AccessDeniedIAM policy constraints, incorrect Access/Secret keys, or restrictive Bucket Policies.
File uploads, but download failsMismatched Liferay permissions or an incomplete S3 object replication/availability issue.

5. Amazon S3 and Liferay DXP Security Checklist

To maintain enterprise security standards, ensure your deployment adheres to the following:

  • Keep the bucket private: Block public web access so files can only be downloaded by logged-in Liferay users, not via direct internet links.
  • Don't use the master key: Create a dedicated, limited AWS account specifically for Liferay rather than using your main AWS root account.
  • Limit Liferay's reach: Restrict permissions so Liferay can only read and write to its designated document bucket and cannot touch other AWS resources.
  • Hide the passwords: Never save AWS Secret Keys in code repositories (like Git) or shared company documents where they could be accidentally leaked.

Conclusion

By offloading the binary payload to Amazon S3, your Liferay DXP architecture becomes significantly more resilient, easier to back up, and ready to handle massive document repositories without straining local infrastructure.

Working on something similar? See how ATS Global approaches Liferay DXP development, or browse our case studies.

Found this useful? Share it with your network.

Let’s work together

Ready to build something great?

Tell us about your project. We respond within one business day and can provide a customised quote for your requirements.