Installs Liferay Portal, a Java-based, open source enterprise portal. Liferay provides a powerful Web CMS, collaboration, and enterprise integration functionality with a lightweight footprint and flexible development model. See for details.


Liferay Portal

Liferay Portal is an open source enterprise web platform for building business solutions that deliver immediate results and long-term value. Liferay Portal started out as a personal development project in 2000 and was open sourced in 2001.

To get started, check out the project's community homepage at!

This Juju Charm will install the pre-built Liferay Portal bundle, including Apache Tomcat. To use this Charm once it is installed, use your web browser and visit http://:8080 where is the hostname or IP address of the Juju service node running Liferay (discoverable via juju status).

Installing the Liferay Charm

This Liferay Charm has a dependency on the MySQL charm. To create a Juju environment and get started using Liferay, run the following:

$ juju bootstrap
$ juju deploy mysql
$ juju deploy liferay
$ juju add-relation liferay mysql

This will create your Juju environment, deploy MySQL and Liferay, and connect them together via add-relation. For more information on Juju commands, visit The Juju Site.

After a while, Liferay will be up and running on the machine instance that was created for it. You can discover the network address of Liferay by running

$juju status

Look for the public-address setting for the Liferay service, and access Liferay using http://hostname_or_ip:8080. Note that on the first Liferay page you get, the MySQL configuration values are already set to the values necessary to connect Liferay to MySQL and should not be changed. Other settings can be changed as needed, such as the screen name or password of the default user, the name of the portal, and so on.

If something goes wrong, you can view the log files using

$juju debug-log --replay

Charm Service Configuration Options

This charm supports the following configuration options:

  • http-port - The port on which Liferay will listen for HTTP connections (Default: 8080).
  • java-opts - Option string to pass to the Java VM command line during startup. See the config.yaml file for the default settings. This option can be used to, for example, set the default Java VM heap size, or tune garbage collection.

To configure Liferay at deploy time, first create a yaml-formatted text file specifying the values you wish to use.

  http-port: 5050
  java-opts: -Dfile.encoding=UTF8 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx2g -XX:MaxPermSize=512m

Then issue the deploy command, specifying the file: juju deploy --config myconfig.yaml liferay

To modify service configuration after the charm has been deployed, use the juju set command. For example: juju set liferay http-port=4321

Upgrading the Liferay Charm

When a new version of the Liferay Charm is available, you can upgrade to it using the following command:

$ juju upgrade-charm liferay

This command will upgrade to the latest release of the Liferay charm. If the charm also contains support for a newer version of Liferay, the Liferay service associated with the charm will also be upgraded, by downloading the new version of Liferay, migrating configuration from the previous version of Liferay, and starting the new Liferay version in place of the old Liferay version. For more information on how Liferay upgrades itself, see the Upgrading Liferay chapter in Liferay's official documentation.

Currently, the charm will copy your files and your Liferay data directory, but not modify their contents. Future releases of this charm will add additional logic to deal with future Liferay upgrade scenarios.

Stopping the Liferay Charm

The Liferay Charm supports all of the lifecycle operations of Juju, so adding/removing relations, and starting/stopping services will cause Liferay to start and/or stop as needed. To stop the Liferay service, use the juju destroy-service liferay command.

Source Code

Liferay's main source code resides in two repositories: liferay-portal and liferay-plugins. Liferay has additional repositories for the following:

Liferay Portal releases are built from the liferay-portal repository and include select plugins from the liferay-plugins repository. You can build Liferay Portal, its plugins, and/or any of the other supporting technologies from their respective repositories.

Bug Tracker

Have a bug? Please file an issue at following Liferay's JIRA Guidelines.


Stay updated on announcements and more by following Liferay on Twitter, @Liferay.


Read detailed announcements, discussions, and more on Liferay's Blog Stream.


Have questions? Ask them on our very active forums!



Channel: #liferay


Liferay welcomes any and all contributions! Please read the CONTRIBUTING guide for details on developing and submitting your contributions.

Liferay Portal Community Edition License

This library, Liferay Portal Community Edition, is free software ("Licensed Software"); you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; including but not limited to, the implied warranty of MERCHANTABILITY, NONINFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA


(int) TCP HTTP port on which Liferay responds.
(string) Java VM options for Liferay.
-Dfile.encoding=UTF8 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx2g -XX:MaxPermSize=512m