How to Setup Liferay Development environment

To work with Liferay, we need to setup Liferay development environment. In this article we will see how to do this.
If you are looking for setup for development environment of Liferay 7 (DXP), refer the article on Liferay 7 development environment setup.

setup liferay development environment

First of all, to setup Liferay development environment, following two items need to be configure properly.
  • Liferay server
    • This is the place where Liferay and all plugins are deployed and can be accessed.
  • Liferay SDK
    • This is where we develop various plugin projects like portlets, hooks, themes, layouts, Ext and web plugins.

Liferay Server Setup

There are two version of Liferay portal available
  1. Community Edition (CE).
  2. Enterprise Edition (EE).

Community version is freely available.We will go through two process to setup fully working liferay environment.
1) Setting up Server (ex. Liferay-tomcat bundle)
2) Setting up Plugin-SDK (Will be used to develop custom plugins like portlets, theme, hook, layout and Extension environment).

Further there are two way to do setup of liferay portal (Server)

1)  With the help of WAR package

  • In this type, we can download WAR file of liferay and we can install on various servers like Tomcat, Jboss etc.

2)  With the help of Bundle (Bundle is the pre-installed liferay on server like tomcat).

The easiest way to jump into liferay developmen is to use liferay-tomcat bundle.
Liferay community portal(Bundle) can be downloaded from following link

Just download and un-zip the tomcat bundle from above link into your local machine’s drive (ex. c:/project). After un-zip the folder name will be something like liferay-portal-6.0-XX-sp2. (This is sample format. XX will be either ce or ee).

The folder structure of bundle will be as blow.

How to Setup Liferay Development environment - Liferay Server Folder Structuredata Folder :-
Liferay-Tomcat bundle comes with embedded HSQL database. data folder shown in screenshot contains the data file of HSQL database along with other data like document library’s folder to store document, lucene index folder etc.

deploy Folder:-
This folder is the place where we can put pluggin’s WAR files and liferay will automatically start deploying on server.

logs Folder:-

Contains log information.

tomcat-6.0.32 (Version may be very) Folder:-

This is actual tomcat server folder. file:-

This is properties file which provide facility to define our own custom properties. This properties can be accessible to all plugins (including portlets, theme,hook,ext and theme).
We also can override properties that is provided by liferay out of the box. (the properties file provided by liferay is while this properties file is means this is the extension of what liferay is providing. If we don’t mentioned any properties in portal-ext file then all properties defined in will be available. We only have to define the properties which we want to override). We also can define our own custom properties in portal-ext file.

Liferay Plugin SDK Setup

First download plugin SDK from following url

Select PluginSDK and click download button from community section (select Plugin-SDK at the last in drop down). This is part of liferay development environment setup.

Next you need to create folder like liferay-plugins-sdk-6.0.6 and unzip the plugin sdk zip file.

We need to create one property file with specific name. The format of name will be as below

E.g. if user name is nilang.patel then property file name will be

(to get logged in user name type echo %username% in command prompt).
paste the following properties in this property file

app.server.type = tomcat
app.server.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32
app.server.deploy.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32\webapps = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32\lib\ext
app.server.portal.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32\webapps\ROOT

Note:-give the respective path for server in above properties.

This file pointing the path of liferay server. Liferay plugins (like portlets, hooks, theme, etc) referring classes present with liferay tomcat bundle. Therefore pointing out the server path with above properties will help to compile these plugins with these API dependencies.

When we build any plugin WAR from Plugin-SDK, it will place WAR file inside deploy folder of server. The whole process will be as below.

How to Setup Liferay Development environment - Liferay Environment

Plugins like Portlets,themes,layouts hooks etc. developed with plugin SDK may only import classes from portal-service.jar and other jar in lib folder of that plugin but will not allow to access classes from portal-impl.jar file which contains implementation of core features as shown in below diagram.

How to Setup Liferay Development environment - Portlet Dependencyportal-service.jar file is available at tomcat/lib/ext folder while portal-impl.jar is available at tomcat/webapps/ROOT/WEB-INF/lib folder

Finally it is done. Now you can start Liferay development.

Recommended For You

About the Author: Nilang

Nilang Patel is a technology evangelist who loves to spread knowledge and helping people in all possible ways. He is an author of two technical books - Java 9 Dependency and Spring 5.0 Projects.

One Comment to “How to Setup Liferay Development environment”

  1. Hello Every One

    How all of you are doing all good.

    I am new to liferay and want to set up for the liferay 7 (Eclipse Mars2+Liferay-tomcat-7.0+Liferay-SDK-7.0)
    But not able to get how to solve these bellow errors like :
    1. Not able to add Liferya-SDK ; Because inside liferay there is no install SDK link
    2. So not able to create nay Protlet by ANT or By MAVEN

    Please any body help me .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.