sammlinux sammlinux
  • Ubuntu
    UbuntuShow More
    How To Install and Use Docker CE on Ubuntu 22.04
    26 Min Read
    How To Install and Secure phpMyAdmin on Ubuntu 22.04
    5 Min Read
    How To Secure SSH with Fail2Ban on Ubuntu 22.04
    8 Min Read
    How To Install Uptime Kuma on Ubuntu 22.04
    17 Min Read
    How To Install Ubuntu Server 22.04 LTS with Screenshots
    14 Min Read
  • Rocky Linux
    Rocky LinuxShow More
    How To Install phpMyAdmin on Rocky Linux 9
    15 Min Read
    How To Secure SSH with Fail2Ban on Rocky Linux 9
    12 Min Read
    How To Install Rocky Linux 9.2 Server with Screenshots
    12 Min Read
    How To Set Up a Firewall Using FirewallD on Rocky Linux 9
    8 Min Read
    How To Install Nginx on Rocky Linux 9: A Comprehensive Guide
    10 Min Read
  • Debian
    DebianShow More
    How To Secure SSH with Fail2Ban on Debian 11
    8 Min Read
    How To Install Debian 11 (Bullseye) Server with Pictures
    12 Min Read
    How To Install and Setup Node.js on Debian 11
    6 Min Read
    How To Install PHP 8.2 on Debian 11
    12 Min Read
    How To Install Nginx on Debian 11: A Comprehensive Guide
    9 Min Read
  • Linux
    LinuxShow More
    Best Practices Linux Server Security for System Administrator
    8 Min Read
    A Simple Guide: How To Manage Groups on Linux
    5 Min Read
    How To Manage Log Files Using Logrotate In Linux
    7 Min Read
    The Easy Ways to Check File Size in Linux
    7 Min Read
    How To Backup Files From Remote Linux VPS Using Rsync Script
    12 Min Read
  • CentOS
    CentOSShow More
    How To Secure SSH with Fail2Ban on CentOS 7
    9 Min Read
    How To Install PHP 8.2 on CentOS 7 / RHEL 7
    18 Min Read
    How To Install Apache Web Server on CentOS 7
    11 Min Read
    How To Set Up a Firewall Using FirewallD on CentOS 7
    5 Min Read
    Initial Setup CentOS 7 Server: Secure and Efficient
    9 Min Read
  • DevOps
    DevOpsShow More
    How To Create AWS CloudFront: A Step-by-Step Guide
    10 Min Read
Reading: How To Install and Secure phpMyAdmin on Ubuntu 22.04
Share
Font ResizerAa
Linux for BeginnersLinux for Beginners
  • Ubuntu
  • Rocky Linux
  • Debian
  • Linux
  • CentOS
  • DevOps
Search
  • Ubuntu
  • Rocky Linux
  • Debian
  • Linux
  • CentOS
  • DevOps
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.

How To Install and Secure phpMyAdmin on Ubuntu 22.04

Samuel Siahaan
By Samuel Siahaan
Last updated: April 4, 2026
SHARE

Are you ready to take control of your MySQL databases on Ubuntu 22.04? In this step-by-step guide, we’ll walk you through the process of installing and securing phpMyAdmin, a powerful web-based tool for managing MySQL databases. Whether you’re a seasoned Ubuntu user or just getting started, follow these instructions to install and secure phpMyAdmin on your Ubuntu 22.04 server.

Contents
Table of ContentsWhy phpMyAdmin?Install and Secure phpMyAdmin on Ubuntu 22.04Step 1: Update and Upgrade Your SystemStep 2: Update RepositoriesStep 3: Install phpMyAdminStep 4: Configure phpMyAdminSecuring phpMyAdminStep 5: Implement AuthenticationStep 6: Configure FirewallStep 7: Enable HTTPSTransition to Advanced Security MeasuresStep 8: Change phpMyAdmin URLConclusion

Table of Contents

  • Why phpMyAdmin?
  • Install and Secure phpMyAdmin on Ubuntu 22.04
    • Step 1: Update and Upgrade Your System
    • Step 2: Update Repositories
    • Step 3: Install phpMyAdmin
    • Step 4: Configure phpMyAdmin
  • Securing phpMyAdmin
    • Step 5: Implement Authentication
    • Step 6: Configure Firewall
    • Step 7: Enable HTTPS
  • Transition to Advanced Security Measures
    • Step 8: Change phpMyAdmin URL
  • Conclusion

Why phpMyAdmin?

Before we dive into the installation process, let’s briefly discuss why phpMyAdmin is a popular choice for managing MySQL databases. phpMyAdmin provides a user-friendly web interface, making it easy for both beginners and experienced database administrators to interact with MySQL databases. With features such as SQL query execution, database structure management, and user account administration, phpMyAdmin streamlines the database management process.

Install and Secure phpMyAdmin on Ubuntu 22.04

Step 1: Update and Upgrade Your System

Before installing any new software, it’s essential to ensure that your system is up-to-date. Open your terminal and run the following commands:

$ sudo apt update
$ sudo apt upgrade

Step 2: Update Repositories

Start by updating the repositories to ensure you get the latest version of phpMyAdmin:

- Advertisement -
sudo apt install software-properties-common
sudo add-apt-repository ppa:phpmyadmin/ppa

Step 3: Install phpMyAdmin

Now, install phpMyAdmin using the following command:

sudo apt install phpmyadmin

During the installation, you’ll be prompted to choose a web server. Select your preferred server (e.g., Apache or Nginx) and complete the installation.

Step 4: Configure phpMyAdmin

After installation, configure phpMyAdmin by editing the configuration file:

sudo nano /etc/phpmyadmin/config.inc.php

Look for the line that reads $cfg['blowfish_secret'] and set a unique passphrase. Save and exit the file.

Securing phpMyAdmin

Step 5: Implement Authentication

To enhance security, it’s crucial to set up an authentication process. Create a new user specifically for phpMyAdmin:

- Advertisement -
sudo mysql
CREATE USER 'phpmyadminuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadminuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

Step 6: Configure Firewall

Allow external access to phpMyAdmin by configuring your firewall. If using UFW:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Step 7: Enable HTTPS

Encrypt your phpMyAdmin connection by installing and configuring a free SSL certificate from Let’s Encrypt:

sudo apt install certbot
sudo certbot --nginx

Transition to Advanced Security Measures

Now that the installation and basic security are in place, let’s explore advanced security measures.

- Advertisement -

Step 8: Change phpMyAdmin URL

To add an extra layer of security, change the default phpMyAdmin URL. Edit your web server configuration file:

sudo nano /etc/nginx/sites-available/default   # or apache2 if using Apache

Add the following line inside the server block:

location /your_custom_url {
    alias /usr/share/phpmyadmin;
}

Restart your web server:

sudo systemctl restart nginx   # or apache2 if using Apache

Conclusion

Congratulations! You’ve successfully installed and secured phpMyAdmin on Ubuntu 22.04. By following these steps, you’ve not only unlocked the potential of this powerful database management tool but also fortified it against potential security threats.

Also Read Our Other Guides :

  • How To Install MySQL 8.0 on Debian 11
  • How To Install MySQL 8.0 on Rocky Linux 9
  • How To Install MariaDB 10.9 on Debian 11 Server
  • How To Install MariaDB 10.6 on Debian 11 Server
  • How To Install MariaDB 10.6 on Ubuntu Server 22.04

As I have shown, now you have learned howto install and secure phpMyAdmin on your Ubuntu 22.04 server.

TAGGED:DatabasesphpMyAdminUbuntu

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
[mc4wp_form]
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article A Simple Guide: How To Manage Groups on Linux
Next Article How To Install phpMyAdmin on Rocky Linux 9
A Simple Guide: How To Manage Groups on Linux
Linux
Install and Configure Docker Swarm Mode on Centos 7
CentOS
How To Install and Config Thumbor on Debian 10
Debian
How To Install MariaDB 10.6 on Debian 11 Server
Debian
How To Install MongoDB 6.0 on Debian 10 & 11
Debian

You Might Also Like

Ubuntu

How To Set Up a Firewall with UFW on Ubuntu 22.04

7 Min Read
Ubuntu

How To Secure SSH with Fail2Ban on Ubuntu 22.04

8 Min Read
Ubuntu

How To Install Vagrant on Ubuntu 22.04

8 Min Read
Ubuntu

How To Install Snipe-IT Asset Management on Ubuntu 22.04

13 Min Read
Ubuntu

How To Install and Configure Elasticsearch on Ubuntu Server 22.04

14 Min Read
Ubuntu

How To Install and Config Git on Ubuntu 22.04

12 Min Read
Ubuntu

How To Install Redis on Ubuntu Server 22.04

14 Min Read
Ubuntu

How To Install Nextcloud with Apache and MariaDB on Ubuntu Server 22.04

20 Min Read
Show More

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

sammlinux sammlinux

Providing beginner-friendly Linux tutorials and open-source guides to simplify your digital infrastructure.

www.sammlinux.com © 2026 | All Rights Reserved

Join Us!
Subscribe to our newsletter and never miss our latest news, podcasts etc.

Subscribe to our newsletter to get our newest articles instantly!

Zero spam, Unsubscribe at any time.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?