Sunday, 18 May 2025

Install Liferay DXP 7.4 With Postgres SQL + Install Liferay Developer Studio + Set Up Liferay Workspace

Install Liferay DXP 7.4 With PostgreSQL + Liferay Developer Studio

This tutorial walks you through installing Liferay DXP 7.4, connecting it with PostgreSQL, setting up Liferay Developer Studio, and initializing a modular workspace.


🔧 1. Prerequisites

  • Java JDK 8 or 11
  • PostgreSQL 12 or later
  • Liferay DXP 7.4 bundle (.zip)
  • Liferay Developer Studio (Eclipse-based IDE)

🛠 2. Install and Configure PostgreSQL

  1. Install PostgreSQL from official site.
  2. Create a database and user for Liferay:
CREATE DATABASE lportal;
CREATE USER liferayuser WITH PASSWORD 'liferay';
GRANT ALL PRIVILEGES ON DATABASE lportal TO liferayuser;

📦 3. Download and Extract Liferay DXP 7.4

  • Obtain the Liferay DXP 7.4 bundle from your customer portal.
  • Extract it to a preferred directory, e.g., C:\liferay\dxp-7.4

🔌 4. Configure Database Connection

Modify portal-ext.properties in liferay-dxp-7.4/tomcat-9.0.56/webapps/ROOT/WEB-INF/classes or create one in the root:

jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.url=jdbc:postgresql://localhost:5432/lportal
jdbc.default.username=liferayuser
jdbc.default.password=liferay

Place the PostgreSQL JDBC driver postgresql-.jar into:

liferay-dxp-7.4/tomcat-*/lib/ext

🚀 5. Start Liferay DXP

Start the server using:

cd liferay-dxp-7.4/tomcat-*/bin  
./startup.sh (Linux/macOS) OR startup.bat (Windows)

Wait for first-time setup and access:

http://localhost:8080

🧑‍💻 6. Install Liferay Developer Studio

  1. Download from: https://liferay.dev/studio
  2. Install and launch the IDE.

🗂 7. Set Up Liferay Workspace

  1. In Liferay Developer Studio, go to File → New → Liferay Workspace Project
  2. Set the name (e.g., my-liferay-workspace)
  3. Use the default Gradle build type
  4. Link to Liferay DXP bundle (in liferay.workspace.home)

💡 8. Create Your First Module

File → New → Liferay Module Project

Choose template (e.g., MVC Portlet), and define:

  • Project name: sample-portlet
  • Component class name: SamplePortlet

📂 Directory Structure Overview

my-liferay-workspace/
 ├── bundles/
 ├── modules/
 ├── themes/
 ├── wars/
 └── gradle.properties

🚢 9. Deploy the Portlet

Deploy the portlet from Developer Studio or via terminal:

./gradlew deploy

Your portlet should now appear in the Liferay UI → Add → Widgets → Sample Portlet


✅ Conclusion

You have now set up Liferay DXP 7.4 with PostgreSQL, configured your development environment, and created your first module using Liferay Developer Studio and Workspace.

📚 References

No comments:

Post a Comment