How to install an Apache LAMP Server (Linux, Apache, MySQL, PHP Server)


Step-by-Step Guide on Installing LAMP Server

Ubuntu and Debian

1. Update System Packages

sudo apt-get update && sudo apt-get upgrade -y

2. Install Apache

sudo apt-get install apache2 -y

3. Install MySQL

sudo apt-get install mysql-server -y

4. Install PHP

sudo apt-get install php libapache2-mod-php php-mysql -y

5. Restart Apache Server

sudo service apache2 restart


1. Update System Packages

sudo yum update -y

2. Install Apache

sudo yum install httpd -y

3. Start and Enable Apache

sudo systemctl start httpd && sudo systemctl enable httpd

4. Install MySQL (MariaDB)

sudo yum install mariadb-server mariadb -y

5. Start and Enable MySQL

sudo systemctl start mariadb && sudo systemctl enable mariadb

6. Install PHP

sudo yum install php php-mysql -y

7. Restart Apache Server

sudo systemctl restart httpd

  • webhosting, lamp, apache, mysql, php, linux, debian, centos, ubuntu
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Create an SSL Certificate on DirectAdmin Webhosting with Lets Encrypt

Guide on Creating an SSL Certificate on DirectAdmin Webhosting with Lets Encrypt Follow the...

How to make a FTP connection

How to Create an FTP Account on DirectAdmin Webhosting Panel and Connect Through Filezilla FTP...

How to install an Nginx LAMP Server (Linux, Nginx, MySQL, PHP Server)

Step 1: Update your system Before you begin, ensure your system is up to date. This can be done...

Powered by WHMCompleteSolution