Looking to install Percona on Ubuntu 22.04 LTS?
Then this guide is for you.
In this tutorial, we will walk you through the step-by-step process of installing the Percona Monitoring and Management software.
Additionally, we’ll guide you in setting up Percona Server for MySQL.
Let’s dive right in!
What You’ll Need
Before we dive into the tutorial, ensure that you meet the following prerequisites to install Percona:
- A system running Ubuntu (version 22.04 or later)
- Docker Engine installed (guide)
- A web browser to run the app locally
- Some command-line utilities (curl, gnupg, sudo, wget)
- 1 GB of storage per monitored database node
- A minimum of 2 GB memory per monitored database node
If you have all the requirements in place, you can move on to the installation steps.
How to Install Percona on Ubuntu 22.04 LTS: Step-By-Step
We’ve divided the whole tutorial into four easy steps that will take you from installing Percona to configuring everything.
Step 1: Install PMM Server
Installing Percona is made easy with the provided automatic installation script, which leverages Docker for deployment.
Before we proceed with the installation process, let’s understand what this script does!
Firstly, the script will automatically install Docker on your device if you don’t have it already. Then, if you have a Docker Container called pmm-server, it will be renamed to pmm-server-{timestamp}. After that, the script will pull and run the Docker image for the Percona server. You can add flags when running the script to add more functionalities. For example, if you use the –interactive flag, you can change the default settings.
You can view the source code for the script on GitHub.
- To download the script, you’ll need either curl or wget installed. You are not required to have both installed, whichever one would do. These command-line tools enable you to retrieve data from the web. You can install curl and wget using the following commands (the outputs are shown in the screenshots below):
sudo apt install curl
OR
sudo apt install wget


- You can use either curl or wget to download the script. To download the script to automatically install Percona, run any of these commands:
curl -fsSL https://www.percona.com/get/pmm | /bin/bash
OR
wget -O - https://www.percona.com/get/pmm | /bin/bash

- (Optional) This is an optional step if you downloaded the script from GitHub. After downloading the PMM server Docker image script, you need to make it into an executable file. That’s because the script is only readable and writable. But it can’t be run as a standalone program yet. To make the script executable on the terminal, use the following command:
chmod +x get-pmm.sh
- Finally, you can run the executable script with this command:
./get-pmm.sh
After the installation, you can access Percona right away from any web browser. The exact web addresses you need to use will be in the return message you receive after the installation. We will cover the setup process later in the tutorial.
Step 2: Install the PMM Client
After you’ve installed the PMM server using the provided script, let’s install the PMM Client for Ubuntu. With the PMM Client software, you are able to gather information and metrics from the database server and send it back to the PMM Server.
- First, to keep your software package repositories up to date, update your system with this command:
sudo apt update
- When you’re done updating, download the Percona DEB repo package using this command:
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb

- After downloading the Percona DEB repo package, you need to install it. Since it’s a DEB package, we can use the dpkg tool to install it. Run the following command to install:
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb

- When you’ve finished installing the repo package, you need to update the cache list once more to apply the changes we have made and add this new repository. This can be done using this command:
sudo apt-get update

- Lastly, after the update is done, install the Percona Monitoring and Management Client (PMM Client) with this command:
sudo apt-get install pmm2-client

Step 3: Register PMM Client with PMM Server
We’ve successfully installed the Percona Server (PMM Server) and the Percona Client (PMM Client)!
Now it’s time to establish a connection between the two. Without this communication, we can’t monitor the system.
When we talk about registering the PMM Client with the PMM Server, it simply means linking the client software to the server so that both can interact and exchange data. This registration process allows the PMM Server to recognize and manage the PMM Client.
- Register Percona Monitoring and Management client (PMM Client) with the server (PMM Server) using this command:
sudo pmm-admin config --server-insecure-tls --server-url=https://admin:<password>@X.X.X.X:443
The default username, as well as the default password, is ‘admin’. X.X.X.X refers to your PMM server’s address. 443 is the default port number.
So in our case, the command will look like this:
$ sudo pmm-admin config --server-insecure-tls --server-url=https://admin:[email protected]:443

As seen from the above screenshot, we’ve successfully registered our PMM client on the PMM server.
Step 4: Create a PMM User for Monitoring
The next step is to create a user that will monitor all database activities. Without the user, we won’t be able to handle the management tasks.
The way you create the user depends on which database management system you’re using since you need to create the user using the database CLI. We will cover the commands for the popular ones below.
- You can create a user with these commands depending on which database you’re using:
# MySQL 8.0
CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD, BACKUP_ADMIN ON *.* TO 'pmm'@'localhost';
# MySQL 5.7
CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';
# PostgreSQL
CREATE USER pmm WITH SUPERUSER ENCRYPTED PASSWORD '<password>';
# MongoDB (in the MongoDB console)
db.createRole({
"role":"explainRole",
"privileges":[
{
"resource":{
"db":"",
"collection":""
},
"actions":[
"collStats",
"dbHash",
"dbStats",
"find",
"listIndexes",
"listCollections"
]
}
],
"roles":[]
})
db.getSiblingDB("admin").createUser({
"user":"pmm",
"pwd":"<password>",
"roles":[
{
"role":"explainRole",
"db":"admin"
},
{
"role":"clusterMonitor",
"db":"admin"
},
{
"role":"read",
"db":"local"
}
]
})
exit

- After you’ve created a user, register the server for monitoring using these commands:
# MySQL
sudo pmm-admin add mysql --username=pmm --password=<password> --query-source=perfschema
# PostgreSQL
sudo pmm-admin add postgresql --username='pmm' --password=<password>
# MongoDB
sudo pmm-admin add mongodb --username=pmm --password=<password>

That concludes our installation process of Percona. If you want to know how to access and configure your Percona instance, read on.
How to Access and Configure Percona: Step-by-Step
To access Percona, you can use any web browser of your choice. Once you have installed the Percona Server, the success message will provide you with the server addresses that you can utilize to access it. By default, the port for accessing Percona is 443. The following steps will go over how to access and set up Percona.
- Open a browser to copy and paste one of the server addresses. Since we are using http instead of https, you will get a warning that your connection is not private. Press the Advanced button.

- Then press the link to proceed to the server.

- This will bring you to the login page for Percona. If you have a username and password, enter them to log in. Else, you may use the default credentials (admin for both).

- In the next window, you will be asked to create a new password. Create a strong password, confirm it, and then proceed by pressing the Submit button. You can also skip this step by pressing the Skip button.

- Now that you are in the Percona dashboard, you can press the Start Tour button to begin the onboarding process. You may also skip it by pressing the Skip button.

- The onboarding wizard will walk you through the different windows in the dashboard, such as the PMM Query Analytics, Explore, Alerting, Advisors, Backup, Configuration Panel, Server Admin, etc. When you’ve completed going through each, press the Done button.

- Now you can start monitoring your server and database systems from this dashboard.

Conclusion
Congratulations! You have successfully installed and configured Percona on your Ubuntu machine.
This tutorial provided a comprehensive and detailed guide on installing Percona Monitoring and Management tool using Docker.
Additionally, we covered setting up a PMM client, creating a user for monitoring, and accessing the Percona dashboard so you can efficiently manage and monitor your database systems.
If this guide helped you, please share it.