How to Install LAMP Server in Ubuntu 16.04 with Tasksel Command

In this article I am going to show you how to install LAMP Server in Ubuntu using the tasksel command.

For This tutorial I will be using Ubuntu 16.04, But you can use this method to install LAMP Stack on any Previous Ubuntu version including Ubuntu Desktop.

Ubuntu LAMP Stack will include following packages.

  • Apache Web Server.
  • MySQL Database Server.
  • MySQL Clients.
  • PHP Programming Language.
  • Perl.

Run tasksel Command to install Ubuntu LAMP Server

To install lamp server on Ubuntu 16.04, Open the Terminal and run the tasksel command.

sudo tasksel

Once you run the command, you will get the list of packages available. In the package list, use arrow keys to navigate to the LAMP Server, Then press the Spacebar to Select LAMP Server package.

Install LAMP Server in Ubuntu 16.04 with Tasksel Command

Finally, Press Enter to Install LAMP Server in Ubuntu 16.04.

During the installation process, you will be asked to set a new password for the MySQL root user.

set a new password for the MySQL root user

Once the task is finished, you will have Apache, MySQL and PHP installed on your Ubuntu Server.

Verify the LAMP Server Installation

You can verify the installation of the Lamp Stack using the following sets of commands.

apache2 -v && mysql -V && php -v

The above command will print the version information about Apache, MySQL and PHP installed on your Ubuntu Server 16.04.

Ubuntu LAMP Server Vresion

Start and Restart Ubuntu LAMP Server

To start LAMP Server in Ubuntu, you need to start the Apache web Server and MysQL Database Server (By Default both Apache and MySQL Start automatically at System reboot).

/etc/init.d/apache2 start

/etc/init.d/mysql start

Same way you can restart Apache and MySQL on Ubuntu 16.04.

/etc/init.d/apache2 restart

/etc/init.d/mysql restart

So that is how we can install LAMP Server in Ubuntu Server using the tasksel command.