In today’s data-driven world, maintaining the health, performance, and availability of database systems is critical. Whether you’re managing a single database or a fleet of instances across multiple environments, having deep visibility into performance metrics is essential. This is where Percona Monitoring and Management (PMM) comes in.

PMM is an open-source platform developed by Percona that provides comprehensive monitoring, query analytics, and performance insights for popular database systems like MySQL, MongoDB, and PostgreSQL. 

In this blog post, we’ll walk through the installation process of PMM, covering everything from system requirements and deployment methods to basic configuration steps. Whether you’re a DBA, DevOps engineer, or developer interested in improving your database performance visibility, this guide will help you get started with PMM the right way.

PMM Installation Methods – Which One Should You Choose?

Percona Monitoring and Management (PMM) can be installed using several methods. The best method depends on your environment and preferences. Here’s a quick overview:

Available PMM Installation Methods

MethodDescription
Docker (Preferred)Run PMM Server as a container. Fast, isolated, and portable.
Package Install (DEB/RPM)Install PMM Server and Client natively on Linux systems. Requires manual configuration.
Virtual ApplianceA preconfigured VM image (OVA) that can be imported into VirtualBox, VMware, etc.
Kubernetes (Helm Chart)Deploys PMM Server in container orchestration environments. Best for cloud-native setups.
AWS Marketplace AMIReady-to-launch EC2 instance with PMM pre-installed. Great for quick cloud setups.

Why is Docker the Preferred PMM Installation Method?

Docker has become the most recommended and convenient way to install PMM Server, especially for small to medium environments or testing setups.

Advantages of Docker-based Installation:

BenefitWhy It Matters
Easy to set upOne command to pull and run PMM. No need to install system dependencies.
IsolationPMM runs in its own container, reducing conflicts with other services.
PortabilityEasily move your PMM container between servers or environments.
Quick UpgradesUpgrade by simply pulling the latest Docker image and recreating the container.
Cross-platformWorks on any OS that supports Docker (Linux, macOS, Windows with WSL2).
PersistenceMount volumes to store metrics and dashboards permanently, even if container restarts.

Minimum Requirements for PMM Installation (Docker + Ubuntu)

To install and run Percona Monitoring and Management (PMM) using Docker, make sure your system meets these basic requirements.

System Requirements

ComponentMinimum Recommended
OSUbuntu 18.04+Ubuntu 20.04 or 22.04
CPU2 cores4+ cores
RAM2 GB4–8 GB
Disk20 GB free50+ GB (for metrics/data)
NetworkInternet accessStatic IP if possible

Software Requirements

  • Docker (version 19.03+)
  • Docker Compose (Optional)
  • MySQL client tools (on the database host)

Ports to Open

  • 80 / 443 – For web dashboard
  • 42000-42010 – For exporters (optional)

MySQL Server Requirements (for Monitoring)

  • MySQL version 5.7 or later
  • A user with SELECT, PROCESS, REPLICATION CLIENT privileges.

To configure a working PMM setup, you typically follow these three essential steps:

  • Set up the PMM Server – Deploy the PMM server using Docker, an OVA image, or a package install. This acts as the central hub that collects and visualizes all metrics.
  • Install the PMM Client – Install the PMM client on the database hosts you want to monitor. The client collects metrics and sends them to the PMM server.
  • Add Services for Monitoring – Register your database services (like MySQL, MongoDB, PostgreSQL) with the PMM client to start collecting and displaying performance data.

Set up PMM  server (Using Docker)

The PMM server acts as the central dashboard where all metrics and performance data are visualized. The easiest and most common way to set it up is via Docker.
Step 1

Pull the docker image

docker pull percona/pmm-server:2

This command downloads the latest PMM 2.x server image from Docker Hub.

Step 2

Create a persistent  volume

docker volume create pmm-data

This volume will store PMM server data so it persists even if the container is restarted or recreated.

Step 3

Run the PMM Server  Container

docker run --detach --restart always \
--publish 443:443 \
-v pmm-data:/srv \
--name pmm-server \
percona/pmm-server:2

This starts the PMM server container in detached mode, binds it to port 443, and ensures it restarts automatically if the host reboots.

Step 4

Change the default admin password

docker exec -t pmm-server change-admin-password Admin

  By default, the username is admin. This command sets the password to Admin (you can change it to something more secure).

Setup client (Using Binary)

Step 1

Download PMM client package

wget https://downloads.percona.com/downloads/pmm2/2.37.0/binary/tarball/pmm2-client-2.37.0.tar.gz

This fetches the PMM client tarball from Percona’s official download site.


Step 2

Extract the tarball 

tar -zxvf pmm2-client-2.37.0.tar.gz

This will unpack the contents into a local directory.

Step 3

 Install and Set PMM Directory

./install_tarball

export PMM_DIR=/usr/local/percona/pmm2

This installs the PMM client into the default directory and sets an environment variable pointing to it.

Step 4

 setup the PMM agent

./pmm-agent setup --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
 --server-address=192.168.29.60 --server-insecure-tls --server-username=admin 
--server-password=Admin --force    

This command configures the agent to connect to the PMM server using the admin credentials.

Step 5

Run the agent

./pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml &

This starts the PMM agent in the background.

Step 6

Register the client node with PMM server

./pmm-admin config --server-insecure-tls 
--server-url=https://admin:Admin@192.168.29.60:443

This step registers your client machine as a node in the PMM server dashboard.

Step 7

Check PMM Agent Status

Open a new terminal check the status

./pmm-admin status

This confirms that the PMM agent is connected and working properly.

Step 8

 Log In to the PMM Web UI

Now that the client is registered, you can log in to the PMM web interface:

Add Services for Monitoring

After setting up the PMM client, the final step is to add the actual database service (MySQL) so that PMM can start collecting metrics.

Step 1

Create a Monitoring User in MySQL

Login to your MySQL server and create a dedicated PMM user with the necessary privileges.

CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, REPLICATION CLIENT, RELOAD, BACKUP_ADMIN ON *.*TO 'pmm'@'localhost';

Note: You can replace ‘localhost’ with ‘%’ if PMM connects remotely. Adjust privileges for your environment.

Step 2

Register MySQL with PMM

On the client host (where pmm-admin is installed), run

./pmm-admin add mysql --username=pmm --password=pass --host=sarath-genexdbs --port=3307

This command adds the MySQL instance to PMM for monitoring. Make sure the host and port match your MySQL instance configuration.

Step 3

 Reload PMM Dashboard

Once added, PMM begins collecting metrics automatically. You can:

Visit the PMM dashboard in your browser at:

https://<pmm-server-ip&gt;

Navigate to the MySQL Overview or Query Analytics dashboards.

Conclusion 

Setting up Percona Monitoring and Management (PMM) is a crucial step toward achieving deep visibility into your database performance and infrastructure health. By following a straightforward three-step process—setting up the PMM server, configuring the client, and adding database services—you can build a powerful monitoring stack that supports MySQL, MongoDB, and PostgreSQL.

PMM not only provides real-time metrics and query analytics but also empowers DBAs and developers to proactively detect bottlenecks, optimize queries, and ensure system reliability. Whether you’re managing a single database or an entire cluster, PMM makes monitoring efficient and accessible through an intuitive web UI and robust command-line tools.

Stay tuned for the next blog, where we’ll dive into using PMM Dashboards, Query Analytics, and custom alerting to get the most out of your observability setup.

Reference link

https://docs.percona.com/percona-monitoring-and-management//2


Discover more from Genexdbs

Subscribe now to keep reading and get access to the full archive.

Continue reading