Installing Apache JMeter on Ubuntu: A Step-by-Step Guide
Apache JMeter is a powerful Java-based tool for performance and functional testing. This guide outlines the most reliable way to install JMeter on Ubuntu (22.04/24.04 LTS), including prerequisites, manual installation, and verification steps.
JMeter requires Java 8 (or newer) to run. Ubuntu’s default package manager (apt) offers OpenJDK, a free and open-source implementation of Java.
sudo apt update && sudo apt upgrade -y to ensure your system has the latest package versions.sudo apt install openjdk-11-jdk -y.java -version. You should see output like:openjdk version "11.0.20" 2023-07-18
OpenJDK Runtime Environment (build 11.0.20+8-post-Ubuntu-1ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.20+8-post-Ubuntu-1ubuntu122.04, mixed mode)
If Java is not found, ensure /etc/profile includes export PATH=$JAVA_HOME/bin:$PATH and run source /etc/profile.Get the latest stable version from the official Apache JMeter website (HTTPS recommended for security).
wget (replace 5.6.3 with the latest version from JMeter’s download page):wget https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.6.3.tgz
Extract the downloaded tarball and move it to /opt (a standard location for third-party applications).
tar -xzf apache-jmeter-5.6.3.tgz
/opt:sudo to move the extracted folder to /opt:sudo mv apache-jmeter-5.6.3 /opt/jmeter
This ensures JMeter is accessible system-wide.Add JMeter’s bin directory to your PATH so you can run jmeter from any terminal.
~/.bashrc (for your user) or /etc/profile (for all users):nano ~/.bashrc
/opt/jmeter with your JMeter path if different):export JMETER_HOME=/opt/jmeter
export PATH=$JMETER_HOME/bin:$PATH
source ~/.bashrc (or source /etc/profile for system-wide changes) to load the new variables.Check if JMeter is correctly installed and accessible.
jmeter
This opens the JMeter graphical interface. Close it after verifying (you’ll use non-GUI mode for performance tests).jmeter -v
You should see output like:Copyright (c) 1998-2023 The Apache Software Foundation
Version 5.6.3
If you encounter errors (e.g., jmeter: command not found), double-check your PATH configuration and run source ~/.bashrc again.For advanced features (e.g., WebSocket testing, JSON parsing), install plugins via the JMeter Plugins Manager:
Options > Plugins Manager.Apply Changes and Restart JMeter.lib/ext (if installing manually):JMeterWebSocketSamplers.jar and place it in /opt/jmeter/lib/ext.java -version works and JAVA_HOME is set in /etc/profile.sudo chmod -R 755 /opt/jmeter to grant read/execute permissions.By following these steps, you’ll have a fully functional JMeter installation on Ubuntu, ready for performance and functional testing.