How to Install a LAMP Stack on Debian

There are a variety of options you have to customize your Cloud VPS. The most popular combination of software used for web servers is commonly know as the LAMP Stack. LAMP is actually an acronym consisting of the following softwares (intended to run the web server): Linux, Apache, MySQL, and PHP.

Since Debian is already installed, the L portion (Linux) of the LAMP Stack is already installed. In this guide, you can learn how to install Apache, MySQL, and PHP on Debian, to create a LAMP Stack on Debian.

Before You Begin

Install Apache

Apache is the HTTP daemon (application) that handles serving the website(s) you create. For more information about Apache, you can review the documentation.

Similar to how you would install Apache on other Linux distros, you can simply run a command to accomplish this. In this section, you can learn the command used to install Apache on Debian.

  1. SSH into your server as the root user.
  2. Run the following command:apt-get install apache2 apache2-doc
  3. You will be prompted to install the packages found, simply, type ‘y‘ and then hit Enter.

Install MySQL

MySQL is the database management system that most websites (like WordPress, Drupal, Joomla!) require for advanced functionalies. For more information about MySQL, you can review the Dev.MySQL.com documentation.

MySQL is installed in the same manner as Apache. Simply run the command specific to Debian. In this section, you can learn the process to install MySQL on Debian.

    1. SSH into your server as the root user.
    2. Run the following command:apt-get install mysql-server php5-mysql
    3. You will be prompted to install the packages found, simply, type ‘y‘ and then hit Enter.

Install PHP

PHP is one of the scripting languages that can be used by Apache to run the scripts that render your website(s). For more information about PHP, you can review official PHP.net documentation.

PHP is simply installed using a specific (to the OS) command. In this section, you can learn the command used to install PHP on Debian.

  1. SSH into your server as the root user.
  2. Run the following command to run the installation script for PHP:apt-get install php5-common libapache2-mod-php5 php5-cli
  3. You will be prompted to install the packages found, simply, type ‘y‘ and then hit Enter.
  4. Once the installation completes, you should restart Apache, for the PHP configuration to be included immediately. To do this, run the following command:service apache2 restart

Congratulations! If you have followed this entire guide, then you have just installed the necessary applications to complete a LAMP Stack. Now, it is recommended that you test each application, to ensure full functionality of your LAMP Stack.

Learn more from our Cloud Server Hosting Product Guide.

Experience full control over your server environment and deploy the best operating and management systems that fit your needs with our reliable Cloud VPS Hosting!

JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

Was this article helpful? Join the conversation!