How to Install broadleaf commerce on Ubuntu Linux

This brief tutorial shows students and new users how to install Broadleaf Commerce on Ubuntu 18.04 | 16.04

Broadleaf Commerce is an enterprise eCommerce platform that provides the next-level eCommerce functionality. With a streamlined and centralized interface, you can enable multiple sites for multiple brands using the same underlying codes.

Not only can you manage your sites, but broadleaf commerce includes product management, order management, catalog management order, checkout modules, and more.

It has comprehensive product features for small, medium, and large businesses that want a platform designed on some of the hottest open-source technologies such as JAVA, Maven, and JavaScript framework.

For more about Broadleaf commerce, please check out its homepage.

To get Broadleaf Commerce installed on Ubuntu, follow the steps below:

Install OpenJDK 8

Broadleaf is a Java-based app so you’ll need Java installed. First, download the Java 8 Development Kit: either the official Oracle JDK or Open JDK

For this tutorial, we’re going to install OpenJDK.

To do that, run the commands below:

sudo apt update
sudo apt-get install openjdk-8-jdk openjdk-8-doc openjdk-8-jre-lib

After installing Java, you can verify it by running the commands below:

java -version

It should output something similar as shown below:

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

After, continue below to install Maven.

Download and Install Maven

After installing OpenJDK version 8 above, use the steps below to download Maven. You will also need the latest version of Maven (at least version 3.3.1, version 3.3.9 is recommended).

Next, go and download Apache Maven latest from its download page.

The recommended version of Apache Maven is 3.3.9. Make sure to check the Maven download page to see if a newer version is available for you to download. If there are, select those and download them instead.

Run the commands below to download version 3.3.9.

cd /tmp

Next, run the commands below to extract the downloaded package to the /opt directory.

sudo tar xf /tmp/apache-maven-*.tar.gz -C /opt

Create a symbolic link to the version folder if you want to have separate versions and update them as they become available.

sudo ln -s /opt/apache-maven-3.3.9 /opt/maven

When the next version is released. all you have to do is update the symbolic link to reference the new release folder by running the command above and updating the release number in the folder name.

Setup Maven Environment Variables

After downloading and extracting the Maven package, go and set up its environment variables. To do that, run the commands below:

sudo nano /etc/profile.d/

Then copy and paste the lines below and save them into the file.

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export M2_HOME=/opt/apache-maven-3.3.9
export MAVEN_HOME=/opt/apache-maven-3.3.9
export PATH=${M2_HOME}/bin:${PATH}

Finally, run the commands below to update and load the changes.

sudo chmod +x /etc/profile.d/
source /etc/profile.d/

Now run the commands below to check the version number.

mvn -version

You should see the content below.

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00)
Maven home: /opt/apache-maven-3.3.9
Java version: 1.8.0_242, vendor: Private Build
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-40-generic", arch: "amd64", family: "unix"

Install Broadleaf Commerce

Now that both OpenJDK and Maven are installed, follow the steps below to download and install Broadleaf Commerce.

First, change into the /tmp directory and download the broadleaf-commerce package.

cd /tmp

Then extract the content into your home directory. Change into the directory and use Maven to download and build all dependencies.

cp -R LegacyDemoSite-broadleaf-5.0.8-GA ~/broadleaf
cd ~/broadleaf
mvn install

That should download all dependencies and build Broadleaf. After a successful build, you should see a similar message as below:

[INFO] Reactor Summary:
[INFO] ecommerce ... SUCCESS [  4.420 s]
[INFO] core ... SUCCESS [01:55 min]
[INFO] admin .. SUCCESS [ 30.036 s]
[INFO] site ... SUCCESS [  7.961 s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:37 min
[INFO] Finished at: 2020-03-16T12:43:58-05:00
[INFO] Final Memory: 48M/346M
[INFO] ------------------------------------------------------------------------

Next, go to the admin folder and start up the service.

cd ~/broadleaf/admim

When you’re done, open your browser and browser to the server hostname or IP address followed by port 8081.


That should brief up the Broadleaf commerce login page.

Broadleaf commerce Ubuntu

Login with the credentials below:

Username: admin
Password: admin

Broadleaf commerce ubuntu


You’ve learned how to install Broadleaf commerce on Ubuntu 18.04 | 16.04. If you find any error above, please report it in the comment form below.