Setting up Gatling is straightforward if you have Java experience. If you have been working with JMeter, you already have Java installed -- that is half the battle. Gatling runs on the JVM, so Java 11 or higher is required. Let me walk you through the three ways to set it up, from simplest to most production-ready.
The fastest way to get started. Download the zip, extract it, and run. No build tools required. Good for learning, bad for real projects.
Verify Java: run "java -version" -- you need Java 11 or higher (Java 17 recommended)
Download Gatling from gatling.io/open-source -- get the latest bundle zip
Extract the zip to a folder (e.g., ~/tools/gatling)
Open a terminal and navigate to the gatling folder
Run bin/gatling.sh (Mac/Linux) or bin/gatling.bat (Windows)
Gatling lists available simulations -- pick one and press Enter
After the test runs, Gatling opens the HTML report in your browser
# Step 1: Verify Java
java -version
# Expected: openjdk version "17.0.x" or similar
# Step 2: Download and extract
wget https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/3.10.5/gatling-charts-highcharts-bundle-3.10.5.zip
unzip gatling-charts-highcharts-bundle-3.10.5.zip
cd gatling-charts-highcharts-bundle-3.10.5
# Step 3: Run Gatling
./bin/gatling.sh
# Gatling will prompt:
# Choose a simulation number:
# [1] computerdatabase.BasicSimulation
# [2] computerdatabase.AdvancedSimulationStep01
# ...For real projects, you want Gatling integrated into a build tool. Maven is the most common choice. This gives you dependency management, CI/CD integration, and the ability to run tests from the command line. This is how most teams use Gatling in practice.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>perf-tests</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<gatling.version>3.10.5</gatling.version>
<gatling-maven-plugin.version>4.8.2</gatling-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>${gatling.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-app</artifactId>
<version>${gatling.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>${gatling-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</project># Run all simulations
mvn gatling:test
# Run a specific simulation
mvn gatling:test -Dgatling.simulationClass=com.example.BasicSimulation
# Run with a specific description (shows in reports)
mvn gatling:test -Dgatling.runDescription="Sprint 42 Load Test"plugins {
id 'java'
id 'io.gatling.gradle' version '3.10.5'
}
repositories {
mavenCentral()
}
gatling {
// Gatling-specific configuration
logLevel = 'WARN'
// Simulation class to run (optional, prompts if not set)
// simulationClass = 'com.example.BasicSimulation'
}Gatling originally only supported Scala. Since version 3.7, it also supports Java and Kotlin. Which should you pick? If your team already knows Java, use Java -- the DSL is nearly identical. If you are comfortable with Scala or want to follow most Gatling documentation and StackOverflow answers (which are predominantly in Scala), use Scala. In this chapter, I will show examples in both, but focus on Java since most QA engineers come from a Java background.
Do not confuse Gatling versions. Gatling 3.7+ supports Java DSL. Older tutorials and StackOverflow answers use Scala exclusively. If you are following a tutorial, check the Gatling version. The Java DSL methods are the same but the syntax differs (no implicits, explicit method chaining).
Use the Gatling Maven archetype to bootstrap a project instantly: "mvn archetype:generate -DarchetypeGroupId=io.gatling.highcharts -DarchetypeArtifactId=gatling-highcharts-maven-archetype". It creates the full project structure with a sample simulation ready to run.
Key Point: Maven integration is the recommended setup for real projects. It gives you dependency management, CI/CD integration, and the gatling:test command. Use the archetype to bootstrap quickly.
Key Point: Maven project setup is recommended for real-world Gatling usage -- use the archetype for quick bootstrapping