Installing Liferay Portal is easy. But before you begin, you should answer a few questions.
- Which version of Liferay will you install?
- On which application server will you install Liferay Portal?
- Can you install a Liferay Portal bundle or do you need to install Liferay Portal on an existing application server?
- Which database will you use with Liferay Portal?
- How do you plan to store your data?
- Can your network support Liferay Portal?
Next, you’ll answer these questions and learn the basic steps for installing Liferay Portal.
Obtaining Liferay Portal
Anyone can download Liferay Portal from liferay.com. Click Product → Downloads, and you’ll be able to download either the open source version of Liferay Portal or a trial of the commercial version in several different formats. These include our convenient bundles as well as
.war files for installing Liferay Portal on your application server of choice.
Liferay enterprise subscribers can download Liferay DXP from the Customer Portal.
So what is a Liferay Portal bundle anyway? A Liferay Portal bundle is an application server with Liferay Portal pre-installed. Using a bundle is the easiest way to install Liferay Portal. Liferay Portal is bundled with a number of application servers; all you need to do is choose the one that best fits your needs. If you don’t currently have an application server preference, consider starting with the Tomcat bundle. Tomcat is one of the most lightweight and straightforward bundles to configure. If you have an open source application server preference, choose the server you prefer from the available Liferay Portal bundles. You must have a JDK (Java Development Kit) installed prior to launching Liferay Portal.
Please note that Liferay Portal is not able to provide application server bundles for proprietary application servers such as WebLogic or WebSphere, because the licenses for these servers don’t allow for redistribution. Liferay Portal’s commercial offering, however, runs just as well on these application servers as it does on the others. You’ll need to follow our manual installation procedure using a
.war file to install Liferay Portal on proprietary application servers.
Once you have Liferay Portal, you can plan out your installation. First, prepare your database. Second, install Liferay Portal. Third, configure your network. Fourth, configure search. You can install Liferay Portal either by using a bundle or by installing it manually on your existing application server. Next, we’ll go over the steps it takes to install Liferay Portal.
Liferay Portal Installation Steps
Before you begin installing Liferay Portal, you should review these basic installation steps:
Choose a database server to use with Liferay Portal and create a new database. Determine whether you want Liferay Portal to manage your database connection or your application server to manage your database connection. We recommend that you let Liferay Portal manage your database connection. Liferay Portal can connect with several open source or enterprise level document repositories.
Gather mail credentials for sending email notifications to users. Determine whether you want Liferay Portal to manage your mail session or your application server to manage your mail session. Liferay Portal provides a built-in mail session but also supports a JNDI mail session. We recommend that you let Liferay Portal manage your mail session.
Install either a Liferay Portal bundle or install Liferay Portal on an existing application server (further instructions below).
Choose IPv4 or IPv6. Determine which address format is best for your network (further instructions below).
Determine how you’ll configure Elasticsearch. Liferay Portal’s default embedded configuration is not supported for production use, so you must install Elasticsearch separately, either on the same infrastructure or on its own.
Configure ports (optional). Liferay’s application server (e.g., Tomcat or Wildfly) uses certain ports for purposes like handling incoming HTTP requests, HTTPS requests, or AJP requests, etc. If you start your application server in debug mode, there’s a port listening for a debugger to connect. If desired, you can configure these ports. Please refer to your application server’s documentation for information on its default ports and how to configure them.
Liferay also provides access to its OSGi framework through a configurable port:
You can override this default property by copying the line above to your
LIFERAY_HOME/portal-ext.propertiesfile and adjusting the port number.
We’ll go through the steps in order, so first we’ll look at the Liferay Portal database.
Step 1: Choose a Database Server and Create a New Database
The recommended way of setting up your Liferay Portal database is also the simplest. Liferay Portal takes care of just about everything. You only need to take two simple steps:
Create a blank database encoded with the character set UTF-8. Liferay Portal is a multilingual application and needs UTF-8 encoding to display all of its supported character sets.
Create a database user for accessing this database. Grant this database user all rights, including the rights to create and drop tables, to the blank Liferay Portal database.
Liferay Portal uses this database user’s credentials to connect to the Liferay Portal database either directly or through its application server. During its initial startup, Liferay Portal creates the tables it needs in the database you just created. It does this automatically, complete with indexes.
This is the recommended way to set up Liferay Portal. It enables Liferay Portal to maintain its database automatically during upgrades or when various Liferay Portal plugins that create database tables of their own are installed. This method is by far the best way to set up your Liferay Portal database.
If you choose to set up Liferay Portal’s database with the recommended permissions described in this section, you can skip to the next section.
Even though Liferay Portal can create its database automatically, some enterprises prefer not to allow the database user configured in an application server to have the database permissions necessary for Liferay Portal and its plugins to maintain their tables. For these organizations, Select, Insert, Update and Delete are the only allowed permissions. Thus, in this section we explain how to set up the database manually. If your organization is willing to grant the Liferay Portal database user the permissions to create and drop tables in the database–and this is the recommended configuration–then simply use the recommended configuration described in the previous section.
Create a new, blank, database for Liferay Portal.
Grant full rights to do anything to the Liferay Portal database to the Liferay Portal database user.
Install Liferay Portal and start it so that it automatically populates its database.
Once the database has been populated with the Liferay Portal tables, remove the permissions for creating and dropping tables from the Liferay Portal database user.
There are some caveats to running Liferay Portal like this. Many Liferay Portal plugins create new tables when they’re deployed. Additionally, Liferay Portal has an automatic database upgrade function that runs when Liferay Portal is upgraded. If the Liferay Portal database user doesn’t have enough rights to create/modify/drop tables in the database, you must grant those rights to the ID before you deploy one of these plugins or start upgrading Liferay Portal. Once the tables are created or the upgrade is complete, you can remove those rights until the next deploy or upgrade. Additionally, your own developers might create plugins that need to create their own tables. These are just like Liferay Portal’s plugins that do the same thing, and they cannot be installed if Liferay Portal can’t create database tables. If you wish to install these plugins, you will need to grant rights to create tables in the database each time before you attempt to install them.
Liferay Portal offers several configurations to store Documents and Media files by setting the
dl.store.impl= property. Available options are Simple File System Store, Advanced File System Store, CMIS Store, DBStore, JCRStore, and Amazon S3Store. In addition, Liferay Portal can be connected to various open source and enterprise-level document repositories. All of the repositories are connected to Liferay Portal through hooks available on Liferay Marketplace (see below).
Once you have your database and document repository ready, you can install Liferay Portal on your server.
Step 2: Gather Your Mail Credentials
Liferay Portal uses a mail server to send email notifications. As part of the install, therefore, you will need to have credentials that Liferay Portal can use to connect to your mail server. Specifically, you’ll need to have the following information:
- Incoming POP Server and port
- POP User Name
- POP Password
- Outgoing SMTP Server and port
- SMTP User Name
- SMTP Password
- A list of JavaMail properties that would override a default configuration
Once you’ve gathered this information, you’re ready to move on to the next step.
Step 3: Install
The next step is to install Liferay Portal. You can do this in one of two ways: by installing Liferay Portal bundled with an application server, or by installing Liferay Portal manually on an existing application server. Each Liferay Portal installation’s Liferay Home contains several folders.
By far the easiest way to get Liferay Portal installed is to use a bundle. Though bundles are pre-packaged for demo purposes, it is very easy to turn them into full, production-ready Liferay Portal instances.
Step 4: Network Configuration
Liferay Portal supports both IPv4 and IPv6 address formats. You must choose between IPv4 or IPv6. By default, Liferay Portal uses IPv4 addresses. If you are using IPv6, you will have to configure Liferay Portal. There are two simple steps.
In the application server’s environment settings, set
portal-ext.propertiesfile in your portal’s Liferay Home folder (if one does not already exist) and set the
tunnel.servlet.hosts.allowedproperty to the target hosts you want to allow (e.g., 0:0:0:0:0:0:0:1).
Step 5: Configure Elasticsearch
Liferay Portal by default ships with an embedded version of Elasticsearch. While this configuration works well for demo purposes, it is not supported in a production installation. After you install Liferay Portal, you’ll need to configure it to connect to a standalone Elasticsearch server or cluster. Depending on the size of your installation, this standalone instance of Elasticsearch can reside either on the same machine you have Liferay Portal on or a different machine. For performance purposes, it is better to install Elasticsearch on a separate machine.
Step 6: Liferay Marketplace and Portal Security
The Liferay Marketplace is an integral part of the Liferay Portal experience. The Marketplace plugin is required to be installed on Liferay Portal. The Marketplace plugin enables a host of features that extend beyond just access to the online Liferay Marketplace. Some of the key features the Marketplace plugin enables are
- Liferay Marketplace: direct access to our online Marketplace
- App Manager: ability to install, uninstall, and update apps
- Bundled Apps: easily manage apps that may come bundled with your Liferay Portal
- Developer Apps: ability to manage apps that you’re developing
- License Manager: streamlined license management for your Liferay Portal and apps
The portal installation process deploys and registers the Marketplace plugin automatically. If you’re installing Liferay Portal in an environment that would prevent this from happening, you’ll have to perform one of several workarounds.
Now that you know where you’re headed, you can install Liferay Portal. If you have decided to install Liferay Portal using a bundle, continue with the next section. If you’re installing Liferay Portal manually, skip to the section for your application server of choice. Once you have Liferay Portal installed manually or via a bundle, you can move on to using Liferay Portal’s Setup Wizard, configuring mail, and installing Elasticsearch.