Installing Liferay DXP in Amazon Web Services

You can run Liferay DXP on AWS using a new or an existing EKS cluster; a plain installation or Liferay’s offering on AWS Marketplace. Either installation requires several tools, including Helm, Terraform, and AWS CLI.

Using Liferay DXP in AWS uses a special Helm chart. See Provisioning Liferay in Kubernetes for more information.

Prerequisites

  1. Install Git CLI.

  2. Install AWS CLI.

  3. Configure AWS CLI to use your IAM credentials.

  4. Install the Terraform CLI.

  5. Install the Helm CLI.

  6. Install the kubectl CLI.

  7. Install the Oras CLI (plain installation only).

Log into AWS

First, use the CLI to log into AWS.

  1. Export your profile to use for the AWS SDK and its tools:

    export AWS_PROFILE=[profile name]
    
  2. Log into AWS.

    aws sso login
    

Clone the Terraform Files

Next, clone the terraform files from the repository:

git clone -n --depth=1 --filter=tree:0 https://github.com/liferay/liferay-portal.git liferay-aws-terraform
cd liferay-aws-terraform
git sparse-checkout set --no-cone /cloud/terraform/aws
git checkout
cd cloud/terraform/aws

Now you have all the files necessary to interface with an EKS cluster. Next, you can

  1. Create a new EKS cluster, or

  2. Use an existing EKS cluster.

Create a New EKS Cluster

Use the Terraform CLI to create a new EKS cluster complete with a VPC and networking:

  1. From your terminal’s working directory after the previous step (liferay-aws-terraform/cloud/terraform/aws/), navigate to the eks/ directory.

  2. Edit terraform.tfvars to configure your cluster’s infrastructure as needed. See the variables in variables.tf for reference.

    Note

    By default, the system deploys an EKS cluster in the US West (Oregon) region (us-west-2), spanning two availability zones.

  3. Run these Terraform commands:

    terraform init
    
    terraform apply
    
  4. Follow the prompt to apply your changes.

  5. Write the result of the terraform output command to the terraform.tfvars file in the dependencies/ directory (in liferay-aws-terraform/cloud/terraform/aws/):

    terraform output > ../dependencies/terraform.tfvars
    

Use an Existing EKS Cluster

Create dependent services to use with your EKS cluster:

  1. From your terminal’s working directory (liferay-aws-terraform/cloud/terraform/aws/), navigate to the dependencies/ directory.

  2. Edit terraform.tfvars to configure your cluster’s infrastructure as needed. See the variables in variables.tf for reference.

  3. Run these Terraform commands:

    terraform init
    
    terraform apply
    
  4. Follow the prompt to apply your changes.

Configure Kubernetes for Helm

To use Helm, you must use the AWS CLI to update your Kubernetes configuration.

  1. Navigate to the dependencies/ directory (in liferay-aws-terraform/cloud/terraform/aws/).

  2. Run this command:

    aws eks update-kubeconfig \
        --name $(terraform output -raw cluster_name) \
        --region $(terraform output -raw region)
    
  3. Test this command to confirm that it works:

    kubectl cluster-info
    

Install the Nginx Ingress Controller

Install the Nginx Ingress Controller to expose the Liferay DXP instance to the internet:

helm upgrade nginx-ingress-controller \
    oci://registry-1.docker.io/bitnamicharts/nginx-ingress-controller \
    --create-namespace \
    --install \
    --namespace nginx-ingress-controller \
    --version 11.6.8

Launch Liferay with Helm

Next, use helm to launch Liferay. Liferay uses different helm charts for the plain and AWS Marketplace installations.

Installing the Liferay AWS Marketplace Helm Chart

  1. Go to Liferay DXP’s offering on AWS Marketplace.

  2. On the Launch this software page, find the Launch instructions section and copy the commands listed under Step 2: Launch the software.

Note

You can ignore step 1.

  1. In the commands you copied, add these arguments to the helm install command:

    --set "liferay-aws.liferay-default.ingress.className=nginx" \
    --set "liferay-aws.liferay-default.ingress.enabled=true" \
    --set "liferay-aws.liferay-default.ingress.rules[0].http.paths[0].backend.service.name=liferay-default" \
    --set "liferay-aws.liferay-default.ingress.rules[0].http.paths[0].backend.service.port.name=http" \
    --set "liferay-aws.liferay-default.ingress.rules[0].http.paths[0].path=/" \
    --set "liferay-aws.liferay-default.ingress.rules[0].http.paths[0].pathType=ImplementationSpecific" \
    --set "liferay-aws.liferay-default.serviceAccount.annotations.eks\.amazonaws\.com/role-arn=$(terraform output -raw liferay_sa_role)" \
    
  2. Execute the commands you copied, including the modified helm install command.

    The command installs Liferay DXP with Liferay’s official AWS Marketplace Helm chart, but it takes some time to complete.

  3. Run this command to watch for your Liferay DXP installation to complete:

    kubectl get statefulset liferay-default \
        --namespace liferay-system \
        --watch
    
  4. Wait for the installation to complete to proceed.

Installing the Plain Liferay AWS Helm Chart

  1. In the dependencies/ directory (in liferay-aws-terraform/cloud/terraform/aws/), create a aws-helm-values.yaml file with the following content:

    liferay-default:
      customEnv:
        x-slim-os:
          - name: LIFERAY_NETWORK_HOST_ADDRESSES
            value: https://$(OPENSEARCH_ENDPOINT):443
          - name: LIFERAY_OPENSEARCH_PASSWORD
            value: $(OPENSEARCH_PASSWORD)
          - name: LIFERAY_OPENSEARCH_ENABLED
            value: "true"
      customVolumeMounts:
        x-slim-os:
          - mountPath: /tmp
            name: liferay-persistent-volume
            subPath: system/tmp
          - mountPath: /opt/liferay/elasticsearch-sidecar
            name: liferay-persistent-volume
            subPath: system/es-sidecar
      ingress:
        className: nginx
        enabled: true
        rules:
          - http:
            paths:
              - backend:
                  service:
                  name: liferay-default
                  port:
                    name: http
                path: /
                pathType: ImplementationSpecific
      service:
        annotations: {}
        type: ClusterIP
    
  2. Choose from the available versions of the helm chart using the Oras CLI:

    oras repo tags us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart/liferay-aws
    
  3. Store the selected version in a variable called LIFERAY_AWS_HELM_CHART_VERSION:

    export LIFERAY_AWS_HELM_CHART_VERSION=[version]
    
  4. Install the Liferay AWS helm chart:

    helm upgrade liferay oci://us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart/liferay-aws \
        --create-namespace \
        --install \
        --namespace $(terraform output -raw deployment_namespace) \
        --set "liferay-default.image.tag=2025.q2.0-slim" \
        --set "liferay-aws.liferay-default.serviceAccount.annotations.eks\.amazonaws\.com/role-arn=$(terraform output -raw liferay_sa_role)" \
        --values aws-helm-values.yaml \
        --version ${LIFERAY_AWS_HELM_CHART_VERSION}
    
    Important

    You must use a slim Liferay Docker image. For more information on Liferay image types, see Docker Image Versions

  5. Run this command to watch for your Liferay DXP installation to complete:

    kubectl get statefulset liferay-default \
        --namespace liferay-system \
        --watch
    

Wait for the installation to complete to proceed.

Log Into Your Live Instance

Now Liferay DXP is ready in your EKS cluster, but you must retrieve your credentials to access it.

  1. Extract your Liferay installation’s public DNS with this command:

    kubectl get svc nginx-ingress-controller \
        --namespace nginx-ingress-controller \
        --output jsonpath='{.status.loadBalancer.ingress[0].hostname}'
    

    The command returns the address you can use to access your installation.

  2. In your web browser, paste the address you retrieved from the previous step with https:// in front, like this:

    https://[NUMBER].[REGION].elb.amazonaws.com
    

    Once it finishes loading, a page appears with a Sign In button.

  3. Run this command to retrieve your administrator password:

    kubectl get secret liferay-default \
        --namespace liferay-system \
        --output jsonpath='{.data.LIFERAY_DEFAULT_PERIOD_ADMIN_PERIOD_PASSWORD}' \
        | base64 -d
    
  4. Log in using test@liferay.com as the email and the password you retrieved from the previous step.

Congratulations! You now have access to your own Liferay DXP installation from AWS marketplace.

Recipes related to this article

Capabilities

Product

Education

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy