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

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. Use APT to install Jmeter on Ubuntu 20.04

We can install the Jmeter directly using the default system repository of Ubuntu 20.04. However, the available version through it, will not be the latest one.

sudo apt install jmeter

 

#1st method- by downloading manually 

3. 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

 

4. Download the 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

 

5. 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

 

6. 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

 

7. 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=Testing
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, hitting 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

 

8. Uninstall Jmeter from Ubuntu 20.04

To completely remove the Jmeter from Ubuntu 20.04 use the given command depending on the method you have used to install it.

For APT:

sudo apt autoremove --purge jmeter

For the Manual method:

sudo rm /opt/jmeter
sudo rm /usr/share/applications/Jmeter.desktop ~/Desktop/Jmeter.desktop

 

Other Articles:

How to analyze Linux system boot time with Systemd
Set root user password in Ubuntu 20.04 LTS focal fossa
2 ways to install Oracle Java 17 on Ubuntu 20.04 | 22.04 LTS
How to install Apache web server in Linux step by step

 

1 thought on “Install Apache JMeter on Ubuntu 20.04 LTS Focal Fossa”

Leave a Comment

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