How to Easily Install LAMP on Ubuntu
Cloudmatika / March 24, 2026
LAMP is an acronym for Linux, Apache, MySQL, and Perl/PHP/Python. It is a free software package used to run a complete application.
The components of LAMP are:
- Linux – operating system
- Apache HTTP Server – web server
- MariaDB or MySQL – database system
- PHP or Perl or Python – programming language used
Here is an easy way to install LAMP on Ubuntu:
- Log in to your Ubuntu VPS/Server as “root” or a user with the necessary permissions to install all Web Server requirements (To log in, you can use Putty on Windows or access the terminal on Linux)
- Once you are in the Terminal on Ubuntu Linux, please run the apt-get update command first to streamline the LAMP installation process. Type the following command: sudo apt-get update
- After the apt-get update is complete, next install Apache2 as the Web Server by typing the following command: sudo apt-get install -y apache2
*The -y parameter indicates a “y” (yes) response to every Yes/No prompt
- After the Apache2 installation is complete, you can check it via a browser by typing your VPS’s IP address. For example, if your VPS IP is 192.168.1.2, you can type http://192.168.1.2 into your browser, which will display the Apache2 page.
- The next step is to install MariaDB. MariaDB is a database platform created by the MySQL developers. Since MySQL was acquired by Oracle, its developers have shifted to creating a new database platform that offers many advantages over MySQL.
- Since MariaDB is a continuation project created by the MySQL developers, all MySQL commands and syntax are fully compatible with MariaDB.
- To install MariaDB on Ubuntu, type the following command: sudo apt-get install -y mariadb-server mariadb-client
- After installing MariaDB, start MariaDB by typing the following command: sudo service mysql start
- Then, check the MariaDB status by typing the following command: sudo service mysql status
- Next, to secure MySQL, type the following command: sudo mysql_secure_installation
- Next, we’ll install PHP7 on Ubuntu using the following command: sudo apt-get install -y php libapache2-mod-php php-mcrypt php-mysql
- Once the installation is complete, please restart Apache by typing the following command: sudo service apache2 restart
- You have successfully installed LAMP on your Ubuntu VPS/Server, and by default, your website is located in the /var/www/ directory
Recent Articles
-
Cloudmatika / July 17, 2026
How to Install and Configure an SSL Certificate on Windows Server and IIS
-
Cloudmatika / March 30, 2026
Tier 3 Data Center for Stable Business Operations
-
Cloudmatika / March 30, 2026
Cyber Protect for the Digital Industry: Strategies for Protecting Data, Systems, and Business Operations
-
Cloudmatika / March 26, 2026
Save Costs with Containers in a Virtual Data Center
-
Cloudmatika / March 26, 2026
Zimbra Email & Collaboration for Cost Efficiencies
