How To Install Linux, Apache, MySQL, PHP(LAMP) stack on Ubuntu 16.04

Posted by


A “LAMP” stack is a group of open source software typically install together to enable a server host dynamic websites, web app and web services, with the Apache server(Web server), the data is stored in a MySQL database, and dynamic content is processed by PHP.

In the guide We will get a LAMP stack will be install on Ubuntu 16.04.


Before You begin with this guide, We should have a separate non-root user account with sudo privileges set up on your server. You can learn how to do this by completing steps 1-4 the initial server setup for Ubuntu 16.04

  1. Install Apache and Allow Firewall
    • For the purpose using the command
    • Since I am using sudo command. it got executed with root privileges.
    • Using apt package manager allow me install most software from repository by Ubuntu.
    • Adjust the Firewall to Allow Web Traffic
    • After walk through Firewall was allowed. You need to update Apache2 
    • From the command line try to find Ubuntu’s server ip 
    • You will see the result response from Ubuntu command.

    • Take a took at on

      inet Try to access on browser. You will the index page of Apache server like this.

  2. Install MySQL
    1. Now You have a Apache2 server in order to run web server, You need to have database to store data.
    2. Again, you will be shown a list of the packages that will be installed, along with the amount of disk space they’ll take up. Enter Y to continue.
    3. During install you will be asked user and password. You can set username is root and password should not leave blank.
  3. Install PHP 5
    1. You can only used one command for all purpose
    2. Updating Apache 2

  4. Conclusion
    • That’s all steps to make LAMP stack install.
    • If any issues during install. you can leave comment below
    • Wish happy coding


Leave a Reply

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