MasterServerBlog › lamp-install

Installing LAMP on Linux

← all articles

The abbreviation LAMP is an acronym made up of the first letters of Linux, Apache, MySQL, PHP.
In short, it is a basic set of software that is almost always installed on dedicated or virtual servers.

If your server was delivered with a control panel (ISPManager, DirectAdmin, Plesk, Cpanel, Vesta), these components are most likely already installed, or they can easily be added in a few clicks through the web interface.

Linux - the server operating system that virtually all websites on the internet run on;
Apache - the web server (it accepts user requests and returns responses);
MySQL - software for working with databases;
PHP  - the most widespread programming language on the web; countless websites, CMS engines, applications and other software are written in it.

Let's install LAMP on a Linux Debian / Ubuntu server

First, update the packages and repositories (if needed):

Log in to the server via SSH as the root user and enter the commands:
# apt-get update

Once the process finishes, enter:
# apt-get upgrade

To install Apache, run:
# apt-get install apache2

To install MySQL, run:
# apt-get install mysql-server mysql-client

Important! During the database server installation, the installer will ask you to enter the main root password. We recommend setting a strong password to avoid being hacked in the future.

To install PHP, run:
# apt-get install php5 php-pear php5-mysql

As the final step, restart apache with the command:
# service apache2 restart