Legacy Knowledge Base
Published Sep. 10, 2025

Deploy Liferay DXP 7.4 as a Service

Written By

Santhosh Kumar

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.

Issue

  • How do you deploy Liferay as a service in Linux?

Environment

  • Liferay DXP 7.4
  • Quarterly Release

Prerequisites

  • Need Root user level.

Resolution

  • Create liferay.service file as root user in /usr/lib/systemd/system/
  • Paste the below content in liferay.service file

[Unit]

Description=Liferay Application Service

After=network.target

[Service]

Type=forking

User=liferay

Environment=JAVA_HOME=/home/liferay/zulu11.62.17-ca-jdk11.0.18-linux_x64

Environment=CATALINA_PID=/home/liferay/liferay-dxp-7.4.13.u67/tomcat-9.0.71/temp/tomcat.pid

Environment=CATALINA_HOME=/home/liferay/liferay-dxp-7.4.13.u67/tomcat-9.0.71

Environment=CATALINA_BASE=/home/liferay/liferay-dxp-7.4.13.u67/tomcat-9.0.71

Environment=CATALINA_TMPDIR=/home/liferay/liferay-dxp-7.4.13.u67/tomcat-9.0.71/temp

Environment='CATALINA_OPTS=-Dfile.encoding=UTF-8 -Djava.locale.providers=JRE,COMPAT,CLDR -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xms8g -Xmx8g -XX:MaxNewSize=2g -XX:MaxMetaspaceSize=1g -XX:MetaspaceSize=1g -XX:NewSize=2g -XX:SurvivorRatio=16 -XX:InitialCodeCacheSize=64m -XX:ReservedCodeCacheSize=96m -XX:TargetSurvivorRatio=50 -XX:MaxTenuringThreshold=15'
ExecStart=/bin/bash /home/liferay/liferay-dxp-7.4.13.u67/tomcat-9.0.71/bin/startup.sh

ExecStop=/bin/bash /home/liferay/liferay-dxp-7.4.13.u67/tomcat-9.0.71/bin/shutdown.sh

[Install]

WantedBy=multi-user.target
  • Run the below commands one by one to enable Liferay as a service
    • systemctl daemon-reload
    • systemctl enable liferay 
    • systemctl start liferay

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base