Ubuntu Linux – Install LAMP-SERVER, linux, apache, mysql, php

Do you want to install LAMP-SERVER on Ubuntu Linux ?

LAMP stands for Linux, Apache, Mysql, Php

Its a package containing all required packages which are needed on linux for developing php application with apache server and mysql database server.

You can install each of the packages individually or just install a single package containing all this in one single command.

Which one you will prefer ?

Don’t worry ! I will show you both the methods…. 🙂

But one important thing, just make sure that you are logged in as ADMIN and full access to avoid any further problem.

If you are interested in installing everything in one command then you should check “Ubuntu Linux – Install Full LAMP Package with single command“.

Install all packages separately

Perform following commands

sudo apt-get install apache2

Now one all installation is done, just make sure that it is installed and working properly.

Try http://localhost/ or http://YOUR_IP_ADDRESS

It will show you a message in web page “It Works!” means “It is working”.

Now next step install php and required libraries & modules.

sudo apt-get install php5 libapache2-mod-php5

Once installation is done, restart apache.

sudo /etc/init.d/apache2 restart

Now make sure that PHP is working. Just create a simple php file in /var/www folder.

sudo gedit /var/www/check.php

Once editor is opened then put following code in that file.

<?php

echo "PHP is also working.";

phpinfo();
?>

Save & Close file.

Now open http://localhost/check.php

If you see a message “PHP is also working.” along with some more information about PHP, then its done. Its working.

If its not working then try to restart your computer and then try again.

Now next step is installing MySQL.

sudo apt-get install mysql-server

Now once this is over, first thing is we have to set the root password of MySQL.

mysql -u root

Now you will get a mysql terminal/command prompt.

mysql>SET PASSWORD FOR 'root@'localhost' = PASSWORD('ENTER YOUR PASSWORD');

Thats all ! You are done with installation.

If you like to work with GUI for databases, then you should install “PHPMYADMIN”.

sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

Once installation is started it will ask you for selecting server, there you select apache2 by hitting “SPACE” key and continue installation.

Test phpmyadmin in browser by http://localhost/phpmyadmin

ProWebGuru

Mostly I write about technology related stuff on https://www.prowebguru.com Recently I have started making videos also. Mostly blog posts & videos are related to technology, programming and learning some new tips and tricks related to windows, wordpress, google app script, technical, programming, javascript, jquery and other coding related stuff. Youtube channel - https://www.youtube.com/user/prowebguru

View Comments

Recent Posts

GPT 5.4: Powerful AI Breakthrough – 7 Game-Changing Features, Launch Date & Full Guide

GPT 5.4: The Next-Generation AI Model Transforming Reasoning, Coding, and Productivity Artificial Intelligence is evolving…

1 day ago

GPT‑5.3 Instant Explained: Faster, Smarter & Fewer Refusals

GPT-5.3 Instant is OpenAI's latest ChatGPT model update, prioritizing smoother conversations, fewer refusals, and higher…

2 days ago

Free Perplexity Pro for Airtel Customers: Unlock Advanced AI Assistance at No Cost!

Are you tired of scrolling endlessly through Google results trying to find clear, trustworthy answers?…

4 months ago

Unlocking Collaborative Coding with GitHub Copilot Spaces

In recent years, the process of software development has rapidly evolved—developers demand smarter tools and…

4 months ago

ChatGPT Go Now Free in India: Opening Doors to Advanced AI Capabilities

India has emerged as one of the fastest-growing and most significant markets in the global…

4 months ago

AgentKit by OpenAI: Redefining the Future of AI Agent Development

On October 6, 2025, OpenAI unveiled AgentKit, a unified suite of tools designed to help developers and…

5 months ago

This website uses cookies.