Starting Liferay as a Windows Service

Instructions #

From {tomcat_dir}/bin, type:

 service install [service_name] (i.e. service install Liferay)

That will install Liferay as the service name, and register it as "Apache Tomcat Liferay" within Windows' Service viewer.

Then to edit, again in {tomcat_dir}/bin, simply type:

 tomcat5w //ES//[service_name] (i.e. tomcat5w //ES//Liferay)

This will bring up a GUI where you can then change the service's settings. You will want to do the following:

In the Java tab:

Make sure "Use default" is unchecked. Point your Java Virtual Machine to:

 C:\Program Files\Java\jdk1.5.0_08\jre\bin\server\jvm.dll

(obviously point this to the right version JDK that you have, as installation may differ)

Add the arguments to the Java Options:


replacing the {tomcat_dir} with the full directory path of your liferay installation.

Change the Initial memory pool & Maximum memory pool to 512 and 1024 respectively.

In the Startup tab: (optional)

Change the working directory to the full directory path of the bin folder from your liferay installation (ex. : C:\Program Files\Liferay\Social Office 1.0b1\bin). This is handy when liferay's HSQLDB Database (lportal.script) is already in the bin folder (the default) and we still want to use it.

HSQLDB database #

If you are using HSQLDB as your database (the default) then you will either need to set the services' working directory or you could explicitly state where the HSQLDB files are located. To do this, edit the ROOT.xml configuration file in %TOMCAT_HOME%\conf\Catalina\localhost

Modify the url line to include the path to the HSQLDB database by adding ${catalina.home}/bin/


Removing the Service #

To remove the window service for tomcat, which in this case is named 'Tomcat5'

  tomcat5 //DS//[service_name] (i.e. service //DS//Liferay)

Other options #

Alternatively it is also possible to use JavaService:

0 Attachments
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Threaded Replies Author Date
This does not seem to work with tomcat6 and... uwe lynen October 3, 2008 12:32 PM
Hi Uwe, Did you figure out how to make this... Richard Becher October 10, 2008 8:45 AM
It does not work, because -XX:MaxPermSize is... Fabian Barney November 7, 2008 5:35 AM
I seem to have trouble with Liferay bundled... Ben L March 30, 2009 4:58 PM
I have not managed to get this to work... justin van didden April 2, 2009 12:08 AM
Folks, Yo uhave to visit below link for the... Chirag Suthar October 15, 2009 4:32 AM

This does not seem to work with tomcat6 and liferay 5.1.1
Posted on 10/3/08 12:32 PM.
Hi Uwe,

Did you figure out how to make this work using 5.1.1 and tomcat6?


Posted on 10/10/08 8:45 AM in reply to uwe lynen.
It does not work, because -XX:MaxPermSize is NOT set by default when running Liferay as Windows Service.

Setting this param to 128m fixed the problem and it runs without any problems until now.
Posted on 11/7/08 5:35 AM.
I seem to have trouble with Liferay bundled with tomcat 5.2.2.

It works fine if I run the'startup.bat' but when I try to follow these instructions, the service does not start and gives this exception in the log:

23:55:27,341 ERROR [ContextLoader:215] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.wol.service.JIRAActionLocalService.impl'........

Does this also have to do with the jvm.dll I'm pointing to? I'm pointing to the JVM that came installed with the bundle.
Posted on 3/30/09 4:58 PM.
I have not managed to get this to work either.... has anyone got any better sugestions?
Posted on 4/2/09 12:08 AM in reply to Ben L.
Yo uhave to visit below link for the solution.­age/3215420
Posted on 10/15/09 4:32 AM in reply to justin van didden.