Run massively scalable performance tests on web, mobile, and APIs

Request a Demo
Jun. 27th, 2018

How to Install Gatling on Ubuntu

Load testing with the Gatling framework provides many powerful options, like assertions and flexibility. Read more about Gatling here. But to get started, you need to have Gatling installed. This blog post will teach you how to install Gatling on Ubuntu, through the CLI. If you need to install Gatling on Windows, click here.

 

Install JDK

 

1. Update the Ubuntu packages to the latest version by executing the command sudo apt-get update

 

installing gatling

 

2. Currently Gatling only supports JDK8 so we will install it by executing the commands below:

 

Add Oracle’s PPA (Personal Package Archive) to the list of sources so that Ubuntu knows where to check for the updates.

 

add-apt-repository ppa:webupd8team/java

 

insalling gatling on ubuntu

 

3. Install JDK8 using the following

 

apt-get install oracle-java8-installer

 

gatling installation on ubuntu

 

4. If you have multiple java packages installed on your machine, decide which version to use as the default type by using the following command:

 

update-alternatives --config java

 

gatling framework installation on ubuntu

 

Set the JAVA_HOME environment variable by executing the commands below:

 

5. Open the /etc/environment file by the command vi /etc/environment

 

how to install gatling on ubuntu

 

6. Add the following line at the end of the file and save it.

 

JAVA_HOME="/usr/lib/jvm/java-8-oracle"

 

gatling installation tutorial

   

7. Check to make sure java is installed on the machine by executing the command java –version. Here we can see “java current version”, “java environment version”, “java server version”.

 

guide to gatling installation

 

Install Gatling

 

1. Download the Gatling zip file by executing the command wget https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/2.3.1/gatling-charts-highcharts-bundle-2.3.1-bundle.zip

 

installing jdk and gatling

 

2. Move the file to our directory and unzip the file. In this example we moved it to /root and unzipped the file:

 

ubuntu gatling installation

 

java 8 annd gatling installation ubuntu

 

Then we have:

 

gatling installing framework

 

Set the GATLING_HOME environment variable by executing the commands below:

 

3. Open the /etc/environment file with the command vi /etc/environment

 

step by step gatling installation

 

4. Add the following line at the end of the file and save it:

 

GATLING_HOME="/root/gatling-charts-highcharts-bundle-2.3.1"

 

how to install gatling on ubuntu

 

Congratulations! You now have Gatling installed! You can now start out with your first Gatling load test. You can start by recording scenarios, customizing the scripts to meet your purposes and executing them.

 

Here is a quick explanation:

 

Recording Your Gatling Scripts

 

1. Go to the bin directory with the command cd gatling-charts-highcharts-bundle-2.3.1/bin/

 

2. Run the command ./recorder.sh. A recorder window will be automatically displayed. This is the default:

 

gatling scripts recording

 

From here on you can customize and record scenarios.

 

Executing Your Gatling Scripts

 

1. Go to the bin directory with the command cd gatling-charts-highcharts-bundle-2.3.1/bin/

 

2. Run the command ./gatling.sh. Load testing information will be displayed on the terminal, such as: the GATLING_HOME variable, Scripts, etc.

 

gatling scripts execution

 

3. Choose the script file you want to execute from there.

 

That’s it!

 

Run Your Gatling file in BlazeMeter

 

You can also take your Scala file and run it in BlazeMeter. You will be able to massively scale it and get immediate reports with advanced KPIs. To try out BlazeMeter, put your URL in the box below, and your test will start in minutes. Or, request a live demo.

     
arrow Please enter a valid URL

Interested in writing for our Blog? Send us a pitch!