Installing JMeter on Ubuntu: A Step-by-Step Tutorial
Apache JMeter is a powerful Java-based tool for performance testing. This tutorial guides you through installing JMeter on Ubuntu, including prerequisites (Java), configuration, and basic usage.
JMeter requires Java (OpenJDK or Oracle JDK). OpenJDK is recommended for Ubuntu due to its ease of installation.
Run the following commands to install OpenJDK 11 (or later):
sudo apt update
sudo apt install openjdk-11-jdk
Verify the installation:
java -version
You should see output like openjdk version "11.x.x" confirming Java is installed.
apache-jmeter-5.6.3.tgz). Use wget to download it:wget https://dlcdn.apache.org/jmeter/binaries/apache-jmeter-5.6.3.tgz
tar -xzf apache-jmeter-5.6.3.tgz
/opt:sudo mv apache-jmeter-5.6.3 /opt/jmeter
To run JMeter from any terminal, add its bin directory to your PATH.
.bashrc or .zshrc):nano ~/.bashrc
export JMETER_HOME=/opt/jmeter
export PATH=$JMETER_HOME/bin:$PATH
Ctrl+O, Enter, Ctrl+X) and apply changes:source ~/.bashrc
Run the following command to check if JMeter is correctly installed:
jmeter -v
You should see version information (e.g., Apache JMeter 5.6.3) and no errors.
If you need plugins (e.g., WebSocket support, custom samplers), install the JMeter Plugins Manager:
lib/ext directory of your JMeter installation:sudo cp jmeter-plugins-manager-1.7.jar /opt/jmeter/lib/ext/
jmeter
test.jmx with your file path) and save results to results.jtl:jmeter -n -t /path/to/test.jmx -l /path/to/results.jtl
.jtl file:jmeter -g /path/to/results.jtl -o /path/to/report
Open the index.html file in the report directory to view metrics.java -version works. If using a non-default Java version, set JAVA_HOME in your profile.chmod +x /opt/jmeter/bin/jmeter to make the JMeter executable runnable.lib/ext directory (see Step 5).This tutorial covers the core steps to install and use JMeter on Ubuntu. For advanced configurations (distributed testing, custom properties), refer to the official JMeter documentation.