How to install LAMP on Ubuntu 18.04

LAMP is a software bundle that is an acronym of the primary or original open source products, which include a Linux operating system, an Apache server, a MySQL database, and utilizes the PHP programming language; the acronym originated from Linux, Apache, MySQL, and PHP. However, the stack has interchangeable options, such as another web server, scripting, or database options. Using open source software allows the stack to be customized in ways that benefit the user without fear of being locked into a specific vendor or software producer.

A commonly used iteration of Linux is Ubuntu, a user-friendly Linux-based operating system that new and experienced users often utilize. For this guide, Ubuntu 18.04 is being used, which is the current stable release.

Getting Started

To get started installing the stack, you will need a freshly installed virtual machine (VM) with root access; root access is used to engage in administrator level actions on the operating system.

Installing the Stack on Ubuntu

Make sure that your version of Ubuntu is the current stable release, 18.04, before proceeding with your stack installation. You can start by verifying that your system is up to date:
apt update && apt upgrade -y

Once complete, you will need to install tasksel:
apt install tasksel

After completing the tasksel installation, it’s time to install the lamp server package, which will include Apache 2.4, PHP 7.2, and MySQL 5.7:
tasksel install lamp-server

When finished, you will need to secure your MySQL installation, since there’s a blank password by default:

Securing your MySQL Deployment

It’s important to secure your MySQL server deployment, especially since it’s installed with a blank password by default. Once completed, you can connect to MySQL with a blank password and use the VALIDATE PASSWORD PLUGIN function to test passwords and help improve security.

The plugin helps you create passwords that are considered secure enough for the installation. You will be prompted to setup the VALIDATE PASSWORD PLUGIN, pressing “y” for ‘yes’ or any other key for ‘no’.

Once you select ‘yes,’ you will be prompted to set the root password, entering it twice for confirmation.

On the default setup, MySQL has an anonymous user account, which allows any user to log on without having a user account created. The anonymous user accounts allow for easier testing environments and easier installations, but they should be removed before placing your VM into production.

To remove anonymous users, there will be a prompt asking you to select “y” for ‘yes’ or any other key for ‘no.’ Make your selection of “y” and complete the removal when ready.

When setting up a stack installation with root access, it’s important to set up your root connection to connect from ‘localhost.’ Setting up the connection in this fashion keeps users from attempting to guess the password and connecting from unauthorized locations.

During setup, you will be prompted to “disallow root login remotely,” pressing “y” for ‘yes’ and any other key for ‘no.’ Select “y” to disallow remote root logins.

There is another default database, named ‘test,’ that can be accessed by anyone and should be removed before placing your database in production.

Similar to the other steps, you will be prompted to select “y” for ‘yes’ or any other key for ‘no.’ Select “y” and remove the test database.

Once the test database has been dropped and privileges are removed, you will be prompted to reload privilege tables to ensure that changes take effect immediately. You will be prompted to select “y” for ‘yes’ or any other key for ‘no.’ Select “y” and complete the table reload, making your changes take effect.


You’ve successfully completed installing your LAMP stack on a virtual machine running Ubuntu 18.04; you’re ready to move your installation into production. If you found this process guide helpful, please share it with other users engaging in a similar setup, and review our other guides for additional help and support.

What’s new with Ubuntu 18.04 LTS?

Ubuntu is a popular Linux-based operating system, providing an open source alternative to other popular operating systems like Windows and Mac OS. With the variety of Linux operating systems available, Ubuntu has managed to become the most popular system for cloud storage solutions, personal computers, and even some server environments.

The next major release of Ubuntu is 18.04 LTS, given the identified “Bionic Beaver,” and will carry long term support for five years after release; when this period ends the product has reached its’ “end of life” point and no longer receives support or updates. Ubuntu 18.04 will be the first long-term support release since Ubuntu 16.04, sometimes called “Xenial Xerus.” When releases are referenced in common discussion, the descriptor or adjective is often used, such as “bionic” or “xenial” instead of the complete code name.

The Bionic Beaver release is scheduled for April 2018, though if there are bugs or potential development delays the release may be delayed.

Ubuntu 18.04 LTS Development

Compared to previous Ubuntu releases and updates, the Ubuntu 18.04 update will feature new additions, changes to the desktop environment, and kernel updates.

Previous Ubuntu releases have utilized Unity as the graphical interface for the desktop environment; Unity was first developed by Canonical Ltd, which is a development company for Ubuntu that helps offer commercial support when necessary. However, in April of 2017, Canonical announced they are no longer pursuing the Unity platform, choosing to utilize the GNOME Shell interface; this makes GNOME Shell the default going forward for Ubuntu releases.

This changeover from Unity to GNOME 3 was pushed by Canonical’s move to concentrate on their desktop, cloud computing, and Internet of Things (IoT) platforms; previously there was the ambition to move into a unified mobile device platform, but Canonical has since moved away from this.

The upcoming 18.04 release also has the expectation of a new theme default, providing an option similar to Windows operating systems instead of the previous Ubuntu 16.04 LTS release and Mac OS releases. Previous pain points from other Ubuntu themes have been addressed or removed, but the Ubuntu desktop team even reached out to the Ubuntu user community for help creating the new theme.

U18.04 Home

Ubuntu 18.04 – Daily Build (12/12/2017)

u16.04 - Home

Ubuntu 16.04

There’s also excited about the upcoming ability for color emoji fonts to be utilized, through the implementation of NotoColorEmoji, which offers color and black-and-white emoji fonts; this solution is also implemented on the latest stock Android devices.

Ubuntu 18.04 - NotoColorEmoji

Updates to the Linux Kernel

There are changes being implemented in the Linux kernel, currently on version 4.15; the kernel provides many helpful updates for users that experience issues were trying to manage their hardware with a non-stock operating system.

At the core of an operating system is the kernel, which is a program that has control over the entire computer system. After the system bootloader, the kernel is often one of the first programs to load, handling the remainder of the startup processes, software requests, and peripheral equipment (e.g., keyboards, printers, monitors, etc.) to the system. At its core, the kernel helps connect the hardware of the system to the software applications; kernels are often stored in protected areas of the system memory to keep them from being corrupted.

Updating the Linux kernel provides users with updates that help the operating system run efficiently, ensure issues or bugs are patched within the system and even give users support for hardware that may have had compatibility issues previously.

Some of these changes include DRM driver updates for AMDGPU/Radeon, Intel, Nouveau, and other driver options, AMD temperature monitoring, USB Type-C management support, and touchpad and touchscreen support for more devices. This kernel update also provides support for networking through Thunderbolt connections and enhancements to the Flash-Friendly File System, often abbreviated F2FS, which is a flash file system developed for use with Linux kernels.


The Bionic Beaver release, although highly anticipated, is not scheduled for a rollout until April 2018 at a minimum; this does not include any potential delays. However, the Ubuntu website is providing updates and a schedule of anticipated checkpoints leading up to the release. With this release being a Long Term Support release, it will receive five years of support for the desktop and server versions. At GloboTech Communications, we expect to release Ubuntu 18.04 for dedicated and cloud servers at the end of April 2018.