Ubuntu install lamp stack last version

LAMP is a group of Server hosting that can be run Dynamic website and web application models. It is known as open-source software model for using to manage and run online website with your server machine.

How to install LAMP ( Apache, MySQL, PHP)? The easy way, you need to install Ubuntu LTS last version and follow below steps:

Step 1: Ubuntu install Apache and upgrade Ubuntu system. First, you have to update and upgrade Ubuntu System and install Apcache2.

$ sudo apt update && sudo apt install apache2

Step 2: Ubuntu adjust the firewall to allow wave traffic. You need to enable the UFW firewall on Ubuntu System and make sure your firewall can use HTTP and HTTPS.

$ sudo ufw app list

Step 3: Enalbe port 80 and 443

$ sudo ufw app info “Apache Full”

Step 4: allowing income your website HTTP and HTTPS.
After you done, you can testing with web browser or IP Address, after that it will be shown default picture.

$ sudo ufw allow in “Apache Full”

Open http://your_server_ip on web browser.

Step 5: Ubuntu install MySQL. You need to MySQL to manage data, so you can install by below way.

$ sudo apt install mysql-server

Note: When you install MySQL you do not have to run sudo apt update,  and you need input more info following by picture on the below.

Ubuntu add MySQL security

$ sudo mysql_secure_installation

$ sudo mysql

mysql>SELECT user,authentication_string,plugin,host FROM mysql.user;

mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘mypassword’;


mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;

mysql> edit

Step 6: Ubuntu install PHP. PHP is an important program in order to processing code and it will be shown code of website to form of dynamic content. You can install PHP by guid below.

$ sudo apt install php libapache2-mod-php php-mysql

$ sudo nano /etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.php index.xhtml index.htm
You need change to 

Change to

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.xhtml index.htm

$ sudo systemctl restart apache2

$ sudo systemctl status apache2

$ apt search php- | less

$ apt show php-cli

$ sudo apt install php-cli

The last of how to install LAMP. So you can test your web server by guid below.

$ sudo nano /var/www/html/info.php

add code on info.php


Open your browser type: http://your_server_ip/info.php

When test work all you don’t forget delete code test

$ sudo rm /var/www/html/info.php

Conclusion The way of install LAMP stack which bunch of Apache, MySQL, and PHP for for processing web server. This is the first program that you need to do to manage your website.


  1. vurtil opmer

    February 11, 2020 at 4:22 pm

    Thank you for sharing excellent informations. Your site is very cool. I’m impressed by the details that you have on this blog. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my friend, ROCK! I found simply the information I already searched all over the place and just couldn’t come across. What a perfect web site.

  2. vurtil opmer

    February 17, 2020 at 12:21 am

    Currently it looks like WordPress is the best blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

News and share about technology

Copyright © 2019 Twelve show

To Top