Liferay.Design / Handbook
Principles
    About
LexiconResearchResources
Part of Liferay, IncCode/Content Licenses

Installing Portal

Sign In

If you are a product designer working in a Liferay DXP related project this guide might be helpful for you and your daily work.





Getting ready

Note: We usually use zsh as terminal interface.

As a first step, open your terminal.

Install brew

brew install gradle

Install ant

brew install ant

Clone Liferay Portal

Create a folder wherever you want, navigate to it through terminal and clone the repo there:

Recommendation: /Users/your_username/Documents/Liferay

git clone https://github.com/liferay/liferay-portal

Install Java

Download it from Oracle

Configure Java in your machine

Open a new terminal tab and go to your user folder.

cd /Users/your_username

You can use pico or any other terminal text editor.

pico .zshrc

Paste this inside:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
export ANT_OPTS="-Xms4096m -Xmx4096m -XX:MaxPermSize=512m -Dorg.gradle.workers.max=11"

Note: Adjust 'jdk1.8.0_261' to the version number you have just downloaded



Update and run

Updating Portal

Everyday to update your portal you have to do the following from liferay-portal folder

cd /Users/your_username/Documents/Liferay/liferay-portal

Clean bundles

rm -rf ../bundles/data ../bundles/osgi/state

Get the news

git pull

Build them

ant all

Running Portal

You just need to run this from liferay-portal folder

../bundles/tomcat-9.0.53/bin/catalina.sh run

Note: Adjust 'tomcat-9.0.53' to the version number in bundles folder

Useful commands

Changing to DXP version

ant setup-profile-dxp

Changing to Portal version

ant setup-profile-portal

After any of them you might need to get the bundle snapshot

ant snapshot-bundle


Tips and tricks

Aliases let allow us to write our custom commands so we don't have to remember everything. You just need to write them in your .zshrc file.

Configuring

Go to your user folder

cd /Users/your_username

Edit .zshrc file

pico .zshrc

Paste all this inside

# Go to portal
function portal {
cd /Users/your_username/Documents/Liferay/liferay-portal
}
# Cleans bundles
function portal-bundle-clean {
rm -rf ../bundles/data ../bundles/osgi/state
}
# Cleans bundles (to run Asset Libraries) and runs portal
function portal-run {
portal-bundle-clean &&
../bundles/tomcat-9.0.53/bin/catalina.sh run
}
# Updating Portal
function portal-update {
git pull && ant all
}

Now, restart your terminal.

Excuting

Go to portal:

portal

Update your portal, if needed:

portal-uptate

Run portal:

portal-run


Recovering from errors

Make sure there are no other java processes running in the same port.

pkill java

Sometimes it might not work due to a bad update or databases problems.

git clean -fdx

then run,

portal-update
Something to improve? Report an issue!
Menu