Skip to main content

Install ADempiere on Ubuntu 20.04 LTS

This tutorial will walk you through the process of installing ADempiere 3.9.0 on Ubuntu 20.04 LTS. There are several installation How-To guides available on the internet, making it difficult to choose which to use. Many of the wiki's installation tutorials are out of date and hence useless. I'll keep it as simple as possible so that anyone new to ADempiere or Ubuntu can get it up and running for both development and production environments. First part of this tutorial will focus on getting our development environments ready for further customization of ADempiere.

In this guide, we must complete our tasks inside two unique operational sections, each of which has a list of subsections that must be completed. I have listed them below so that you can understand big picture first before going further.

Section 1: Preparing The Environment for ADempiere Installation#

  1. Install JDK from the OS package repository
  2. Configuring the JAVA_HOME environment variable
  3. Configuring the _JAVA_OPTIONS environment variable.
  4. Setup the PostgreSQL Database Server
  5. Creating an adempiere database user role
  6. Creating an adempiere database.
  7. Granting full access to the adempiere db user on the adempiere database.
  8. Setting up Postfix mail for sending adempiere local system mails.

Section 2: ADempiere Setup and Installation#

  1. Download the ADempiere installation archive from the ADempiere GitHub source.
  2. Download the MD5 checksum content file for the ADempiere release installation archive from the ADempiere GitHub repository.
  3. Create an MD5 checksum of the ADempiere Installation Archive file and compare it to the downloaded checksum value.
  4. If the checksum does not match, download the ADempiere Installation Archive file again.
  5. Move the Adempiere installer archive file to the /opt directory.
  6. Ensure that all.sh shell scripts are located in /opt/Adempiere and /opt/Adempiere/utils.
  7. Allow the root user to utilize the local user's graphical console.
  8. For the first time, execute /opt/Asempiere/Run_setup.sh`.
  9. Verify that all prerequisite tasks have been completed.
  10. If the installer has meet` all of the initial requirements, we proceed with the installation.

Ubuntu OS Installation#

OS Installation is not covered in this tutorial as our focus here is installing ADempiere ERP Software . There is a dedicated tutorial for that. In this tutorial we assume that you have already installed an Ubuntu 20.04 LTS Linux VM with a static IPv4 address and connection to the internet is established and working.

Java JDK Installation#

Java is installed from the Ubuntu repositories. Ubuntu 20.04 includes OpenJDK version 8, which is compatible with the ADempiere version 3.9.0 release that we choose to install.

  • To install OpenJDK-8 run:
sudo apt install -y openjdk-8-jdk

Setting up JAVA_HOME environment variable#

  • Edit the configuration file /etc/environment
sudo nano /etc/environment
  • Add the following code at the end of the above file
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
  • Use key sequence below to save the content in nano editor
Ctrl+x, y, Enter
Livecast: Setting up JAVA_HOME environment variable
Important!

Exception in thread main java.lang.OutOfMemoryError: Java heap space or java.lang.OutOfMemoryError: GC overhead limit exceeded exceptions might occur at any time. These issues could be caused by a lack of memory capacity on your JVM, and you should increase the heap size to resolve them.

Adempiere

This may occur in ADempiere Java Client while running a heavy Jasper Report, requiring you to tune JVM heap size in the system on which ADempiere Java Client is running, or during a month end web-based report processing using Jboss or Tomcat webserver in your ADempiere App Server, requiring you to tune your JVM in your App Server.

You can use following two commands to find the default MaxHeapSize variable of your current java installation.

  • Command option-1 in Linux to view MaxHeapSize
java -XX:+PrintFlagsFinal -version | grep HeapSize

Output:

JVM-MaxHeapSize

  • Command option-2 in Linux to view MaxHeapSize
java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'

Output:

JVM-MaxHeapSize

Note

The default MaxHeapSize in this example system is 2 GB, with a total system memory of 8 GB. It accounts for around 25% of the system's overall RAM.

Setting Up MaxHeapSize in Ubuntu 20.04#

sudo nano /etc/environment
  • Add the following code
export _JAVA_OPTIONS="-Xmx4096m"

Install Percona Distribution for PostgreSQL on Ubuntu#

Percona Distribution for PostgreSQL

Percona Distribution for PostgreSQL provides the best and most critical enterprise components from the open source community, in a single distribution, designed and tested to work together. Patroni, pgBackRest, pg_repack, and pgaudit are among the innovative components we utilize. Backed by Percona’s world-class support and engineering teams, Percona Distribution for PostgreSQL gives companies the peace of mind that these components are tested and configured to work together, with 24×7 support.

Take Care

Ubuntu systems that use the apt package manager include the upstream PostgreSQL server package (postgresql-15) by default. The components of Percona Distribution for PostgreSQL 15 can only be installed together with the PostgreSQL server shipped by Percona (percona-postgresql-15). If you wish to use Percona Distribution for PostgreSQL, uninstall the PostgreSQL package provided by your distribution (postgresql-15) and then install the chosen components from Percona Distribution for PostgreSQL.

Installation Procedure#

Run all the commands in the following sections as root or using the sudo command:

Configure Percona repository#

  1. Install the percona-release repository management tool to subscribe to Percona repositories:
  • Fetch percona-release packages from Percona web:
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
  • Install the downloaded package with dpkg:
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
  • Refresh the local apt package cache:
sudo apt update
  1. Enable the repository
sudo percona-release setup ppg-15

Install packages#

sudo apt install percona-ppg-server-15

Start the service#

The installation process automatically initializes and starts the default database. You can check the database status using the following command:

sudo systemctl status postgresql.service
OUTPUT:
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2023-09-25 09:49:38 +0530; 1 day 4h ago
Main PID: 76466 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 9429)
Memory: 0B
CGroup: /system.slice/postgresql.service
Sep 25 09:49:38 tux systemd[1]: Starting PostgreSQL RDBMS...
Sep 25 09:49:38 tux systemd[1]: Finished PostgreSQL RDBMS.

Connect to the PostgreSQL server#

By default, postgres user and postgres database are created in PostgreSQL upon its installation and initialization. This allows you to connect to the database as the postgres user.

sudo su postgres

Open the PostgreSQL interactive terminal:

psql
TIP

You can connect to psql as the postgres user in one go:

sudo su - postgres -c psql
OUTPUT
psql (15.4 - Percona Distribution)
Type "help" for help.
postgres=#

To exit the psql terminal, use the following command:

\q