Install Apache JMeter on Ubuntu 20.04 LTS Focal Fossa

Apache JMeter is open-source like any other Apache foundation project. It is meant to analyze system functional behavior by running performance tests, regression tests, stress tests, and database servers based on different technologies. However, earlier it was designed to test only web applications.

JMeter is Java-based, hence can be used to know what would be the performance of various applications and software. It sends a request to web or application servers for different loads by simulating browser behavior. The scripting language for JMeter is Groovy (an object-oriented programming language used for the Java platform). Browser plugins are also supported in this testing platform.

What do we require to perform this tutorial?

• Ubuntu 20.04 LTS Server or Desktop
• A user with sudo rights.

 

Steps to install Apache JMeter on Ubuntu 20.04 LTS – command line

The given steps can be used for other Ubuntu versions such as 21.04/22.04 including Linux mint.

#1st method using Ubuntu repository

1. System update

First, run the system update command that will ensure all the existing packages of our Ubuntu 20.04 are up to date and will also refresh the repository cache as well.

sudo apt update

 

2. Install Java

As Apache Jmeter is based on Java, hence our system must have Java installed to run it. If you already have the latest version of JRE or JDK then simply skip this step otherwise use the below command to get it. JMeter requires Java 8 or higher.

Here we are installing the available OpenJDK 11:

sudo apt install openjdk-11-jdk

 

3. Download Apache JMeter file

The latest version while doing this tutorial was version 5.4.1, however, you can get the latest one from the official download page JMeter.

wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.4.1.zip

 

4. Install JMeter on Ubuntu 20.04 LTS

Now, extract the downloaded file and for convenience change the name of the extracted folder.

Check the downloaded zip file and replace the version of that in the below-given commands:

ls
unzip apache-jmeter-5.4.1.zip

Change the folder name:

mv apache-jmeter-5.4.1 jmeter

Move it to somewhere safe such as /opt directory

sudo mv jmeter /opt

 

5. Add the Jmeter folder to your system path

To easily access the Jmeter commands line tools without switching to its directory again and again, simply add its folder to your system path

echo 'export PATH="$PATH:/opt/jmeter/bin"' >> ~/.bashrc
source ~/.bashrc

Now, we can start it using a command i.e:

jmeter

 

6. Create Desktop and Application Shortcut

Well, those who are regular users of Apache Jmeter, can create a Desktop as well as Application launcher shortcut to readily access this testing application.

Create a Desktop shortcut file

nano ~/Desktop/Jmeter.desktop

Paste the following lines:

[Desktop Entry]
Version=1.0
Type=Application
Name=Apache-Jmeter
Comment=Trading
Exec=/opt/jmeter/bin/./jmeter.sh
Icon=/opt/jmeter/docs/images/jmeter_square.png
Terminal=false
StartupNotify=false

Save the file by pressing Ctrl+O, hit the Enter key, and then Ctrl+X to exit the file.

Change file permission:

chmod 4775 ~/Desktop/Jmeter.desktop

Allow launching of file:

You will have a Shortcut file on your Ubuntu Dekstop, simply right-click on the file and select the “Allow launching” option.

Allow Launching Desktop shortcut

Command to install Apache Jmeter on Ubuntu 20.04

Also, add the shortcut in your Application launcher:

sudo cp ~/Desktop/Jmeter.desktop /usr/share/applications/

Aapche Jmeter Application Launcher

 

 

 

Leave a Reply

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