How To Install & Configure Liferay CMS on Debian 9

We have a free utility called Liferay CMS and today in we will analyze in detail how to install and configure it in Debian 9.

What is Liferay CMS?

Liferay has been designed as an open source content management software, therefore, free, which is written in Java and uses MySQL to store the data.

Thanks to Liferay CMS we can manage, integrate and publish all our information in multiple ways.

With Liferay CMS we have an application portal which is web-based, through which it will be possible to create websites and portals for the administration of our information.

Liferay has an intuitive programming interface through which any user will have the possibility to create, edit and publish the information professionally.

Install Liferay CMS on Debian 9

1. Now we will see the installation process of the Liferay CMS application in Debian 9. The first step to take will be to update Debian:

sudo apt-get update -y

sudo apt-get upgrade -y

2. Xwiki is a Java-based application, which is why we must install Java 8. By default Java 8 isn't available in the Debian 9 repository. To install Java 8, it will be necessary to add the PPA repository webupd8team to the system by executing the following:

sudo add-apt-repository ppa:webupd8team/java

3. Now, we proceed to update the PPA packages by running:

sudo apt-get update -y

4. Then, we installed Java 8 using the following command:

sudo apt-get install oracle-java8-installer -y

5. Finally, we can validate the Java version by executing the following:

java -version

Install MariaDB on Debian 9

1. By default, the latest version of MariaDB isn't available in the default repository of Debian 9, which is why we are going to add the MariaDB repository to Debian 9. This is achieved by executing the following command:

sudo apt-get install software-properties-common -y

2. Then we execute:

sudo apt-key adv --recv-keys --keyserver 0xF1656F24C74CD1D8

3. Now, we execute:

sudo add-apt-repository 'deb [arch=amd64] stretch main'

4. Now, let's update the repository by running:

sudo apt-get update -y

5. We proceed to install MariaDB by executing the following command:

sudo apt-get install mariadb-server -y

6. When we install MariaDB, we will execute the following command to perform the process of securing the database:

sudo mysql_secure_installation

7. There we will answer the following questions thus:

Enter current password for root (enter for none): Enter

Set root password? [Y/n]: Y

New password:

Re-enter new password:

Remove anonymous users? [Y/n]: Y

Disallow root login remotely? [Y/n]: Y

Remove test database and access to it? [Y/n]: Y

Reload privilege tables now? [Y/n]: Y

8. The script that we have made is responsible for setting the root password, deleting the test database, deleting the anonymous user and not allowing root login from a remote location.

When we have done this, we will execute the following to start the MariaDB service and enable it at system startup:

sudo systemctl start mysql

sudo systemctl enable mysql

9. The next step is to create a database and a user for Liferay. First, we start a session in the MariaDB Shell using the following command:

mysql -u root -p

10. Once we agree, we will do the following:


CREATE USER 'lportal'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON lportal.* TO 'lportal'@'localhost';

flush privileges;



Download and Install Liferay on Debian 9

1. The time has come to download the latest version of the Liferay application included with Apache Tomcat; this is achieved with the following command:


2. We will extract the downloaded content:


3. Now, let's copy the content that has been extracted to the /var/directory:

sudo cp -r liferay-ce-portal-7.0-ga5 /var/liferay

4. Next, we will create a new file called and add details of MySQL, that we will do it using the following command:

sudo nano /var/liferay/tomcat-8.0.32/webapps/ROOT/WEB-INF/classes/

5. In the new deployed file we will paste the following:





6. We save the changes using the following key combination: Ctrl + O

7. We exit the editor using: Ctrl + X

8. Now, let's start the installation of Liferay Portal by running the following script:

sudo bash /var/liferay/tomcat-8.0.32/bin/

9- There we must wait for the application to start ultimately, it will be possible to see the application's registry using the following command:

tail -f /var/liferay/tomcat-8.0.32/logs/catalina.out


Access Liferay on Debian 9

Once the application has been fully started, we go to our web browser and enter the address bar:


In this way, we will be redirected to the Liferay Application Portal.

Thus, we have installed Liferay in Debian 9, and from there it will be possible to have a more collaborative tool for all those activities that require teamwork.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *