What is LAMP Stack
LAMP Stack is a generic stack model acronym denoting common open-source software used to install a server to host dynamic web applications. These are Linux Operating System, Apache Web Server, MySQL and PHP.
- Linux –An Operating System just like Windows or iOS.
- Apache – A web server software that translates server requests into specific instructions for the server.
- MySQL –A relational Database that is used to create and manage databases and also stores all the information for a website application in a structured format. It has been alternatively provisioned by others like MariaDB and NoSQL Databases like MongoDB.
- PHP – A scripting Language that carries out the server’s instructions that allows websites and web applications to run efficiently.
There are other known alternatives stacks but not so common like;
- WAMP – Windows, Apache, MySQL and PHP.
- LEMP – Linux, NGINX(Engine-X), MySQL and PHP.
- MAMP – MacOS, Apache, MySQL and PHP.
- XAMPP – X(Cross-Platform), Apache, MySQL/MariaDB, PHP/Python and Perl.
LAMP is common because it is open-source, stable and well-known and sort of standard with good documentation and large user base. It is also easy to find support because of its large community.
In this guide, I’ll show you how to:
- Install Apache2 web server
- Install MySQL database server
- Install PHP and required extensions
- Configure PHP with Apache web server
- Install phpMyAdmin – Used to manage MySQL database server
Install LAMP Stack on KDE Neon|Kubuntu
A prerequisite of this guide is to have KDE-Neon installed in your machine with a non-root sudo
-enabled user account. KDE-Neon and Kubuntu are Linux Distributions based on the latest Ubuntu LTS release.
Step 1 – Install Apache web server
We have to ensure that the apt
cache is updated.
sudo apt update
This updates the cache index

Then we install Apache web server by running commands below on the terminal.
sudo apt install apache2
It will show you a list of packages to be installed and the amount of disk space to be used. Enter Y
to continue the installation

To confirm the installation is successful, Open a browser and type in http://localhost/ and you will see a page that says ‘it works’

Step 2 – Install MySQL Web server
We will again use apt
to install MySQL database server.
sudo apt install mysql-server
It will show you a list of packages to be installed and the amount of disk space to be used. Enter Y
to continue the installation.

To check if you are able to connect to My SQL use;
sudo mysql
This opens the MySQL console.

Type exit
to exit the MySQL console.
Step 3 – Installing PHP and important extensions
To install PHP use the code below
sudo apt install php libapache2-mod-php php-mysql
With no specified version, it will install the latest version automatically.

To check for the PHP version use;
$ php -version
As we did not specify the version to install it installed the latest and most used version which is version 7.

To make PHP compatible with Apache, you should restart it. Use;
sudo /etc/init.d/apache2 restart
This configures the web server with the changes.

To test your Apache2 PHP settings, create a blank file with the following line;
sudo nano /var/www/html/info.php
This will open the nano editor and allow you to edit a file. You can also use vim editor or any other of your choice.

Type the following code then save the file.
<?php phpinfo( ); ?>
Save the file by using CTRL + x
and then press Y
then press Enter
.

Open the file from your browser by going to http://localhost/phpinfo.php and the following page is shown.

With that your PHP is working correctly.
Step 4 – Install Phpmyadmin to manage database
To include Phpmyadmin, start by updating the package index;
sudo apt update
Then use the following line to install phpmyadmin
sudo apt install phpmyadmin
The first prompt appears to select the server, Press SPACE
to select Apache2 then TAB
to move to the OK button then press Enter

Next step is to select the database. Press Enter
to continue with dbconfg-common

You will be prompted for a database password. Type the password and press TAB
then press Enter
.

You will confirm the password again then press TAB
then press Enter
.
The installation process actually adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/
directory, where it is automatically read.
Next will be to enable the mbstring
PHP extension.
sudo phpenmod mbstring
Then restart the server by using;
sudo systemctl restart apache2
This configures the web server to with the changes.

Then go to your browser and load the http://localhost/phpmyadmin/ page

Conclusion
With LAMP stack installed in your machine you can use it to host your web applications. Because of its cost-effectiveness, Flexibility and customization, LAMP is one of the most popular ways of developing enterprise level web applications. LAMP being open source reduces the development time for applications as it has been there for over a decade hence you can build on what others have already built.
You also have phpMyAdmin configured and ready to use on your KDE Neon|Kubuntu server. Using this interface, you can create new databases, users, and tables, as well as perform the usual operations like updating, deleting and modifying structures and data.
- Install Snapd and Use snap on KDE Neon/Kubuntu
- Install and Use Motrix Download Manager on Windows
- Install and use Telegraf on Windows
- Install and Use Grafana on Windows