Atlantic.Net Blog

How to Install LAMP on an Ubuntu 15.04 Server

Atlantic.Net NOC
by Atlantic.Net (64posts) under VPS Hosting
Verified and Tested 05/06/15


In this How-To, we will walk you through installing LAMP on your Ubuntu 15.04 cloud server. LAMP is simply a software bundle that consists of 4 components. Linux (L) is the core of the platform which will sustain the other components. Apache (A) is used for the web hosting service. MySQL (M) is used for database management. PHP (P) is the application programming language.


A server with Ubuntu 15.04 already installed. If you do not have a server already, consider a Virtual Private Server from and be up in under 30 seconds.

Installing LAMP on Ubuntu 15.04

We will first start by installing Apache. Apache is an open source web server and is the most popular web server in the world.

Installing Apache

Install Apache with the following command for to begin the install:

apt-get -y install apache2

Verify if all is working by opening your browser and going to http://<ipaddress>

If you are unsure what you IP address is run the following:

anet-Installing LAMP on Ubuntu 15.04

ifconfig command


In this example, we would go do which should open a page looking like this

anet-Getting Started with Ubuntu 14.04-LAMP

Apache Default Page

Installing MySQL (M)

Next we will install MySQL by running the following command:

apt-get install mysql-server mysql-client

You will be prompted to enter a new password for MySQL “root” user, enter what you would like.

anet-Installing LAMP on Ubuntu 15.04

MySQL root database password

You are then asked to enter the password again.

anet-Installing LAMP on Ubuntu 15.04

Re-enter MySQL root database password


Once complete, you can verify MySQL is installed by running the below command.

systemctl status mysql

It will show active(running)

anet-Installing LAMP on Ubuntu 15.04

MySQL status

Next, you will want to secure MySQL by running the following command:


This command will first ask you for your current MySQL “root” user password which we created earlier when installing MySQL. Enter the password and continue. You are then asked if you would like to change the root password, type “n” and press enter unless you want to change it. The next couple of questions you will say yes to as it will secure your MySQL. The command will remove anonymous user access, disallow root login remotely, remove the test database and access to it. Last question is to reload the privilege tables, say yes and press Enter.

anet-Installing LAMP on Ubuntu 15.04

MySQL secure installation questions

Installing PHP

To install PHP, run the following command:

apt-get -y install php5 php5-mysql libapache2-mod-php5

To test PHP, we will save a basic PHP script under the web root directory. For Ubuntu 15.04, this is located in /var/www/html so we would want to open a test file called something like test.php by running the following command:

nano /var/www/html/test.php

This will open an empty file, we will add the following text:


Save and close the file.

You will now need to restart Apache for the changes to take effect. To restart Apache, run the following command:

systemctl restart apache2

We can now test php by opening up an internet browser and opening up the PHP script we saved. In this article, our server IP address from earlier is and the PHP script is saved under the web root directory named test.php. We will now enter for the URL and press Enter. You will see the following screen if installed and working properly.

anet-Installing LAMP

PHP Version and Information

Come back and check for updates, and try a Virtual Private Server from Atlantic.Net.

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4


London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom