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
- Install PostgreSQL from official site.
- 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-
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
- Download from: https://liferay.dev/studio
- Install and launch the IDE.
๐ 7. Set Up Liferay Workspace
- In Liferay Developer Studio, go to
File → New → Liferay Workspace Project
- Set the name (e.g.,
my-liferay-workspace
) - Use the default
Gradle
build type - 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.