Adding a Virtual Instance
Before you do anything in Liferay DXP to add a virtual instance, you must configure its domain name in your network to point to your installed Liferay DXP system.
Once the domain name is ready, create the virtual instance:
-
Go to Control Panel → Configuration → Virtual Instances.
-
Click the Add button (). This opens the New Instance form.
-
Complete the New Instance form as follows:
Web ID: Specify the instance ID. Using the domain name is a common convention.
Virtual Host: Set the domain name you configured in your network. When people use the domain name, they are directed automatically to this instance.
Mail Domain: Enter the mail host’s domain name for the virtual instance. Email notifications are sent from the instance using this domain.
Max Users: Set the maximum number of user accounts the virtual instance supports. Enter 0
to support unlimited users.
Active: Set the virtual instance to active or inactive. Inactive virtual instances aren’t accessible to anyone, even the administrator.
Virtual Instance Initializer: Choose the site initializer to use on the virtual instance. See Site Initializers for more information.
By setting default.admin.password
to a blank value in your portal properties, you get more options when adding virtual instances. Use these to configure the admin user that’s automatically created on new instances.
Screen Name: Set the screen name for the admin user.
Email Address: Set the email address for the admin user.
Password: Set the account password for the admin user.
First Name: Set the first name for the admin user. The default value is “Test”.
Last Name: Set the first name for the admin user. The default value is “Test”.
Click Save when you’re done filling out the form.
Creating Virtual Instances with Configuration Files
You can set the default values for new virtual instances and their automatic admin users with a configuration file. In your Liferay Home, create a .config
file named com.liferay.portal.instances.internal.configuration.PortalInstancesConfiguration~[virtualHostName].config
. Replace [virtualHostName]
with the name of the virtual host (e.g. com.liferay.portal.instances.internal.configuration.PortalInstancesConfiguration~www.able.com.config
). Here’s an example of possible configurations (some of the properties are only available at newer Liferay versions):
active=B"true"
maxUsers=I"0"
mx="www.able.com"
siteInitializerKey=""
virtualHostname="www.able.com"
addDefaultAdminUser=B"true"
adminPassword="secretPassword" (Liferay DXP 2024.Q4+/GA129+)
adminScreenName="Test Admin" (Liferay DXP 2024.Q4+/GA129+)
adminEmailAddress="admin@www.able.com" (Liferay DXP 2024.Q4+/GA129+)
adminFirstName="Test" (Liferay DXP 2024.Q4+/GA129+)
adminMiddleName="" (Liferay DXP 2024.Q4+/GA129+)
adminLastName="Test" (Liferay DXP 2024.Q4+/GA129+)
Now you can navigate to the instance using its domain name. You’re brought to what looks like a clean install of Liferay DXP. This is your new virtual instance! You can configure it any way you like.