Installing MariaDB + PHPMyAdmin on Debian 11/Debian 11 Proxmox LXC Container

Installing MariaDB 10.5

apt update; apt upgrade -y
apt -y install curl software-properties-common gnupg2


curl -LsS -O
bash mariadb_repo_setup --mariadb-server-version=10.5


apt install mariadb-server mariadb-client -y



when prompted…

Switch to unix_socket authentication [Y/n]    (Answer: n)
Change the root password? [Y/n]               (Answer: n)
Remove anonymous users? [Y/n]                 (Answer: y)
Disallow root login remotely? [Y/n]           (Answer: n)
Remove test database and access to it? [Y/n]  (Answer: y)
Reload privilege tables now? [Y/n]            (Answer: y)

Install Apache2

apt install apache2 -y

Install PHP

We are using this server strictly for MariaDB, to make things simple, we can install our OS’s native PHP version, in Debian 11’s case that would be PHP 7.4. If needed PHP8 will also work.

apt install php php-common php-mysql php-gd php-cli -y
service apache2 restart

Install PHPMyAdmin

apt install phpmyadmin -y

log into MariaDB and create our Database Administrative user.

mysql -u root -p

once you’ve logged in, we create our new Administrative user via MySQL/MariaDB cli, take note of the bold words, don’t forget to use unique values if copy and pasting.

CREATE USER Administrator@localhost IDENTIFIED BY "mysecretpassword";


once outside MariaDB’s cli and back into Debian’s terminal

service mysql restart

Install Vim (text editor)

apt install vim -y

Adding SSL/HTTPS Support to Apache/PHPMyAdmin

a2enmod ssl
a2enmod rewrite

Prepare our apache folder for SSL cert storage

mkdir /etc/apache2/certs/ssl


openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/certs/ssl/ssl.key -out /etc/apache2/certs/ssl/ssl.crt

once completed with cert detail prompts you will want to edit apache’s defaut site config

vim /etc/apache2/sites-available/000-default.conf

Add the following three lines of code before the </VirtualHost> closing tag.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

Finally we enable our ssl configuration and restart our apache services

a2ensite default-ssl.conf && systemctl restart apache2

to get your local server IP address, inside terminal use the following

ip addr

once you have your server’s local network address you should be able to access it from any computer on the same subnet using putty.

For this example, the server sits on the same local network. If you wanted to host the server remotely and access phpmyadmin you would likely use certbot to autogenerate validated ssl certs.

Published by


I’m a bilingual Network Engineer. I have over 20 Years of Professional experience in Computer Science & Information Technology. I currently own and operate Web Semantics ( in Vancouver, Washington. I provide bilingual (English & Spanish) enterprise-level IT support to small and medium-sized businesses across the West Coast. *** Soy un ingeniero de redes bilingüe. Tengo más de 20 años de experiencia profesional en ciencias de la computación y tecnología de la información. Actualmente poseo y opero Web Semantics ( en Vancouver, Washington. Proporciono soporte de IT/Informática bilingüe (inglés y español) a nivel empresarial a pequeñas y medianas empresas en toda la costa oeste.

Leave a Reply