Set up a LAMP stack (Linux, Apache, MariaDB/MySQL, PHP) with phpMyAdmin on Debian step by step.
๐น Install Apache Web Server
sudo apt install apache2 -y
Enable and start:
sudo systemctl enable apache2
sudo systemctl start apache2
Test: Open http://192.168.63.132 in a browser. You should see the Apache default page.

๐น Install MariaDB (or MySQL)
sudo apt install mariadb-server -y
Secure the installation:
sudo mysql_secure_installation
- Set root password
- Remove anonymous users
- Disallow root login remotely
- Remove test database
- Reload privileges
๐ Login to test:
sudo mariadb -u root -p
mariadbโ start the MariaDB client (command-line tool)-u rootโ log in as the root user-pโ ask for the password
๐น Install PHP
sudo apt install php libapache2-mod-php php-mysql -y
libapache2-mod-phpโ lets Apache run PHP filesphp-mysqlโ allows PHP to talk to MySQL/MariaDB
Check PHP version:
php -v
๐น Install phpMyAdmin
sudo apt install phpmyadmin -y
During installation:
- Choose
apache2when asked for web server. - Select โYesโ to configure database for phpMyAdmin.
- Set a password for phpMyAdmin.
Enable phpMyAdmin in Apache
On Debian, the installer does not always add the config automatically. You need to enable it:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
That command creates a symbolic link so Apache knows about phpMyAdminโs configuration.
ln -sโ makes a symlink (shortcut)/etc/phpmyadmin/apache.confโ the original phpMyAdmin config file/etc/apache2/conf-enabled/phpmyadmin.confโ where Apache looks for enabled configs
Then reload Apache:
sudo systemctl reload apache2
๐น Access phpMyAdmin
Open in browser:
http://192.168.63.132/phpmyadmin
Login with MariaDB username/password.
