Legacy Knowledge Base
Published Jun. 30, 2025

Deploying Client Extensions to multiple Virtual Instances

Written By

Joshua Chong

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.

This feature is available with Liferay Workspace version 11.0.0+

This feature is only meant for local development when deploying to a local bundle. It is not intended for building client extensions that will be uploaded to a Liferay SaaS instance via lcp deploy

A client extension LUFFA built with the liferay.virtual.instance.id property set will have virtual instance specific information encoded within it as well as the virtual instance appended to the filename which may result in unexpected behavior when published to a Liferay SaaS instance. When building a client extension intended for Liferay SaaS, perform the build without the property set.

 

The Client Extensions framework already supports deploying to specific virtual instances by setting the dxp.lxc.liferay.com.virtualInstanceId property in the client-extension.yaml as mentioned in our documentation. However, there is a limitation with that method where deploying the same client extension to multiple virtual instances is not possible. If a client extension is deployed to one instance, in order to deploy it to a different instance, it must first be undeployed from the original instance.

A new liferay.virtual.instance.id  Gradle property was added to address this limitation by enabling simultaneous deployments to multiple instances. The dxp.lxc.liferay.com.virtualInstanceId  property will continue to function as before, but specifying the liferay.virtual.instance.id  property will take precedence if both properties are set.

Deploying a client extension to the default Portal instance

By default, running ./gradlew deploy  will still deploy a client extension to the default Portal instance so no additional steps are required.

Deploying a client extension to a non-default virtual instance

You can do this by using the liferay.virtual.instance.id Gradle property when deploying the client extension. There are three methods of doing this:

  1. Within gradle.properties, set the following (replacing “my.web.id” with the Web ID of the virtual instance):

liferay.virtual.instance.id=my.web.id

 

  1. Within settings.gradle, add the following to the liferayWorkspaceextension:

gradle.liferayWorkspace {
  virtualInstanceId = "my.web.id"
}

 

  1. Pass in the following parameter when running the deploy task in the command line:

./gradlew deploy -Pliferay.virtual.instance.id=my.web.id

Deploying the same client extension to multiple virtual instances

After deploying a client extension to the default Portal instance or non-default virtual instance using any of the methods above, simply use one of the deployment methods again replacing my.web.id with the Web ID of the subsequent virtual instance. Repeat as needed.

Did this article resolve your issue ?

Legacy Knowledge Base