Guides / Load Testing

How to Install & Set Up Locust

Install Locust to write distributed load tests in Python and drive them from a real-time web UI.

Updated 20263-step setupDownload Locust →

Prerequisites

  • ✓Python 3.9+ and pip

Install Locust

terminal
pip install locust
locust --version
!

Pure Python via pip — identical on RHEL, Fedora, Debian, and Ubuntu as long as python3-pip is installed (sudo dnf install -y python3-pip, or sudo apt install -y python3-pip).

Write a locustfile

locustfile.py
from locust import HttpUser, task, between

class QuickUser(HttpUser):
    wait_time = between(1, 3)

    @task
    def index(self):
        self.client.get("/")

Run and open the UI

Open http://localhost:8089, set the number of users and spawn rate, and start the swarm.

terminal
locust -f locustfile.py --host https://example.com

Documentation & Knowledge Base

Official DocumentationLocust Documentation →Knowledge Base & CommunityLocust GitHub Discussions →
Download Locust— all versions & official links→

Related Guides

k6Install guide →Apache JMeterInstall guide →

Need Locust deployed and managed for you?

We're OpenStack Dev — we design, deploy, and operate production DevOps infrastructure.

Get in TouchAll Install Guides