Install the LAMP Stack Using Tasksel on Ubuntu 16.04

Posted on by David Singer | Updated:
Reading Time: 5 minutes

There are multiple ways of installing software on Debian based systems like Ubuntu and Mint. Tools like apt, apt-get, aptitude and/or synaptic are usually used to install single applications into the desktop editions of those OSes. Alternatively, Tasksel is a command line app for installing a “group” of related packages onto a server. Tasksel is not installed by default on the desktop editions of the ‘nix’ versions that contain the above-mentioned package managers but, it is installed on later versions of Debian and Ubuntu server editions.

How Does Tasksel Work?

Tasksel uses meta-packages to pull a ‘virtual group’ of software apps and dependencies together to install a software bundle defined by a configuration (or .cfg) file. Metapackages themselves do not contain the actual applications, they simply reference a group of packages. In this case, this is a reference to a software install for a ubuntu-server.

Important:
If one or more of the underlying dependencies in the metapackage is removed, all the other packages that were in the metapackages dependencies list will still be installed on the system.

Let’s Begin!

Initially, we want to make sure our Ubuntu server is up to date with the latest software:

root@test:~# apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 323 kB in 0s (1,019 kB/s)
Reading package lists... Done

Is Tasksel Already Installed?

To verify if Tasksel is already installed, run:

root@test:~# which tasksel
/usr/bin/tasksel

Install Tasksel

If Tasksel is not installed, install it from the command-line:

root@test:~# apt-get install tasksel

Error Running Tasksel?

After installing, if by chance you get an error similar to:

root@test:~# tasksel
tasksel: apt-get failed (100)
Simply run:

root@test:~# dpkg --configure -aThat should correct that error message.

What Can I Install With Tasksel?

To see a list of all the packages available to install, use the  “–list-tasks” flag with the Tasksel command:

root@test:~# tasksel --list-tasks
u manual    Manual package selection
u kubuntu-live    Kubuntu live CD
u lubuntu-live    Lubuntu live CD
u ubuntu-gnome-live    Ubuntu GNOME live CD
u ubuntu-live    Ubuntu live CD
u ubuntu-mate-live    Ubuntu MATE Live CD
u ubuntustudio-dvd-live    Ubuntu Studio live DVD
u ubuntustudio-live    Ubuntu Studio live CD
u xubuntu-live    Xubuntu live CD
u cloud-image    Ubuntu Cloud Image (instance)
u dns-server    DNS server
u edubuntu-desktop-gnome    Edubuntu desktop
u kubuntu-desktop    Kubuntu desktop
u kubuntu-full    Kubuntu full
u lamp-server    LAMP server
u lubuntu-core    Lubuntu minimal installation
u lubuntu-desktop    Lubuntu Desktop
u mail-server    Mail server
u mythbuntu-backend-master    Mythbuntu master backend
u mythbuntu-backend-slave    Mythbuntu slave backend
u mythbuntu-desktop    Mythbuntu additional roles
u mythbuntu-frontend    Mythbuntu frontend
u postgresql-server    PostgreSQL database
u samba-server    Samba file server
u tomcat-server    Tomcat Java server
u ubuntu-desktop    Ubuntu desktop
u ubuntu-gnome-desktop    Ubuntu GNOME desktop
u ubuntu-mate-cloudtop    Ubuntu MATE cloudtop
u ubuntu-mate-core    Ubuntu MATE minimal installation
u ubuntu-mate-desktop    Ubuntu MATE desktop
u ubuntu-usb    Ubuntu desktop USB
u ubuntustudio-audio    Audio recording and editing suite
u ubuntustudio-desktop    Ubuntu Studio desktop
u ubuntustudio-desktop-core    Ubuntu Studio minimal DE installation
u ubuntustudio-font-meta    Large selection of font packages
u ubuntustudio-graphics    2D/3D creation and editing suite
u ubuntustudio-photography    Photograph touchup and editing suite
u ubuntustudio-publishing    Publishing applications
u ubuntustudio-video    Video creation and editing suite
u virt-host    Virtual Machine host
u xubuntu-core    Xubuntu minimal installation
u xubuntu-desktop    Xubuntu desktop
i openssh-server    OpenSSH server
i server    Basic Ubuntu server

Now, let’s move on to installing the LAMP stack!

What Is The LAMP Stack?

The LAMP stack is the basis for running one of the most stable and time-tested server platforms for hosting websites. LAMP is an acronym for the Linux, Apache, MySQL and PHP software stack.

  • Linux: The operating system
  • Apache: The web server software
  • MySQL: The database server software
  • PHP: The programming language the sites are coded in

Instead of having to install those software packages separately, Tasksel offers a handy way to get a LAMP stack up and running quickly.

How Do I Install A LAMP Server Using Tasksel?

To install a LAMP server, SSH into your new Ubuntu 16.04 server and open the terminal. At the terminals prompt, enter the following command:

root@test2:~# tasksel

Note
If you make an error or accidentally select the wrong software package, simply hit the “escape” key and restart the process!

This will open up the Software Selection menu where you can choose the software group you would like to install. In this case, we’re going to install LAMP.

Simply scroll down the menu using your keyboards arrow keys until you see the LAMP server option:

Select this group by hitting the space bar on your keyboard. Next, hit the ‘tab’ key and click the “<OK>” button.

tasksel install 1Next, Tasksel will begin installing the server’s software.

At a midpoint during the installation, you will be asked to supply a MySQL password, twice. (Make sure you use a secure password!!!)

tasksel install 2

Add the same password again. Next, click the ‘ok’ button to continue the installation.

tasksel install 3

After that, the installation will continue to run…

tasksel install 4

Note
That’s really all you need to do when installing LAMP this way!

All Finished?

When the installation reaches 100%, it will drop you back to the bash prompt. You can verify that Tasksel installed the LAMP stack successfully by running the following command:

root@test:~# tasksel --list-tasks |grep "lamp-server"
i lamp-server    LAMP server

Verify Apache is Installed

To verify that Apache was installed, simply open a browser window and type in the IP address of the server (Example: http://209.59.180.244/ ). You should see a page similar to this:

Apache2 Ubuntu Default Page

Verify PHP is Installed

To get further details about the installation, let’s create a phpinfo.php page.

root@test:~# touch /var/www/html/phpinfo.php

Now, open the file using the “vi” command.

root@test:~# vi /var/www/html/phpinfo.php

Next, add this small snippet of code to the phpinfo.php file. Click the ‘insert’ button to edit the file then paste it into the file.

<?php
// Show all information. This page defaults to INFO_ALL
phpinfo();
?>
Once the code has been added to the file, save the file using the “:wq” command.

Now, open your browser and type in the IP address of the server, followed by the phpinfo.php page like so: http://209.59.180.244/phpinfo.php

You should see a PHP page similar to the following:

PHP Version page

Install Other Services With Ease

If needed, you can install other multiple services like Tomcat, mail server, OpenSSH or a DNS server by using these Tasksel commands:

root@test2:~# tasksel install tomcat

root@test2:~# tasksel install mail-server

root@test2:~# tasksel install dns-server

root@test2:~# tasksel install openssh-server

In conclusion, Tasksel is an easy-to-use group package installer with a pleasing interface to assist users in installing multiple programs on their Dedicated Debian server or an Ubuntu-based private cloud servers.

How can we help?

Thanks for taking the time to read up on the benefits of using Tasksel. Our Support Team is full of talented System Admins who have intimate knowledge of private cloud hosting technologies like those discussed in this article. If you are unsure about any of the steps outlined above, we are just a phone call, chat or ticket away from providing further information. Let us know what you think!

Avatar for David Singer

About the Author: David Singer

I am a g33k, Linux blogger, developer, student, and former Tech Writer for Liquidweb.com. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Latest Articles

In-place CentOS 7 upgrades

Read Article

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article