Installing lamp on debian
Installing lamp on debian

How to install lamp server on Debian? Step by step guide

Debian is a Distribution along with its unique flavors wheeze,etc but all have the same architecture running in the background.You might see that most of the server these days run on Debian instead of ubuntu, still the scenario is changing is ,but the main reason is , Debian has the functionality of ubuntu yet is light weight and reliable compared to ubuntu. And being a server based OS it’s must definitely run internet’s most popular language PHP, and for that, there is need of a lamp server


Be Linux Termial Expert in Top 10 simple commandsSteps to install lamp server

Getting update and upgrade

If you are trying to install lamp server, but not finding those files in repository there, is no need to add an extra one, all you need is to update and upgrade you Debian cloud OS

Sudo apt-get update && Sudo apt-get upgrade -y

All this command can do is update your Debian package list from repositories thus making them available for download.The next command will  upgrade your kernel along with package which you have already installed to latest version, or you can do is safe upgrade, if you think you are going to brick something at software level or run in compatibility issues with the packages

Sudo apt-get upgrade –safe-upgrade

And you should be done with upgrading repositories

Installation of taskel

There is an alternative to installing procedure for all the application required for the lamp , by using Sudo apt-get install but by taskel command you get better faster command needed to install tasksel is

Sudo apt-get install Tasksel

INsome cases like on Ubuntu os or Latest Debian variant there is chance you might get tasksel command preinstalled but you can always run above command, It will install taskel in case not present or inform you about its installation if present.

Installation of lamp server

So first go into root mode by typing su command and password


then go to tasksel menu by typing


Screenshot-from-2016-08-09-100456-300x169passmyadmin-300x210Using  down arrow scroll down till you find the web server , make the highlighter go over it and then press space bar to mark it for installation and press enter and you are good to go.

It will ask you about MySQL database password, make sure it is hard and strong so it’s not easy to hack

How passwords are hacked?Methods.


Installing PHPMyAdmin

You can install this package by

Sudo apt-get install PHPMyAdmin

phpmyadmin-300x211It will ask you to choose web server should run on Lighttpd  or apache2, choose apache2 and enter administrative password, the password that you put in MySQL database while installation.Once you are done with that you got fully installed lamp server,

Testing and  correcting lamp server

Go to apache server file

cd /var/www

and create a PHP info, so that you test apache , you can do that by

nano info.php

A new window will open , then CTRL+SHIFT+V to paste the code below

Ctrl+O to save and then restart apache server, by command
service apache2 restart
then go to your server IP address or domain name/info.php example
You should see all lamp specs listed below ,
mysqladmin-300x188After that go to your domain/PHPMyAdmin example
and if you are able to login with the credentials you provided before that is Username and Password then you are good too, skip the steps below and enjoy

Correcting PHPMyAdmin error’s

In case you go to PHPMyAdmin management console and Page not found error is seen, enter the commands below
Sudo nano /etc/apache2/apache2.conf
scroll to the bottom and enter the following text
Include /etc/PHPMyAdmin/apache.conf
then CTRL+O to save the file and restart the server by command
sudo /etc/init.d/apache2 restart
and you must see the page,
After, this there must be no issue login to PHPMyAdmin, and thereafter you have successfully setup the lamp server on Debian
Be Linux Termial Expert in Top 10 simple commands

Leave a Reply