How to Install JasperReports Server on Ubuntu Linux




The article provides a comprehensive guide on how to install and use JasperReports, a Java-based, open-source reporting engine on Ubuntu Linux. It includes steps to install prerequisite software such as OpenJDK and MariaDB, the creation of a database account, and setting up a Tomcat server. Instructions are also provided to download the JasperReports files, configure…

This article describes the steps to install and use the JasperReports server on Ubuntu Linux.

JasperReports library is an open-source reporting engine that is entirely written in Java. As a result, developers can use JasperReports as a stand-alone reporting and analytics library server.

It can use data from any data source and produce pixel-perfect documents that can be viewed, printed, or exported in various document formats, including HTML, PDF, Excel, OpenOffice, and Word.

Below is how to install and use the JasperReports library server on Ubuntu Linux.

How to install and use JasperReports server on Ubuntu Linux

As described above, the JasperReports library is an open-source reporting engine entirely written in Java. Developers can use JasperReports as a stand-alone reporting and analytics library server.

Below is how to install and use it on Ubuntu Linux.

Install Java OpenJDK

Because JasperReports is written in Java, you’ll need Java installed on the server to install JasperReports.

The open-source Java JDK app will work perfectly with JasperReports. Below is how to install OpenJDK on Ubuntu Linux.

sudo apt update
sudo apt install default-jdk

After installing OpenJDK, you can run the commands below to view the version installed.

java --version

For additional resources on installing and managing OpenJDK, read the post below.

How to install OpenJDK on Ubuntu Linux

Install MariaDB

JasperReports needs a database to store its data. MariaDB should be a great place to start if you are looking for an open-source database with JasperReports.

Run the commands below to install MariaDB.

sudo apt update
sudo apt install mariadb-server

For additional resources on installing MariaDB, read the post below.

How to install MariaDB on Ubuntu Linux

Create database account

Now that the MariaDB database is installed let’s create an account we will use with JasperReports.

Log on to the database console shell.

sudo mysql

Then, run the SQL statement below to create an account named jasparadmin with a password.

GRANT ALL ON *.* to jasperadmin@localhost identified by 'type_password_here';

Then save and exit.


Install Tomcat server

JasperReports also needs a Java-based Web server application. Therefore, the Tomcat server is what you will need to use with JasperReports.

Below is how to install the Tomcat server.

First, create a user and group accounts to use with Tomcat.

sudo groupadd tomcat
sudo useradd -s /bin/bash -g tomcat -d /opt/tomcat tomcat

Create a Tomcat account home directory, then download and extract Tomcat content into the directory.

sudo mkdir /opt/tomcat
sudo tar -xzvf apache-tomcat-8.5.83.tar.gz -C /opt/tomcat --strip-components=1

Next, change the ownership of Tomcat’s directory to be owned by the Tomcat user account.

sudo chown -R tomcat: /opt/tomcat
sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'

Create a systemd service config for Tomcat so the service can be started, stopped, and reloaded on demand.

sudo nano /etc/systemd/system/tomcat.service

Copy the content below and save it into the file.

Description=Tomcat webs servlet container



Environment="CATALINA_OPTS=-Xms1024M -Xmx2048M -server -XX:+UseParallelGC"



Exit and save the file.

Next, reload the systemd daemon and start the Tomcat service. If you run systemd with the status option, it should show Tomcat started and running.

sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo systemctl status tomcat

Install JasperReports

Now that we have installed all the server requirements for JasperReports, let’s go and download JasperReports files and configure them.

Change as a Tomcat user.

sudo su - tomcat

Then, download the latest version of JasperReports.


Unzip the downloaded file.


After that, run the command below to copy the MySQL properties file to create a default master properties file.

cp jasperreports-server-cp-8.0.0-bin/buildomatic/sample_conf/ jasperreports-server-cp-8.0.0-bin/buildomatic/

Run the commands below to open the newly created file.

nano jasperreports-server-cp-8.0.0-bin/buildomatic/

Then, edit the highlighted lines to include the database user account created above.

# if linux package managed tomcat instance, set two properties below

CATALINA_HOME = /opt/tomcat
CATALINA_BASE = /opt/tomcat 

#database type

#database location and connection settings

Save and exit.

Nest, run the commands below to install JasperReports.

cd jasperreports-server-cp-8.0.0-bin/buildomatic/

You should see a successful build at the end of the output file. If not, make sure you follow the steps above correctly.

[echo] Installation successfully completed!

Total time: 1 minute 26 seconds
Checking Ant return code: OK

Restart the Tomcat service after all the changes above.

sudo systemctl restart tomcat

Access JasperReports portal

At this point, all is set, and JasperReports is ready. Next, open your web browser and browser to the server’s hostname or IP address, followed by port number 8080 with uri /jasperserver.


You should see the JasperReports portal.

ubuntu linux install jasperreports portal
Ubuntu Linux installs the JasperReports portal.

Use the account below to log in:

  • Username: jasperadmin
  • Password: jasperadmin
ubuntu linux jasperreport dashboard
ubuntu Linux jasper report dashboard

Configure JasperReports to use a proxy

The most efficient way to use JasperReports is to set up a reverse proxy server. Below are two ports you can read and learn how to use JasperReports with a reverse proxy.

A good reverse proxy configuration file should look similar to the one below.

upstream tomcat {
    server weight=100 max_fails=5 fail_timeout=5;

server {

location = / {
    return 301;

location / {
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://tomcat/;

That should do it!


This post showed you how to install and use JasperReports on Ubuntu Linux. Please use the comment form below if you find any errors above or have something to add.

Like this:

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.